Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
GOUVILLE Tom
template-JavaFX
Commits
586deec5
Verified
Commit
586deec5
authored
Dec 16, 2021
by
GOUVILLE Tom
🤞
Browse files
[ADD] Better project structure and junit tests
parent
1a107c0c
Pipeline
#24756
passed with stage
in 1 minute and 3 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
69 additions
and
16 deletions
+69
-16
.classpath
.classpath
+21
-1
.settings/org.eclipse.buildship.core.prefs
.settings/org.eclipse.buildship.core.prefs
+1
-1
build.gradle
build.gradle
+34
-13
src/main/java/example/Main.java
src/main/java/example/Main.java
+2
-1
src/main/resources/.gitkeep
src/main/resources/.gitkeep
+0
-0
src/test/java/example/MainTest.java
src/test/java/example/MainTest.java
+11
-0
src/test/resources/.gitkeep
src/test/resources/.gitkeep
+0
-0
No files found.
.classpath
View file @
586deec5
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry
kind=
"src"
output=
"bin/main"
path=
"src"
>
<classpathentry
kind=
"src"
output=
"bin/main"
path=
"src
/main/java
"
>
<attributes>
<attribute
name=
"gradle_scope"
value=
"main"
/>
<attribute
name=
"gradle_used_by_scope"
value=
"main,test"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"src"
output=
"bin/main"
path=
"src/main/resources"
>
<attributes>
<attribute
name=
"gradle_scope"
value=
"main"
/>
<attribute
name=
"gradle_used_by_scope"
value=
"main,test"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"src"
output=
"bin/test"
path=
"src/test/java"
>
<attributes>
<attribute
name=
"gradle_scope"
value=
"test"
/>
<attribute
name=
"gradle_used_by_scope"
value=
"test"
/>
<attribute
name=
"test"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"src"
output=
"bin/test"
path=
"src/test/resources"
>
<attributes>
<attribute
name=
"gradle_scope"
value=
"test"
/>
<attribute
name=
"gradle_used_by_scope"
value=
"test"
/>
<attribute
name=
"test"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"
/>
<classpathentry
kind=
"con"
path=
"org.eclipse.buildship.core.gradleclasspathcontainer"
/>
<classpathentry
kind=
"output"
path=
"bin/default"
/>
...
...
.settings/org.eclipse.buildship.core.prefs
View file @
586deec5
...
...
@@ -5,7 +5,7 @@ connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/usr/lib/jvm/
default
java.home=/usr/lib/jvm/
java-11-openjdk
jvm.arguments=
offline.mode=false
override.workspace.settings=true
...
...
build.gradle
View file @
586deec5
...
...
@@ -8,14 +8,27 @@ plugins {
id
'java'
id
'application'
id
"org.openjfx.javafxplugin"
version
"0.0.10"
id
'com.adarshr.test-logger'
version
'3.0.0'
}
repositories
{
mavenCentral
()
}
dependencies
{
testImplementation
(
"org.junit.jupiter:junit-jupiter-api:5.8.1"
)
testRuntimeOnly
(
"org.junit.jupiter:junit-jupiter-engine:5.8.1"
)
}
test
{
useJUnitPlatform
()
testLogging
{
events
"passed"
,
"skipped"
,
"failed"
,
"standardOut"
,
"standardError"
}
}
apply
plugin:
'java'
mainClassName
=
'Main'
mainClassName
=
'
example.
Main'
jar
{
manifest
{
...
...
@@ -23,19 +36,9 @@ jar {
}
}
sourceSets
{
main
{
java
{
srcDirs
=
[
'src'
]
}
resources
{
srcDirs
=
[
'resources'
]
}
}
}
javafx
{
modules
=
[
'javafx.controls'
,
'javafx.base'
,
'javafx.graphics'
,
'javafx.web'
,
'javafx.swing'
,
'javafx.media'
]
version
=
17
;
modules
=
[
'javafx.controls'
,
'javafx.base'
,
'javafx.graphics'
,
'javafx.web'
,
'javafx.swing'
,
'javafx.media'
,
'javafx.fxml'
]
}
task
buildJar
(
type:
Jar
)
{
...
...
@@ -46,4 +49,22 @@ task buildJar(type: Jar) {
configurations
.
runtimeClasspath
.
collect
{
it
.
isDirectory
()
?
it
:
zipTree
(
it
)
}
}
with
jar
}
testlogger
{
theme
'mocha'
showExceptions
true
showStackTraces
true
showFullStackTraces
false
showCauses
true
slowThreshold
5000
showSummary
true
showSimpleNames
false
showPassed
true
showSkipped
true
showFailed
true
showStandardStreams
false
showPassedStandardStreams
true
showSkippedStandardStreams
true
showFailedStandardStreams
true
}
\ No newline at end of file
src/Main.java
→
src/
main/java/example/
Main.java
View file @
586deec5
package
example
;
import
javafx.application.Application
;
import
javafx.stage.Stage
;
import
javafx.scene.Scene
;
...
...
@@ -20,4 +21,4 @@ public class Main extends Application {
primaryStage
.
setScene
(
primaryScene
);
primaryStage
.
show
();
}
}
\ No newline at end of file
}
resources/.gitkeep
→
src/main/
resources/.gitkeep
View file @
586deec5
File moved
src/test/java/example/MainTest.java
0 → 100644
View file @
586deec5
package
example
;
import
org.junit.jupiter.api.Test
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertEquals
;
public
class
MainTest
{
@Test
public
void
sampleTest
()
{
assertEquals
(
true
,
true
);
}
}
bin/main/
gitkeep
→
src/test/resources/.
gitkeep
View file @
586deec5
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment