Verified Commit 586deec5 authored by GOUVILLE Tom's avatar GOUVILLE Tom 🤞
Browse files

[ADD] Better project structure and junit tests

parent 1a107c0c
Pipeline #24756 passed with stage
in 1 minute and 3 seconds
<?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"/>
......
......@@ -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
......
......@@ -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
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
}
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);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment