Skip to content

Commit aaa1ba1

Browse files
committed
Initialized gradle and added JUnit Jupiter libraries
1 parent d8d66d0 commit aaa1ba1

19 files changed

+553
-0
lines changed

.gitattributes

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# These are explicitly windows files and should use crlf
5+
*.bat text eol=crlf
6+

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
3+
4+
# Ignore Gradle build output directory
5+
build

.idea/.gitignore

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/AceTheJavaCodingInterview.iml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/aws.xml

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codestream.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* This file was generated by the Gradle 'init' task.
3+
*
4+
* This generated file contains a sample Java application project to get you started.
5+
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
6+
* User Manual available at https://docs.gradle.org/7.4/userguide/building_java_projects.html
7+
* This project uses @Incubating APIs which are subject to change.
8+
*/
9+
10+
plugins {
11+
// Apply the application plugin to add support for building a CLI application in Java.
12+
id 'application'
13+
}
14+
15+
repositories {
16+
// Use Maven Central for resolving dependencies.
17+
mavenCentral()
18+
}
19+
20+
dependencies {
21+
// This dependency is used by the application.
22+
implementation 'com.google.guava:guava:30.1.1-jre'
23+
}
24+
25+
testing {
26+
suites {
27+
// Configure the built-in test suite
28+
test {
29+
// Use JUnit Jupiter test framework
30+
useJUnitJupiter('5.8.1')
31+
}
32+
}
33+
}
34+
35+
application {
36+
// Define the main class for the application.
37+
mainClass = 'AceTheJavaCodingInterview.App'
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* This Java source file was generated by the Gradle 'init' task.
3+
*/
4+
package AceTheJavaCodingInterview;
5+
6+
public class App {
7+
public String getGreeting() {
8+
return "Hello World!";
9+
}
10+
11+
public static void main(String[] args) {
12+
System.out.println(new App().getGreeting());
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* This Java source file was generated by the Gradle 'init' task.
3+
*/
4+
package AceTheJavaCodingInterview;
5+
6+
import org.junit.jupiter.api.Test;
7+
import static org.junit.jupiter.api.Assertions.*;
8+
9+
class AppTest {
10+
@Test void appHasAGreeting() {
11+
App classUnderTest = new App();
12+
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
13+
}
14+
}

build.gradle

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
plugins {
2+
id 'java'
3+
}
4+
5+
group 'com.dk'
6+
version '1.0-SNAPSHOT'
7+
8+
repositories {
9+
mavenCentral()
10+
}
11+
12+
test {
13+
14+
testLogging {
15+
events "started", "passed", "skipped", "failed"
16+
showStandardStreams = true
17+
exceptionFormat = "full"
18+
}
19+
20+
21+
useJUnitPlatform()
22+
23+
//testLogging.showStandardStreams = true
24+
//testLogging.exceptionFormat = 'full'
25+
}
26+
27+
dependencies {
28+
29+
// Implementation
30+
implementation group: 'eu.benschroeder', name: 'mockito-extension', version: '4.3.0'
31+
implementation 'org.apache.logging.log4j:log4j-api:2.18.0'
32+
33+
34+
// Test Implementation
35+
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.9.0'
36+
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.9.0'
37+
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.9.0'
38+
testImplementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.18.0'
39+
testImplementation 'org.assertj:assertj-core:3.23.1'
40+
testImplementation 'org.hamcrest:hamcrest:2.2'
41+
testImplementation 'org.skyscreamer:jsonassert:1.5.1'
42+
//testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-migrationsupport', version: '5.9.0'
43+
// testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '4.6.1'
44+
// testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.6.1'
45+
46+
compileOnly 'org.projectlombok:lombok:1.18.24'
47+
48+
// Test RuntimeOnly
49+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
50+
}
51+
52+
test {
53+
useJUnitPlatform()
54+
}

gradle/wrapper/gradle-wrapper.jar

58.4 KB
Binary file not shown.
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)