Compare commits

...
2 Commits
Author SHA1 Message Date
KKlochko a258a5f785 Update the build configuration to make the JAR file.
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-10-15 12:59:04 +03:00
KKlochko f384ce5fe5 Add SimpleEmptyTest and its tests.
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-10-15 12:37:56 +03:00
7 changed files with 55 additions and 14 deletions
+11 -1
View File
@@ -1,11 +1,21 @@
plugins {
id('groovy')
id('application')
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
version = "1.0"
description = "simple-jbdd is a simple BDD testing framework for Java."
// Spock works with Java 1.8 and above
application {
mainClassName = 'space.kklochko.simple_jbdd.Main'
}
shadowJar {
mergeServiceFiles()
minimize()
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
+26 -11
View File
@@ -18,6 +18,32 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<archive>
<manifest>
<mainClass>space.kklochko.simple_jbdd.Main</mainClass>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Mandatory plugins for using Spock -->
<plugin>
<!-- The gmavenplus plugin is used to compile Groovy code. To learn more about this plugin,
@@ -124,16 +150,5 @@
<version>2.2</version>
<scope>test</scope>
</dependency>
<!-- Dependencies used by examples in this project (not required for using Spock) -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.2.222</version>
</dependency>
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy-sql</artifactId>
<version>${groovy.version}</version>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,12 @@
package space.kklochko.simple_jbdd.test_examples.tests;
import space.kklochko.simple_jbdd.annotations.Title;
import space.kklochko.simple_jbdd.tests.Test;
@Title("A Simple Empty Test for Sum")
public class SimpleEmptyTest extends Test {
public void check() {
assert 30 == 10 + 20 + 1;
}
}
@@ -1,5 +1,6 @@
package space.kklochko.simple_jbdd.tests.factories
import space.kklochko.simple_jbdd.test_examples.tests.SimpleEmptyTest
import space.kklochko.simple_jbdd.test_examples.tests.SimpleGivenGivenWhenWhenThenThenTest
import space.kklochko.simple_jbdd.test_examples.tests.SimpleGivenWhenThenTest
import space.kklochko.simple_jbdd.test_examples.tests.SimpleThenTest
@@ -33,6 +34,7 @@ class TestCommandFactorySpec extends Specification {
where:
testClass || expectedBlockCount
new SimpleEmptyTest() || 0
new SimpleThenTest() || 1
new SimpleGivenWhenThenTest() || 3
new SimpleGivenGivenWhenWhenThenThenTest() || 6
@@ -22,7 +22,7 @@ class IntegratedClassLoader extends Specification {
def classes = loader.load()
then: "Checking that the test result is expected"
4 == classes.size()
5 == classes.size()
}
def "The classes must be represent the Test interface."() {
@@ -19,7 +19,7 @@ class IntegratedNameClassLoader extends Specification {
def classNames = loader.load()
then: "Checking that the test result is expected"
4 == classNames.size()
5 == classNames.size()
}
}
@@ -1,5 +1,6 @@
package space.kklochko.simple_jbdd.tests.runners
import space.kklochko.simple_jbdd.test_examples.tests.SimpleEmptyTest
import space.kklochko.simple_jbdd.test_examples.tests.SimpleFailedThenTest
import space.kklochko.simple_jbdd.test_examples.tests.SimpleGivenGivenWhenWhenThenThenTest
import space.kklochko.simple_jbdd.test_examples.tests.SimpleGivenWhenThenTest
@@ -40,5 +41,6 @@ class IntegratedSimpleTestRunnerSpec extends Specification {
new SimpleThenTestWithoutTitle() || true
new SimpleFailedThenTest() || false
new SimpleGivenGivenWhenWhenThenThenTest() || true
new SimpleEmptyTest() || false
}
}