├── .gitignore ├── .travis.yml ├── Jenkinsfile ├── README.md ├── build.gradle ├── build ├── classes │ └── java │ │ ├── main │ │ └── hello │ │ │ ├── Greeter.class │ │ │ └── HelloWorld.class │ │ └── test │ │ └── hello │ │ └── TestGreeter.class ├── distributions │ ├── HelloWorld.tar │ └── HelloWorld.zip ├── libs │ └── jb-hello-world-0.1.0.jar ├── reports │ └── tests │ │ └── test │ │ ├── classes │ │ └── hello.TestGreeter.html │ │ ├── css │ │ ├── base-style.css │ │ └── style.css │ │ ├── index.html │ │ ├── js │ │ └── report.js │ │ └── packages │ │ └── hello.html ├── scripts │ ├── HelloWorld │ └── HelloWorld.bat ├── test-results │ └── test │ │ ├── TEST-hello.TestGreeter.xml │ │ └── binary │ │ ├── output.bin │ │ ├── output.bin.idx │ │ └── results.bin └── tmp │ └── jar │ └── MANIFEST.MF ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src ├── main └── java │ └── hello │ ├── Greeter.java │ └── HelloWorld.java └── test └── java └── hello └── TestGreeter.java /.gitignore: -------------------------------------------------------------------------------- 1 | Operating System Files 2 | 3 | *.DS_Store 4 | Thumbs.db 5 | *.sw? 6 | .#* 7 | *# 8 | *~ 9 | *.sublime-* 10 | 11 | # Build Artifacts 12 | 13 | .gradle/ 14 | target/ 15 | dependency-reduced-pom.xml 16 | 17 | # Eclipse Project Files 18 | 19 | .classpath 20 | .project 21 | .settings/ 22 | 23 | # IntelliJ IDEA Files 24 | 25 | *.iml 26 | *.ipr 27 | *.iws 28 | *.idea 29 | 30 | README.html 31 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | 3 | script: ./gradlew build 4 | 5 | deploy: 6 | provider: releases 7 | api_key: 8 | secure: $GITHUB_OAUTH_TOKEN 9 | file_glob: true 10 | file: build/**/* 11 | skip_cleanup: true 12 | on: 13 | tags: true 14 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | stages { 4 | stage('Clean Workspace') { 5 | steps { 6 | deleteDir() 7 | } 8 | } 9 | stage('Clone Project') { 10 | steps { 11 | checkout scm 12 | } 13 | } 14 | stage('Build') { 15 | steps { 16 | sh './gradlew clean build' 17 | } 18 | post { 19 | always { 20 | jiraSendBuildInfo site: 'bashsquad.atlassian.net' 21 | } 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Building Java Projects with Gradle 2 | 3 | ##### This guide walks you through using Gradle to build a simple Java project. 4 | 5 | ### What you’ll need 6 | + A favorite text editor or IDE 7 | + JDK 6 or later 8 | + Install Gradle 9 | 10 | ### Install Gradle 11 | + **On Unix** 12 | 13 | ``` 14 | $ sudo add-apt-repository ppa:cwchien/gradle 15 | $ sudo apt-get update 16 | $ sudo apt-get install gradle 17 | ``` 18 | 19 | 20 | + **On Mac OS X** 21 | + `brew install gradle` 22 | 23 | + [Install Homebrew](http://brew.sh/). 24 | 25 | 26 | + **On Windows** 27 | 28 | + [Download from Gradle site](https://docs.gradle.org/current/userguide/installation.html). 29 | 30 | + Unzip the Gradle download to the folder to which you would like to install Gradle, eg. “C:\Program Files”. The subdirectory gradle-x.x will be created from the archive, where x.x is the version. 31 | 32 | + Add location of your Gradle “bin” folder to your path. Open the system properties (WinKey + Pause), select the “Advanced” tab, and the “Environment Variables” button, then add “C:\Program Files\gradle-x.x\bin” (or wherever you unzipped Gradle) to the end of your “Path” variable under System Properties. Be sure to omit any quotation marks around the path even if it contains spaces. Also make sure you separated from previous PATH entries with a semicolon “;”. 33 | 34 | + In the same dialog, make sure that JAVA_HOME exists in your user variables or in the system variables and it is set to the location of your JDK, e.g. C:\Program Files\Java\jdk1.7.0_06 and that %JAVA_HOME%\bin is in your Path environment variable. 35 | 36 | + Open a new command prompt (type cmd in Start menu) and run gradle –version to verify that it is correctly installed. 37 | 38 | ### To test the Gradle installation, run Gradle from the command-line: `gradle` 39 | + If all goes well, you see a welcome message: 40 | ``` 41 | :help 42 | 43 | Welcome to Gradle 2.8. 44 | 45 | To run a build, run gradle ... 46 | 47 | To see a list of available tasks, run gradle tasks 48 | 49 | To see a list of command-line options, run gradle --help 50 | 51 | To see more detail about a task, run gradle help --task 52 | 53 | BUILD SUCCESSFUL 54 | 55 | Total time: 6.317 secs 56 | ``` 57 | 58 | + You now have Gradle installed. 59 | 60 | #### Find out what Gradle can do 61 | Now that Gradle is installed, see what it can do. Before you even create a build.gradle file for the project. 62 | 63 | + You can ask it what tasks are available: `gradle tasks` 64 | 65 | + If you run `gradle tasks` this command out side your project directory then you can see the output. 66 | 67 | ``` 68 | :tasks 69 | ------------------------------------------------------------ 70 | All tasks runnable from root project 71 | ------------------------------------------------------------ 72 | 73 | Build Setup tasks 74 | ----------------- 75 | init - Initializes a new Gradle build. [incubating] 76 | wrapper - Generates Gradle wrapper files. [incubating] 77 | 78 | Help tasks 79 | ---------- 80 | components - Displays the components produced by root project 'jabed'. [incubating] 81 | dependencies - Displays all dependencies declared in root project 'jabed'. 82 | dependencyInsight - Displays the insight into a specific dependency in root project 'jabed'. 83 | help - Displays a help message. 84 | model - Displays the configuration model of root project 'jabed'. [incubating] 85 | projects - Displays the sub-projects of root project 'jabed'. 86 | properties - Displays the properties of root project 'jabed'. 87 | tasks - Displays the tasks runnable from root project 'jabed'. 88 | 89 | To see all tasks and more detail, run gradle tasks --all 90 | 91 | To see more detail about a task, run gradle help --task 92 | 93 | BUILD SUCCESSFUL 94 | 95 | Total time: 2.435 secs 96 | ``` 97 | 98 | ### Set up the project 99 | First you set up a Java project for Gradle to build. To keep the focus on Gradle, make the project as simple as possible for now. 100 | 101 | ##### Create the directory structure 102 | + Create a root project directory named `HelloWorld` and `cd HelloWorld` . 103 | 104 | + In a project directory of your choosing, create the following subdirectory structure; 105 | 106 | + For example, with `mkdir -p src/main/java/hello` on nix systems: 107 | 108 | + on Windows you can create this directory manually. 109 | ``` 110 | └── src 111 | └── main 112 | └── java 113 | └── hello 114 | ``` 115 | 116 | + Within the `src/main/java/hello` directory, you can create any Java classes you want. For simplicity’s sake and for consistency with the rest of this guide, Spring recommends that you create two classes: `HelloWorld.java` and `Greeter.java`. 117 | 118 | 119 | + src/main/java/hello/HelloWorld.java 120 | ``` 121 | package hello; 122 | 123 | public class HelloWorld { 124 | public static void main(String[] args) { 125 | Greeter greeter = new Greeter(); 126 | System.out.println(greeter.sayHello()); 127 | } 128 | } 129 | ``` 130 | 131 | + src/main/java/hello/Greeter.java 132 | ``` 133 | package hello; 134 | public class Greeter { 135 | public String sayHello() { 136 | return "Hello world!"; 137 | } 138 | } 139 | ``` 140 | 141 | Our project setup is done. :) 142 | 143 | ### Build Java code 144 | 145 | Now we are behind few step. 146 | 147 | + `cd HelloWorld` and run `gradle init`. 148 | 149 | + After finished init you can see new file and directory are created. 150 | 151 | + Open `build.gradle` file and add this line `apply plugin: 'java'`. 152 | 153 | + Now Run this command `gradle build`. 154 | 155 | To see the results of the build effort, take a look in the build folder. Therein you’ll find several directories, including these three notable folders: 156 | 157 | + classes. The project’s compiled .class files. 158 | + libs. Assembled project libraries (usually JAR and/or WAR files). 159 | 160 | 161 | + To make this code runnable, we can use gradle’s application plugin. Add this to your `build.gradle` file.Now Open `build.gradle` file and add this two line 162 | ``` 163 | apply plugin: 'application' 164 | mainClassName = 'hello.HelloWorld' 165 | ``` 166 | 167 | + We are almost done just run this command `gradle run`. 168 | Now you can see the output 169 | 170 | ``` 171 | :compileJava UP-TO-DATE 172 | :processResources UP-TO-DATE 173 | :classes UP-TO-DATE 174 | :run 175 | 176 | Hello world! 177 | 178 | BUILD SUCCESSFUL 179 | Total time: 4.009 secs 180 | ``` 181 | 182 | Yes we have done .... :) 183 | 184 | ### Declare dependencies 185 | 186 | The simple Hello World sample is completely self-contained and does not depend on any additional libraries. Most applications, however, depend on external libraries to handle common and/or complex functionality. 187 | 188 | For example, suppose that in addition to saying "Hello World!", you want the application to print the current date and time. You could use the date and time facilities in the native Java libraries, but you can make things more interesting by using the Joda Time libraries. 189 | 190 | + First, change `HelloWorld.java` to look like this: 191 | ``` 192 | package hello; 193 | 194 | import org.joda.time.LocalTime; 195 | 196 | public class HelloWorld { 197 | public static void main(String[] args) { 198 | LocalTime currentTime = new LocalTime(); 199 | System.out.println("The current local time is: " + currentTime); 200 | 201 | Greeter greeter = new Greeter(); 202 | System.out.println(greeter.sayHello()); 203 | } 204 | } 205 | ``` 206 | 207 | + Here `HelloWorld` uses Joda Time’s `LocalTime` class to get and print the current time. 208 | 209 | + If you ran `gradle build` to build the project now, the build would fail because you have not declared Joda Time as a compile dependency in the build. 210 | 211 | + For starters, you need to add a source for 3rd party libraries in your `build.gradle` file. 212 | ``` 213 | repositories { 214 | mavenCentral() 215 | } 216 | ``` 217 | 218 | + The `repositories` block indicates that the build should resolve its dependencies from the Maven Central repository. 219 | 220 | + Now that we’re ready for 3rd party libraries, let’s declare some in your `build.gradle` file. 221 | ``` 222 | sourceCompatibility = 1.8 223 | targetCompatibility = 1.8 224 | 225 | dependencies { 226 | compile "joda-time:joda-time:2.2" 227 | } 228 | ``` 229 | 230 | With the `dependencies` block, you declare a single dependency for Joda Time. Specifically, you’re asking for (reading right to left) version 2.2 of the joda-time library, in the joda-time group. 231 | 232 | Another thing to note about this dependency is that it is a `compile` dependency, indicating that it should be available during compile-time (and if you were building a WAR file, included in the /WEB-INF/libs folder of the WAR). Other notable types of dependencies include: 233 | + `providedCompile`. Required dependencies for compiling the project code, but that will be provided at runtime by a container running the code (for example, the Java Servlet API). 234 | + `testCompile`. Dependencies used for compiling and running tests, but not required for building or running the project’s runtime code. 235 | 236 | 237 | + Finally, let’s specify the name for our JAR artifact ( optional). 238 | ``` 239 | jar { 240 | baseName = 'hello-world-gradle' 241 | version = '0.1.0' 242 | } 243 | ``` 244 | 245 | The `jar` block specifies how the JAR file will be named. In this case, it will render `jb-hello-world-gradle-0.1.0.jar`. 246 | 247 | Now if you run `gradle build`, Gradle should resolve the Joda Time dependency from the Maven Central repository and the build will succeed. 248 | 249 | ### Build your project with Gradle Wrapper 250 | 251 | + The Gradle Wrapper is the preferred way of starting a Gradle build. 252 | - It consists of a batch script for Windows. 253 | - and a shell script for OS X and Linux. 254 | 255 | + These scripts allow you to run a Gradle build without requiring that Gradle be installed on your system. 256 | 257 | + To make this possible, add the following block to the bottom of your `build.gradle`. 258 | 259 | ``` 260 | task wrapper(type: Wrapper) { 261 | gradleVersion = '2.8' 262 | } 263 | ``` 264 | 265 | + Run the following command to download and initialize the wrapper scripts: `gradle wrapper`. 266 | 267 | + After this task completes, you will notice a few new files. The two scripts are in the root of the folder, while the wrapper jar and properties files have been added to a new `gradle/wrapper` folder. 268 | 269 | ``` 270 | └── HelloWorld 271 | └── gradlew 272 | └── gradlew.bat 273 | └── gradle 274 | └── wrapper 275 | └── gradle-wrapper.jar 276 | └── gradle-wrapper.properties 277 | ``` 278 | 279 | + The Gradle Wrapper is now available for building your project. 280 | 281 | + Add it to your version control system, and everyone that clones your project can build it just the same. It can be used in the exact same way as an installed version of Gradle. Run the wrapper script to perform the build task, just like you did previously: `./gradlew build` 282 | 283 | + The first time you run the wrapper for a specified version of Gradle, it downloads and caches the Gradle binaries for that version. The Gradle Wrapper files are designed to be committed to source control so that anyone can build the project without having to first install and configure a specific version of Gradle. 284 | 285 | + At this stage, you will have built your code. You can see the results here: 286 | 287 | ``` 288 | build 289 | ├── classes 290 | │ └── main 291 | │ └── hello 292 | │ ├── Greeter.class 293 | │ └── HelloWorld.class 294 | ├── dependency-cache 295 | ├── libs 296 | │ └── hello-world-gradle-0.1.0.jar 297 | └── tmp 298 | └── jar 299 | └── MANIFEST.MF 300 | ``` 301 | 302 | + Included are the two expected class files for Greeter and HelloWorld, as well as a JAR file. Take a quick peek: 303 | 304 | ``` 305 | $ jar tvf build/libs/hello-world-gradle-0.1.0.jar 306 | 0 Mon Nov 16 13:41:22 BDT 2015 META-INF/ 307 | 25 Mon Nov 16 13:41:22 BDT 2015 META-INF/MANIFEST.MF 308 | 0 Mon Nov 16 13:41:22 BDT 2015 hello/ 309 | 988 Mon Nov 16 13:41:22 BDT 2015 hello/HelloWorld.class 310 | 369 Mon Nov 16 13:41:22 BDT 2015 hello/Greeter.class 311 | ``` 312 | 313 | + To wrap things up for this guide, here is the completed `build.gradle` file: `build.gradle` 314 | 315 | ``` 316 | apply plugin: 'java' 317 | apply plugin: 'eclipse' 318 | apply plugin: 'application' 319 | 320 | mainClassName = 'hello.HelloWorld' 321 | 322 | // tag::repositories[] 323 | repositories { 324 | mavenCentral() 325 | } 326 | // end::repositories[] 327 | 328 | // tag::jar[] 329 | jar { 330 | baseName = 'hello-world-gradle' 331 | version = '0.1.0' 332 | } 333 | // end::jar[] 334 | 335 | // tag::dependencies[] 336 | sourceCompatibility = 1.8 337 | targetCompatibility = 1.8 338 | 339 | dependencies { 340 | compile "joda-time:joda-time:2.2" 341 | } 342 | // end::dependencies[] 343 | 344 | // tag::wrapper[] 345 | task wrapper(type: Wrapper) { 346 | gradleVersion = '2.3' 347 | } 348 | // end::wrapper[] 349 | ``` 350 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This build file was auto generated by running the Gradle 'init' task 3 | * by 'jabed' at '11/14/15 7:37 PM' with Gradle 2.8 4 | * 5 | * This generated file contains a commented-out sample Java project to get you started. 6 | * For more details take a look at the Java Quickstart chapter in the Gradle 7 | * user guide available at https://docs.gradle.org/2.8/userguide/tutorial_java_projects.html 8 | */ 9 | 10 | /* 11 | // Apply the java plugin to add support for Java 12 | apply plugin: 'java' 13 | // In this section you declare where to find the dependencies of your project 14 | repositories { 15 | // Use 'jcenter' for resolving your dependencies. 16 | // You can declare any Maven/Ivy/file repository here. 17 | jcenter() 18 | } 19 | // In this section you declare the dependencies for your production and test code 20 | dependencies { 21 | // The production code uses the SLF4J logging API at compile time 22 | compile 'org.slf4j:slf4j-api:1.7.12' 23 | // Declare the dependency for your favourite test framework you want to use in your tests. 24 | // TestNG is also supported by the Gradle Test task. Just change the 25 | // testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add 26 | // 'test.useTestNG()' to your build script. 27 | testCompile 'junit:junit:4.12' 28 | } 29 | */ 30 | 31 | apply plugin: 'java' 32 | apply plugin: 'eclipse' 33 | apply plugin: 'application' 34 | 35 | mainClassName = 'hello.HelloWorld' 36 | 37 | // tag::repositories[] 38 | repositories { 39 | mavenCentral() 40 | } 41 | // end::repositories[] 42 | 43 | // tag::jar[] 44 | jar { 45 | baseName = 'jb-hello-world' 46 | version = '0.1.0' 47 | } 48 | // end::jar[] 49 | 50 | // tag::dependencies[] 51 | sourceCompatibility = 1.7 52 | targetCompatibility = 1.7 53 | 54 | dependencies { 55 | compile "joda-time:joda-time:2.2" 56 | testCompile "junit:junit:4.12" 57 | } 58 | // end::dependencies[] 59 | 60 | // tag::wrapper[] 61 | task wrapper(type: Wrapper) { 62 | gradleVersion = '3.5' 63 | } 64 | // end::wrapper[] 65 | -------------------------------------------------------------------------------- /build/classes/java/main/hello/Greeter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jabedhasan21/java-hello-world-with-gradle/f5eab08edf1ec9e1b8e15f032afe42216400433d/build/classes/java/main/hello/Greeter.class -------------------------------------------------------------------------------- /build/classes/java/main/hello/HelloWorld.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jabedhasan21/java-hello-world-with-gradle/f5eab08edf1ec9e1b8e15f032afe42216400433d/build/classes/java/main/hello/HelloWorld.class -------------------------------------------------------------------------------- /build/classes/java/test/hello/TestGreeter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jabedhasan21/java-hello-world-with-gradle/f5eab08edf1ec9e1b8e15f032afe42216400433d/build/classes/java/test/hello/TestGreeter.class -------------------------------------------------------------------------------- /build/distributions/HelloWorld.tar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jabedhasan21/java-hello-world-with-gradle/f5eab08edf1ec9e1b8e15f032afe42216400433d/build/distributions/HelloWorld.tar -------------------------------------------------------------------------------- /build/distributions/HelloWorld.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jabedhasan21/java-hello-world-with-gradle/f5eab08edf1ec9e1b8e15f032afe42216400433d/build/distributions/HelloWorld.zip -------------------------------------------------------------------------------- /build/libs/jb-hello-world-0.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jabedhasan21/java-hello-world-with-gradle/f5eab08edf1ec9e1b8e15f032afe42216400433d/build/libs/jb-hello-world-0.1.0.jar -------------------------------------------------------------------------------- /build/reports/tests/test/classes/hello.TestGreeter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Test results - Class hello.TestGreeter 7 | 8 | 9 | 10 | 11 | 12 |
13 |

Class hello.TestGreeter

14 | 17 |
18 | 19 | 20 | 52 | 58 | 59 |
21 |
22 | 23 | 24 | 30 | 36 | 42 | 48 | 49 |
25 |
26 |
4
27 |

tests

28 |
29 |
31 |
32 |
1
33 |

failures

34 |
35 |
37 |
38 |
0
39 |

ignored

40 |
41 |
43 |
44 |
0.003s
45 |

duration

46 |
47 |
50 |
51 |
53 |
54 |
75%
55 |

successful

56 |
57 |
60 |
61 |
62 | 70 |
71 |

Failed tests

72 |
73 | 74 |

newtestWMGreeterFail

75 | 76 |
org.junit.ComparisonFailure: expected:<[Sandvich]> but was:<[Boris]>
 77 | 	at org.junit.Assert.assertEquals(Assert.java:115)
 78 | 	at org.junit.Assert.assertEquals(Assert.java:144)
 79 | 	at hello.TestGreeter.newtestWMGreeterFail(TestGreeter.java:41)
 80 | 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 81 | 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 82 | 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 83 | 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
 84 | 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
 85 | 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
 86 | 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
 87 | 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
 88 | 	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
 89 | 	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
 90 | 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
 91 | 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
 92 | 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
 93 | 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
 94 | 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
 95 | 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
 96 | 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
 97 | 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
 98 | 	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
 99 | 	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
100 | 	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
101 | 	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
102 | 	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
103 | 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
104 | 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
105 | 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
106 | 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
107 | 	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
108 | 	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
109 | 	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
110 | 	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
111 | 	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
112 | 	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:118)
113 | 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
114 | 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
115 | 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
116 | 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
117 | 	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
118 | 	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
119 | 	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
120 | 	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
121 | 	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
122 | 	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
123 | 	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
124 | 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
125 | 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
126 | 	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
127 | 	at java.base/java.lang.Thread.run(Thread.java:834)
128 | 
129 |
130 |
131 |
132 |
133 |

Tests

134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 |
TestDurationResult
newtestWMGreeterFail0.003sfailed
newtestWMGreeterPass0spassed
testGreeter0spassed
testGreeterEmpty0spassed
163 |
164 |
165 | 174 |
175 | 176 | 177 | -------------------------------------------------------------------------------- /build/reports/tests/test/css/base-style.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | margin: 0; 4 | padding: 0; 5 | font-family: sans-serif; 6 | font-size: 12pt; 7 | } 8 | 9 | body, a, a:visited { 10 | color: #303030; 11 | } 12 | 13 | #content { 14 | padding-left: 50px; 15 | padding-right: 50px; 16 | padding-top: 30px; 17 | padding-bottom: 30px; 18 | } 19 | 20 | #content h1 { 21 | font-size: 160%; 22 | margin-bottom: 10px; 23 | } 24 | 25 | #footer { 26 | margin-top: 100px; 27 | font-size: 80%; 28 | white-space: nowrap; 29 | } 30 | 31 | #footer, #footer a { 32 | color: #a0a0a0; 33 | } 34 | 35 | #line-wrapping-toggle { 36 | vertical-align: middle; 37 | } 38 | 39 | #label-for-line-wrapping-toggle { 40 | vertical-align: middle; 41 | } 42 | 43 | ul { 44 | margin-left: 0; 45 | } 46 | 47 | h1, h2, h3 { 48 | white-space: nowrap; 49 | } 50 | 51 | h2 { 52 | font-size: 120%; 53 | } 54 | 55 | ul.tabLinks { 56 | padding-left: 0; 57 | padding-top: 10px; 58 | padding-bottom: 10px; 59 | overflow: auto; 60 | min-width: 800px; 61 | width: auto !important; 62 | width: 800px; 63 | } 64 | 65 | ul.tabLinks li { 66 | float: left; 67 | height: 100%; 68 | list-style: none; 69 | padding-left: 10px; 70 | padding-right: 10px; 71 | padding-top: 5px; 72 | padding-bottom: 5px; 73 | margin-bottom: 0; 74 | -moz-border-radius: 7px; 75 | border-radius: 7px; 76 | margin-right: 25px; 77 | border: solid 1px #d4d4d4; 78 | background-color: #f0f0f0; 79 | } 80 | 81 | ul.tabLinks li:hover { 82 | background-color: #fafafa; 83 | } 84 | 85 | ul.tabLinks li.selected { 86 | background-color: #c5f0f5; 87 | border-color: #c5f0f5; 88 | } 89 | 90 | ul.tabLinks a { 91 | font-size: 120%; 92 | display: block; 93 | outline: none; 94 | text-decoration: none; 95 | margin: 0; 96 | padding: 0; 97 | } 98 | 99 | ul.tabLinks li h2 { 100 | margin: 0; 101 | padding: 0; 102 | } 103 | 104 | div.tab { 105 | } 106 | 107 | div.selected { 108 | display: block; 109 | } 110 | 111 | div.deselected { 112 | display: none; 113 | } 114 | 115 | div.tab table { 116 | min-width: 350px; 117 | width: auto !important; 118 | width: 350px; 119 | border-collapse: collapse; 120 | } 121 | 122 | div.tab th, div.tab table { 123 | border-bottom: solid #d0d0d0 1px; 124 | } 125 | 126 | div.tab th { 127 | text-align: left; 128 | white-space: nowrap; 129 | padding-left: 6em; 130 | } 131 | 132 | div.tab th:first-child { 133 | padding-left: 0; 134 | } 135 | 136 | div.tab td { 137 | white-space: nowrap; 138 | padding-left: 6em; 139 | padding-top: 5px; 140 | padding-bottom: 5px; 141 | } 142 | 143 | div.tab td:first-child { 144 | padding-left: 0; 145 | } 146 | 147 | div.tab td.numeric, div.tab th.numeric { 148 | text-align: right; 149 | } 150 | 151 | span.code { 152 | display: inline-block; 153 | margin-top: 0em; 154 | margin-bottom: 1em; 155 | } 156 | 157 | span.code pre { 158 | font-size: 11pt; 159 | padding-top: 10px; 160 | padding-bottom: 10px; 161 | padding-left: 10px; 162 | padding-right: 10px; 163 | margin: 0; 164 | background-color: #f7f7f7; 165 | border: solid 1px #d0d0d0; 166 | min-width: 700px; 167 | width: auto !important; 168 | width: 700px; 169 | } 170 | 171 | span.wrapped pre { 172 | word-wrap: break-word; 173 | white-space: pre-wrap; 174 | word-break: break-all; 175 | } 176 | 177 | label.hidden { 178 | display: none; 179 | } -------------------------------------------------------------------------------- /build/reports/tests/test/css/style.css: -------------------------------------------------------------------------------- 1 | 2 | #summary { 3 | margin-top: 30px; 4 | margin-bottom: 40px; 5 | } 6 | 7 | #summary table { 8 | border-collapse: collapse; 9 | } 10 | 11 | #summary td { 12 | vertical-align: top; 13 | } 14 | 15 | .breadcrumbs, .breadcrumbs a { 16 | color: #606060; 17 | } 18 | 19 | .infoBox { 20 | width: 110px; 21 | padding-top: 15px; 22 | padding-bottom: 15px; 23 | text-align: center; 24 | } 25 | 26 | .infoBox p { 27 | margin: 0; 28 | } 29 | 30 | .counter, .percent { 31 | font-size: 120%; 32 | font-weight: bold; 33 | margin-bottom: 8px; 34 | } 35 | 36 | #duration { 37 | width: 125px; 38 | } 39 | 40 | #successRate, .summaryGroup { 41 | border: solid 2px #d0d0d0; 42 | -moz-border-radius: 10px; 43 | border-radius: 10px; 44 | } 45 | 46 | #successRate { 47 | width: 140px; 48 | margin-left: 35px; 49 | } 50 | 51 | #successRate .percent { 52 | font-size: 180%; 53 | } 54 | 55 | .success, .success a { 56 | color: #008000; 57 | } 58 | 59 | div.success, #successRate.success { 60 | background-color: #bbd9bb; 61 | border-color: #008000; 62 | } 63 | 64 | .failures, .failures a { 65 | color: #b60808; 66 | } 67 | 68 | .skipped, .skipped a { 69 | color: #c09853; 70 | } 71 | 72 | div.failures, #successRate.failures { 73 | background-color: #ecdada; 74 | border-color: #b60808; 75 | } 76 | 77 | ul.linkList { 78 | padding-left: 0; 79 | } 80 | 81 | ul.linkList li { 82 | list-style: none; 83 | margin-bottom: 5px; 84 | } 85 | -------------------------------------------------------------------------------- /build/reports/tests/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Test results - Test Summary 7 | 8 | 9 | 10 | 11 | 12 |
13 |

Test Summary

14 |
15 | 16 | 17 | 49 | 55 | 56 |
18 |
19 | 20 | 21 | 27 | 33 | 39 | 45 | 46 |
22 |
23 |
4
24 |

tests

25 |
26 |
28 |
29 |
1
30 |

failures

31 |
32 |
34 |
35 |
0
36 |

ignored

37 |
38 |
40 |
41 |
0.003s
42 |

duration

43 |
44 |
47 |
48 |
50 |
51 |
75%
52 |

successful

53 |
54 |
57 |
58 |
59 | 70 |
71 |

Failed tests

72 | 78 |
79 |
80 |

Packages

81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 |
PackageTestsFailuresIgnoredDurationSuccess rate
95 | hello 96 | 4100.003s75%
105 |
106 |
107 |

Classes

108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 |
ClassTestsFailuresIgnoredDurationSuccess rate
122 | hello.TestGreeter 123 | 4100.003s75%
132 |
133 |
134 | 143 |
144 | 145 | 146 | -------------------------------------------------------------------------------- /build/reports/tests/test/js/report.js: -------------------------------------------------------------------------------- 1 | (function (window, document) { 2 | "use strict"; 3 | 4 | var tabs = {}; 5 | 6 | function changeElementClass(element, classValue) { 7 | if (element.getAttribute("className")) { 8 | element.setAttribute("className", classValue); 9 | } else { 10 | element.setAttribute("class", classValue); 11 | } 12 | } 13 | 14 | function getClassAttribute(element) { 15 | if (element.getAttribute("className")) { 16 | return element.getAttribute("className"); 17 | } else { 18 | return element.getAttribute("class"); 19 | } 20 | } 21 | 22 | function addClass(element, classValue) { 23 | changeElementClass(element, getClassAttribute(element) + " " + classValue); 24 | } 25 | 26 | function removeClass(element, classValue) { 27 | changeElementClass(element, getClassAttribute(element).replace(classValue, "")); 28 | } 29 | 30 | function initTabs() { 31 | var container = document.getElementById("tabs"); 32 | 33 | tabs.tabs = findTabs(container); 34 | tabs.titles = findTitles(tabs.tabs); 35 | tabs.headers = findHeaders(container); 36 | tabs.select = select; 37 | tabs.deselectAll = deselectAll; 38 | tabs.select(0); 39 | 40 | return true; 41 | } 42 | 43 | function getCheckBox() { 44 | return document.getElementById("line-wrapping-toggle"); 45 | } 46 | 47 | function getLabelForCheckBox() { 48 | return document.getElementById("label-for-line-wrapping-toggle"); 49 | } 50 | 51 | function findCodeBlocks() { 52 | var spans = document.getElementById("tabs").getElementsByTagName("span"); 53 | var codeBlocks = []; 54 | for (var i = 0; i < spans.length; ++i) { 55 | if (spans[i].className.indexOf("code") >= 0) { 56 | codeBlocks.push(spans[i]); 57 | } 58 | } 59 | return codeBlocks; 60 | } 61 | 62 | function forAllCodeBlocks(operation) { 63 | var codeBlocks = findCodeBlocks(); 64 | 65 | for (var i = 0; i < codeBlocks.length; ++i) { 66 | operation(codeBlocks[i], "wrapped"); 67 | } 68 | } 69 | 70 | function toggleLineWrapping() { 71 | var checkBox = getCheckBox(); 72 | 73 | if (checkBox.checked) { 74 | forAllCodeBlocks(addClass); 75 | } else { 76 | forAllCodeBlocks(removeClass); 77 | } 78 | } 79 | 80 | function initControls() { 81 | if (findCodeBlocks().length > 0) { 82 | var checkBox = getCheckBox(); 83 | var label = getLabelForCheckBox(); 84 | 85 | checkBox.onclick = toggleLineWrapping; 86 | checkBox.checked = false; 87 | 88 | removeClass(label, "hidden"); 89 | } 90 | } 91 | 92 | function switchTab() { 93 | var id = this.id.substr(1); 94 | 95 | for (var i = 0; i < tabs.tabs.length; i++) { 96 | if (tabs.tabs[i].id === id) { 97 | tabs.select(i); 98 | break; 99 | } 100 | } 101 | 102 | return false; 103 | } 104 | 105 | function select(i) { 106 | this.deselectAll(); 107 | 108 | changeElementClass(this.tabs[i], "tab selected"); 109 | changeElementClass(this.headers[i], "selected"); 110 | 111 | while (this.headers[i].firstChild) { 112 | this.headers[i].removeChild(this.headers[i].firstChild); 113 | } 114 | 115 | var h2 = document.createElement("H2"); 116 | 117 | h2.appendChild(document.createTextNode(this.titles[i])); 118 | this.headers[i].appendChild(h2); 119 | } 120 | 121 | function deselectAll() { 122 | for (var i = 0; i < this.tabs.length; i++) { 123 | changeElementClass(this.tabs[i], "tab deselected"); 124 | changeElementClass(this.headers[i], "deselected"); 125 | 126 | while (this.headers[i].firstChild) { 127 | this.headers[i].removeChild(this.headers[i].firstChild); 128 | } 129 | 130 | var a = document.createElement("A"); 131 | 132 | a.setAttribute("id", "ltab" + i); 133 | a.setAttribute("href", "#tab" + i); 134 | a.onclick = switchTab; 135 | a.appendChild(document.createTextNode(this.titles[i])); 136 | 137 | this.headers[i].appendChild(a); 138 | } 139 | } 140 | 141 | function findTabs(container) { 142 | return findChildElements(container, "DIV", "tab"); 143 | } 144 | 145 | function findHeaders(container) { 146 | var owner = findChildElements(container, "UL", "tabLinks"); 147 | return findChildElements(owner[0], "LI", null); 148 | } 149 | 150 | function findTitles(tabs) { 151 | var titles = []; 152 | 153 | for (var i = 0; i < tabs.length; i++) { 154 | var tab = tabs[i]; 155 | var header = findChildElements(tab, "H2", null)[0]; 156 | 157 | header.parentNode.removeChild(header); 158 | 159 | if (header.innerText) { 160 | titles.push(header.innerText); 161 | } else { 162 | titles.push(header.textContent); 163 | } 164 | } 165 | 166 | return titles; 167 | } 168 | 169 | function findChildElements(container, name, targetClass) { 170 | var elements = []; 171 | var children = container.childNodes; 172 | 173 | for (var i = 0; i < children.length; i++) { 174 | var child = children.item(i); 175 | 176 | if (child.nodeType === 1 && child.nodeName === name) { 177 | if (targetClass && child.className.indexOf(targetClass) < 0) { 178 | continue; 179 | } 180 | 181 | elements.push(child); 182 | } 183 | } 184 | 185 | return elements; 186 | } 187 | 188 | // Entry point. 189 | 190 | window.onload = function() { 191 | initTabs(); 192 | initControls(); 193 | }; 194 | } (window, window.document)); -------------------------------------------------------------------------------- /build/reports/tests/test/packages/hello.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Test results - Package hello 7 | 8 | 9 | 10 | 11 | 12 |
13 |

Package hello

14 | 16 |
17 | 18 | 19 | 51 | 57 | 58 |
20 |
21 | 22 | 23 | 29 | 35 | 41 | 47 | 48 |
24 |
25 |
4
26 |

tests

27 |
28 |
30 |
31 |
1
32 |

failures

33 |
34 |
36 |
37 |
0
38 |

ignored

39 |
40 |
42 |
43 |
0.003s
44 |

duration

45 |
46 |
49 |
50 |
52 |
53 |
75%
54 |

successful

55 |
56 |
59 |
60 |
61 | 69 |
70 |

Failed tests

71 | 77 |
78 |
79 |

Classes

80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 95 | 96 | 97 | 98 | 99 | 100 | 101 |
ClassTestsFailuresIgnoredDurationSuccess rate
93 | TestGreeter 94 | 4100.003s75%
102 |
103 |
104 | 113 |
114 | 115 | 116 | -------------------------------------------------------------------------------- /build/scripts/HelloWorld: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## HelloWorld start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/.." >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="HelloWorld" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and HELLO_WORLD_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS="" 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/lib/jb-hello-world-0.1.0.jar:$APP_HOME/lib/joda-time-2.2.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin, switch paths to Windows format before running java 129 | if $cygwin ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=$((i+1)) 158 | done 159 | case $i in 160 | (0) set -- ;; 161 | (1) set -- "$args0" ;; 162 | (2) set -- "$args0" "$args1" ;; 163 | (3) set -- "$args0" "$args1" "$args2" ;; 164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=$(save "$@") 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $HELLO_WORLD_OPTS -classpath "\"$CLASSPATH\"" hello.HelloWorld "$APP_ARGS" 182 | 183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 185 | cd "$(dirname "$0")" 186 | fi 187 | 188 | exec "$JAVACMD" "$@" 189 | -------------------------------------------------------------------------------- /build/scripts/HelloWorld.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem http://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem HelloWorld startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME%.. 31 | 32 | @rem Add default JVM options here. You can also use JAVA_OPTS and HELLO_WORLD_OPTS to pass JVM options to this script. 33 | set DEFAULT_JVM_OPTS= 34 | 35 | @rem Find java.exe 36 | if defined JAVA_HOME goto findJavaFromJavaHome 37 | 38 | set JAVA_EXE=java.exe 39 | %JAVA_EXE% -version >NUL 2>&1 40 | if "%ERRORLEVEL%" == "0" goto init 41 | 42 | echo. 43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 44 | echo. 45 | echo Please set the JAVA_HOME variable in your environment to match the 46 | echo location of your Java installation. 47 | 48 | goto fail 49 | 50 | :findJavaFromJavaHome 51 | set JAVA_HOME=%JAVA_HOME:"=% 52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 53 | 54 | if exist "%JAVA_EXE%" goto init 55 | 56 | echo. 57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 58 | echo. 59 | echo Please set the JAVA_HOME variable in your environment to match the 60 | echo location of your Java installation. 61 | 62 | goto fail 63 | 64 | :init 65 | @rem Get command-line arguments, handling Windows variants 66 | 67 | if not "%OS%" == "Windows_NT" goto win9xME_args 68 | 69 | :win9xME_args 70 | @rem Slurp the command line arguments. 71 | set CMD_LINE_ARGS= 72 | set _SKIP=2 73 | 74 | :win9xME_args_slurp 75 | if "x%~1" == "x" goto execute 76 | 77 | set CMD_LINE_ARGS=%* 78 | 79 | :execute 80 | @rem Setup the command line 81 | 82 | set CLASSPATH=%APP_HOME%\lib\jb-hello-world-0.1.0.jar;%APP_HOME%\lib\joda-time-2.2.jar 83 | 84 | @rem Execute HelloWorld 85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %HELLO_WORLD_OPTS% -classpath "%CLASSPATH%" hello.HelloWorld %CMD_LINE_ARGS% 86 | 87 | :end 88 | @rem End local scope for the variables with windows NT shell 89 | if "%ERRORLEVEL%"=="0" goto mainEnd 90 | 91 | :fail 92 | rem Set variable HELLO_WORLD_EXIT_CONSOLE if you need the _script_ return code instead of 93 | rem the _cmd.exe /c_ return code! 94 | if not "" == "%HELLO_WORLD_EXIT_CONSOLE%" exit 1 95 | exit /b 1 96 | 97 | :mainEnd 98 | if "%OS%"=="Windows_NT" endlocal 99 | 100 | :omega 101 | -------------------------------------------------------------------------------- /build/test-results/test/TEST-hello.TestGreeter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | org.junit.ComparisonFailure: expected:<[Sandvich]> but was:<[Boris]> 6 | at org.junit.Assert.assertEquals(Assert.java:115) 7 | at org.junit.Assert.assertEquals(Assert.java:144) 8 | at hello.TestGreeter.newtestWMGreeterFail(TestGreeter.java:41) 9 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 10 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 11 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 12 | at java.base/java.lang.reflect.Method.invoke(Method.java:566) 13 | at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) 14 | at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) 15 | at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) 16 | at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) 17 | at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) 18 | at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) 19 | at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) 20 | at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) 21 | at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) 22 | at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) 23 | at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) 24 | at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) 25 | at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) 26 | at org.junit.runners.ParentRunner.run(ParentRunner.java:363) 27 | at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110) 28 | at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58) 29 | at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38) 30 | at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62) 31 | at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51) 32 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 33 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 34 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 35 | at java.base/java.lang.reflect.Method.invoke(Method.java:566) 36 | at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) 37 | at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) 38 | at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32) 39 | at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) 40 | at com.sun.proxy.$Proxy2.processTestClass(Unknown Source) 41 | at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:118) 42 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 43 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 44 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 45 | at java.base/java.lang.reflect.Method.invoke(Method.java:566) 46 | at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) 47 | at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) 48 | at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175) 49 | at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157) 50 | at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404) 51 | at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) 52 | at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) 53 | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 54 | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 55 | at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) 56 | at java.base/java.lang.Thread.run(Thread.java:834) 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /build/test-results/test/binary/output.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jabedhasan21/java-hello-world-with-gradle/f5eab08edf1ec9e1b8e15f032afe42216400433d/build/test-results/test/binary/output.bin -------------------------------------------------------------------------------- /build/test-results/test/binary/output.bin.idx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /build/test-results/test/binary/results.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jabedhasan21/java-hello-world-with-gradle/f5eab08edf1ec9e1b8e15f032afe42216400433d/build/test-results/test/binary/results.bin -------------------------------------------------------------------------------- /build/tmp/jar/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jabedhasan21/java-hello-world-with-gradle/f5eab08edf1ec9e1b8e15f032afe42216400433d/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Nov 14 19:37:23 BDT 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'jabed' at '11/14/15 7:37 PM' with Gradle 2.8 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.8/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'HelloWorld' 20 | -------------------------------------------------------------------------------- /src/main/java/hello/Greeter.java: -------------------------------------------------------------------------------- 1 | package hello; 2 | 3 | 4 | 5 | public class Greeter { 6 | 7 | 8 | 9 | private String name = ""; 10 | 11 | 12 | 13 | public String getName() 14 | 15 | { 16 | 17 | return name; 18 | 19 | } 20 | 21 | 22 | 23 | public void setName(String name) 24 | 25 | { 26 | 27 | this.name = name; 28 | 29 | } 30 | 31 | 32 | 33 | public String sayHello() 34 | 35 | { 36 | 37 | if (name == "") 38 | 39 | { 40 | 41 | return "Hello!"; 42 | 43 | } 44 | 45 | else 46 | 47 | { 48 | 49 | return "Hello " + name + "!"; 50 | 51 | } 52 | 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /src/main/java/hello/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package hello; 2 | 3 | import org.joda.time.LocalTime; 4 | 5 | public class HelloWorld { 6 | public static void main(String[] args) { 7 | LocalTime currentTime = new LocalTime(); 8 | System.out.println("The current local time is: " + currentTime); 9 | 10 | Greeter greeter = new Greeter(); 11 | System.out.println(greeter.sayHello()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/test/java/hello/TestGreeter.java: -------------------------------------------------------------------------------- 1 | package hello; 2 | 3 | import static org.junit.Assert.*; 4 | import org.junit.Before; 5 | import org.junit.Test; 6 | 7 | public class TestGreeter { 8 | private Greeter g; 9 | @Before 10 | public void setUp() throws Exception 11 | { 12 | g = new Greeter(); 13 | } 14 | 15 | 16 | @Test 17 | public void testGreeterEmpty() 18 | { 19 | assertEquals(g.getName(),""); 20 | assertEquals(g.sayHello(),"Hello!"); 21 | } 22 | 23 | @Test 24 | public void testGreeter() 25 | { 26 | g.setName("World"); 27 | assertEquals(g.getName(),"World"); 28 | assertEquals(g.sayHello(),"Hello World!"); 29 | } 30 | 31 | @Test 32 | public void newtestWMGreeterPass() { 33 | g.setName("Boris"); 34 | assertEquals(g.getName(),"Boris"); 35 | assertEquals(g.sayHello(),"Hello Boris!"); 36 | } 37 | /* 38 | @Test 39 | public void newtestWMGreeterFail() { 40 | g.setName("Sandvich"); 41 | assertEquals(g.getName(),"Boris"); 42 | assertEquals(g.sayHello(),"Hello Boris!"); 43 | } 44 | */ 45 | 46 | } 47 | --------------------------------------------------------------------------------