2
0
Fork 0
mirror of https://github.com/ethauvin/bld.git synced 2025-04-25 00:07:12 -07:00

Updated with support for latest JUnit in a backwards compatible way.

Updated some other blueprint dependencies.
This commit is contained in:
Geert Bevin 2023-10-20 14:48:38 -04:00
parent 6230db68af
commit 84a2bb337d
8 changed files with 255 additions and 160 deletions

2
core

@ -1 +1 @@
Subproject commit a0c7e44737615da842fd8e46b8b81ec004b0a1cd
Subproject commit e6b9a55e2e98a2889229fb9c030fc7a35bf682f4

View file

@ -32,7 +32,7 @@ public class BldBuild extends AbstractRife2Build {
repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);
scope(test)
.include(dependency("org.json", "json", version(20230618)));
.include(dependency("org.json", "json", version(20231013)));
var core_directory = new File(workDirectory(), "core");
var core_src_directory = new File(core_directory, "src");

View file

@ -37,7 +37,7 @@ public class BlankProjectBlueprint extends Project {
downloadSources = true;
repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS);
scope(test)
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5,9,3)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1,9,3)));
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5,10,0)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1,10,0)));
}
}

View file

@ -40,13 +40,13 @@ public class Rife2ProjectBlueprint extends WebProject {
scope(compile)
.include(dependency("com.uwyn.rife2", "rife2", version(1,7,2)));
scope(test)
.include(dependency("org.jsoup", "jsoup", version(1,16,1)))
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5,9,3)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1,9,3)));
.include(dependency("org.jsoup", "jsoup", version(1,16,2)))
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5,10,0)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1,10,0)));
scope(standalone)
.include(dependency("org.eclipse.jetty", "jetty-server", version(11,0,15)))
.include(dependency("org.eclipse.jetty", "jetty-servlet", version(11,0,15)))
.include(dependency("org.slf4j", "slf4j-simple", version(2,0,7)));
.include(dependency("org.slf4j", "slf4j-simple", version(2,0,9)));
precompileOperation().templateTypes(TemplateType.HTML);
}

View file

@ -5,6 +5,11 @@
package rife.bld.operations;
import rife.bld.BaseProject;
import rife.tools.FileUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
/**
* Tests a Java application with JUnit.
@ -24,6 +29,39 @@ public class JUnitOperation extends TestOperation<JUnitOperation, JUnitOptions>
return new JUnitOptions();
}
@Override
protected List<String> executeConstructProcessCommandList() {
if (mainClass() == null) {
throw new IllegalArgumentException("ERROR: Missing main class for test execution.");
}
var args = new ArrayList<String>();
args.add(javaTool());
args.addAll(javaOptions());
args.add("-cp");
var classpath = FileUtils.joinPaths(classpath());
args.add(classpath);
args.add(mainClass());
// the JUnit console launcher syntax changed in v1.10.x,
// this logic defaults to the new syntax but if it finds an older
// JUnit jar in the classpath, uses the old syntax
var junit_version_1_10_and_later = true;
var junit_version_pattern = Pattern.compile("junit-platform-console-standalone-(\\d+)\\.(\\d+)\\.");
var junit_version_matcher = junit_version_pattern.matcher(classpath);
if (junit_version_matcher.find() &&
(Integer.parseInt(junit_version_matcher.group(1)) < 1 ||
(Integer.parseInt(junit_version_matcher.group(1)) == 1 &&
Integer.parseInt(junit_version_matcher.group(2)) < 10))) {
junit_version_1_10_and_later = false;
}
if (junit_version_1_10_and_later) {
args.add("execute");
}
args.addAll(testToolOptions());
return args;
}
@Override
public JUnitOperation fromProject(BaseProject project) {
super.fromProject(project);

View file

@ -99,22 +99,22 @@ public class TestCreateBlankOperation {
/myapp/lib/test
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/test/junit-jupiter-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.9\\.3\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.9\\.3\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.9\\.3\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.9\\.3\\.jar
/myapp/lib/test/junit-platform-commons-1\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.9\\.3\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.9\\.3\\.jar
/myapp/lib/test/junit-platform-engine-1\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.9\\.3\\.jar
/myapp/lib/test/opentest4j-1\\.2\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.2\\.0\\.jar
/myapp/lib/test/junit-jupiter-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.10\\.0\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.10\\.0\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.10\\.0\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.10\\.0\\.jar
/myapp/lib/test/junit-platform-commons-1\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.10\\.0\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.10\\.0\\.jar
/myapp/lib/test/junit-platform-engine-1\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.10\\.0\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar
/myapp/src
/myapp/src/bld
/myapp/src/bld/java
@ -178,22 +178,22 @@ public class TestCreateBlankOperation {
/myapp/lib/test
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/test/junit-jupiter-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.9\\.3\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.9\\.3\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.9\\.3\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.9\\.3\\.jar
/myapp/lib/test/junit-platform-commons-1\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.9\\.3\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.9\\.3\\.jar
/myapp/lib/test/junit-platform-engine-1\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.9\\.3\\.jar
/myapp/lib/test/opentest4j-1\\.2\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.2\\.0\\.jar
/myapp/lib/test/junit-jupiter-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.10\\.0\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.10\\.0\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.10\\.0\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.10\\.0\\.jar
/myapp/lib/test/junit-platform-commons-1\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.10\\.0\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.10\\.0\\.jar
/myapp/lib/test/junit-platform-engine-1\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.10\\.0\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar
/myapp/src
/myapp/src/bld
/myapp/src/bld/java
@ -374,22 +374,22 @@ public class TestCreateBlankOperation {
/myapp/lib/local
/myapp/lib/local/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/local/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/local/junit-jupiter-5\\.9\\.3-sources\\.jar
/myapp/lib/local/junit-jupiter-5\\.9\\.3\\.jar
/myapp/lib/local/junit-jupiter-api-5\\.9\\.3-sources\\.jar
/myapp/lib/local/junit-jupiter-api-5\\.9\\.3\\.jar
/myapp/lib/local/junit-jupiter-engine-5\\.9\\.3-sources\\.jar
/myapp/lib/local/junit-jupiter-engine-5\\.9\\.3\\.jar
/myapp/lib/local/junit-jupiter-params-5\\.9\\.3-sources\\.jar
/myapp/lib/local/junit-jupiter-params-5\\.9\\.3\\.jar
/myapp/lib/local/junit-platform-commons-1\\.9\\.3-sources\\.jar
/myapp/lib/local/junit-platform-commons-1\\.9\\.3\\.jar
/myapp/lib/local/junit-platform-console-standalone-1\\.9\\.3-sources\\.jar
/myapp/lib/local/junit-platform-console-standalone-1\\.9\\.3\\.jar
/myapp/lib/local/junit-platform-engine-1\\.9\\.3-sources\\.jar
/myapp/lib/local/junit-platform-engine-1\\.9\\.3\\.jar
/myapp/lib/local/opentest4j-1\\.2\\.0-sources\\.jar
/myapp/lib/local/opentest4j-1\\.2\\.0\\.jar
/myapp/lib/local/junit-jupiter-5\\.10\\.0-sources\\.jar
/myapp/lib/local/junit-jupiter-5\\.10\\.0\\.jar
/myapp/lib/local/junit-jupiter-api-5\\.10\\.0-sources\\.jar
/myapp/lib/local/junit-jupiter-api-5\\.10\\.0\\.jar
/myapp/lib/local/junit-jupiter-engine-5\\.10\\.0-sources\\.jar
/myapp/lib/local/junit-jupiter-engine-5\\.10\\.0\\.jar
/myapp/lib/local/junit-jupiter-params-5\\.10\\.0-sources\\.jar
/myapp/lib/local/junit-jupiter-params-5\\.10\\.0\\.jar
/myapp/lib/local/junit-platform-commons-1\\.10\\.0-sources\\.jar
/myapp/lib/local/junit-platform-commons-1\\.10\\.0\\.jar
/myapp/lib/local/junit-platform-console-standalone-1\\.10\\.0-sources\\.jar
/myapp/lib/local/junit-platform-console-standalone-1\\.10\\.0\\.jar
/myapp/lib/local/junit-platform-engine-1\\.10\\.0-sources\\.jar
/myapp/lib/local/junit-platform-engine-1\\.10\\.0\\.jar
/myapp/lib/local/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/local/opentest4j-1\\.3\\.0\\.jar
/myapp/lib/runtime
/myapp/lib/test
/myapp/src
@ -495,22 +495,22 @@ public class TestCreateBlankOperation {
/myapp/lib/local_test
/myapp/lib/local_test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/local_test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/local_test/junit-jupiter-5\\.9\\.3-sources\\.jar
/myapp/lib/local_test/junit-jupiter-5\\.9\\.3\\.jar
/myapp/lib/local_test/junit-jupiter-api-5\\.9\\.3-sources\\.jar
/myapp/lib/local_test/junit-jupiter-api-5\\.9\\.3\\.jar
/myapp/lib/local_test/junit-jupiter-engine-5\\.9\\.3-sources\\.jar
/myapp/lib/local_test/junit-jupiter-engine-5\\.9\\.3\\.jar
/myapp/lib/local_test/junit-jupiter-params-5\\.9\\.3-sources\\.jar
/myapp/lib/local_test/junit-jupiter-params-5\\.9\\.3\\.jar
/myapp/lib/local_test/junit-platform-commons-1\\.9\\.3-sources\\.jar
/myapp/lib/local_test/junit-platform-commons-1\\.9\\.3\\.jar
/myapp/lib/local_test/junit-platform-console-standalone-1\\.9\\.3-sources\\.jar
/myapp/lib/local_test/junit-platform-console-standalone-1\\.9\\.3\\.jar
/myapp/lib/local_test/junit-platform-engine-1\\.9\\.3-sources\\.jar
/myapp/lib/local_test/junit-platform-engine-1\\.9\\.3\\.jar
/myapp/lib/local_test/opentest4j-1\\.2\\.0-sources\\.jar
/myapp/lib/local_test/opentest4j-1\\.2\\.0\\.jar
/myapp/lib/local_test/junit-jupiter-5\\.10\\.0-sources\\.jar
/myapp/lib/local_test/junit-jupiter-5\\.10\\.0\\.jar
/myapp/lib/local_test/junit-jupiter-api-5\\.10\\.0-sources\\.jar
/myapp/lib/local_test/junit-jupiter-api-5\\.10\\.0\\.jar
/myapp/lib/local_test/junit-jupiter-engine-5\\.10\\.0-sources\\.jar
/myapp/lib/local_test/junit-jupiter-engine-5\\.10\\.0\\.jar
/myapp/lib/local_test/junit-jupiter-params-5\\.10\\.0-sources\\.jar
/myapp/lib/local_test/junit-jupiter-params-5\\.10\\.0\\.jar
/myapp/lib/local_test/junit-platform-commons-1\\.10\\.0-sources\\.jar
/myapp/lib/local_test/junit-platform-commons-1\\.10\\.0\\.jar
/myapp/lib/local_test/junit-platform-console-standalone-1\\.10\\.0-sources\\.jar
/myapp/lib/local_test/junit-platform-console-standalone-1\\.10\\.0\\.jar
/myapp/lib/local_test/junit-platform-engine-1\\.10\\.0-sources\\.jar
/myapp/lib/local_test/junit-platform-engine-1\\.10\\.0\\.jar
/myapp/lib/local_test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/local_test/opentest4j-1\\.3\\.0\\.jar
/myapp/lib/runtime
/myapp/lib/test
/myapp/src

View file

@ -118,31 +118,31 @@ public class TestCreateRife2Operation {
/myapp/lib/standalone/jetty-servlet-11\\.0\\.15\\.jar
/myapp/lib/standalone/jetty-util-11\\.0\\.15-sources\\.jar
/myapp/lib/standalone/jetty-util-11\\.0\\.15\\.jar
/myapp/lib/standalone/slf4j-api-2\\.0\\.7-sources\\.jar
/myapp/lib/standalone/slf4j-api-2\\.0\\.7\\.jar
/myapp/lib/standalone/slf4j-simple-2\\.0\\.7-sources\\.jar
/myapp/lib/standalone/slf4j-simple-2\\.0\\.7\\.jar
/myapp/lib/standalone/slf4j-api-2\\.0\\.9-sources\\.jar
/myapp/lib/standalone/slf4j-api-2\\.0\\.9\\.jar
/myapp/lib/standalone/slf4j-simple-2\\.0\\.9-sources\\.jar
/myapp/lib/standalone/slf4j-simple-2\\.0\\.9\\.jar
/myapp/lib/test
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/test/jsoup-1\\.16\\.1-sources\\.jar
/myapp/lib/test/jsoup-1\\.16\\.1\\.jar
/myapp/lib/test/junit-jupiter-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.9\\.3\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.9\\.3\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.9\\.3\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.9\\.3\\.jar
/myapp/lib/test/junit-platform-commons-1\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.9\\.3\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.9\\.3\\.jar
/myapp/lib/test/junit-platform-engine-1\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.9\\.3\\.jar
/myapp/lib/test/opentest4j-1\\.2\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.2\\.0\\.jar
/myapp/lib/test/jsoup-1\\.16\\.2-sources\\.jar
/myapp/lib/test/jsoup-1\\.16\\.2\\.jar
/myapp/lib/test/junit-jupiter-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.10\\.0\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.10\\.0\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.10\\.0\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.10\\.0\\.jar
/myapp/lib/test/junit-platform-commons-1\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.10\\.0\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.10\\.0\\.jar
/myapp/lib/test/junit-platform-engine-1\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.10\\.0\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar
/myapp/src
/myapp/src/bld
/myapp/src/bld/java
@ -229,31 +229,31 @@ public class TestCreateRife2Operation {
/myapp/lib/standalone/jetty-servlet-11\\.0\\.15\\.jar
/myapp/lib/standalone/jetty-util-11\\.0\\.15-sources\\.jar
/myapp/lib/standalone/jetty-util-11\\.0\\.15\\.jar
/myapp/lib/standalone/slf4j-api-2\\.0\\.7-sources\\.jar
/myapp/lib/standalone/slf4j-api-2\\.0\\.7\\.jar
/myapp/lib/standalone/slf4j-simple-2\\.0\\.7-sources\\.jar
/myapp/lib/standalone/slf4j-simple-2\\.0\\.7\\.jar
/myapp/lib/standalone/slf4j-api-2\\.0\\.9-sources\\.jar
/myapp/lib/standalone/slf4j-api-2\\.0\\.9\\.jar
/myapp/lib/standalone/slf4j-simple-2\\.0\\.9-sources\\.jar
/myapp/lib/standalone/slf4j-simple-2\\.0\\.9\\.jar
/myapp/lib/test
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/test/jsoup-1\\.16\\.1-sources\\.jar
/myapp/lib/test/jsoup-1\\.16\\.1\\.jar
/myapp/lib/test/junit-jupiter-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.9\\.3\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.9\\.3\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.9\\.3\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.9\\.3\\.jar
/myapp/lib/test/junit-platform-commons-1\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.9\\.3\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.9\\.3\\.jar
/myapp/lib/test/junit-platform-engine-1\\.9\\.3-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.9\\.3\\.jar
/myapp/lib/test/opentest4j-1\\.2\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.2\\.0\\.jar
/myapp/lib/test/jsoup-1\\.16\\.2-sources\\.jar
/myapp/lib/test/jsoup-1\\.16\\.2\\.jar
/myapp/lib/test/junit-jupiter-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.10\\.0\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.10\\.0\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.10\\.0\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.10\\.0\\.jar
/myapp/lib/test/junit-platform-commons-1\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.10\\.0\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.10\\.0\\.jar
/myapp/lib/test/junit-platform-engine-1\\.10\\.0-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.10\\.0\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar
/myapp/src
/myapp/src/bld
/myapp/src/bld/java
@ -478,30 +478,30 @@ public class TestCreateRife2Operation {
/myapp/lib/local/jetty-servlet-11\\.0\\.15\\.jar
/myapp/lib/local/jetty-util-11\\.0\\.15-sources\\.jar
/myapp/lib/local/jetty-util-11\\.0\\.15\\.jar
/myapp/lib/local/jsoup-1\\.16\\.1-sources\\.jar
/myapp/lib/local/jsoup-1\\.16\\.1\\.jar
/myapp/lib/local/junit-jupiter-5\\.9\\.3-sources\\.jar
/myapp/lib/local/junit-jupiter-5\\.9\\.3\\.jar
/myapp/lib/local/junit-jupiter-api-5\\.9\\.3-sources\\.jar
/myapp/lib/local/junit-jupiter-api-5\\.9\\.3\\.jar
/myapp/lib/local/junit-jupiter-engine-5\\.9\\.3-sources\\.jar
/myapp/lib/local/junit-jupiter-engine-5\\.9\\.3\\.jar
/myapp/lib/local/junit-jupiter-params-5\\.9\\.3-sources\\.jar
/myapp/lib/local/junit-jupiter-params-5\\.9\\.3\\.jar
/myapp/lib/local/junit-platform-commons-1\\.9\\.3-sources\\.jar
/myapp/lib/local/junit-platform-commons-1\\.9\\.3\\.jar
/myapp/lib/local/junit-platform-console-standalone-1\\.9\\.3-sources\\.jar
/myapp/lib/local/junit-platform-console-standalone-1\\.9\\.3\\.jar
/myapp/lib/local/junit-platform-engine-1\\.9\\.3-sources\\.jar
/myapp/lib/local/junit-platform-engine-1\\.9\\.3\\.jar
/myapp/lib/local/opentest4j-1\\.2\\.0-sources\\.jar
/myapp/lib/local/opentest4j-1\\.2\\.0\\.jar
/myapp/lib/local/jsoup-1\\.16\\.2-sources\\.jar
/myapp/lib/local/jsoup-1\\.16\\.2\\.jar
/myapp/lib/local/junit-jupiter-5\\.10\\.0-sources\\.jar
/myapp/lib/local/junit-jupiter-5\\.10\\.0\\.jar
/myapp/lib/local/junit-jupiter-api-5\\.10\\.0-sources\\.jar
/myapp/lib/local/junit-jupiter-api-5\\.10\\.0\\.jar
/myapp/lib/local/junit-jupiter-engine-5\\.10\\.0-sources\\.jar
/myapp/lib/local/junit-jupiter-engine-5\\.10\\.0\\.jar
/myapp/lib/local/junit-jupiter-params-5\\.10\\.0-sources\\.jar
/myapp/lib/local/junit-jupiter-params-5\\.10\\.0\\.jar
/myapp/lib/local/junit-platform-commons-1\\.10\\.0-sources\\.jar
/myapp/lib/local/junit-platform-commons-1\\.10\\.0\\.jar
/myapp/lib/local/junit-platform-console-standalone-1\\.10\\.0-sources\\.jar
/myapp/lib/local/junit-platform-console-standalone-1\\.10\\.0\\.jar
/myapp/lib/local/junit-platform-engine-1\\.10\\.0-sources\\.jar
/myapp/lib/local/junit-platform-engine-1\\.10\\.0\\.jar
/myapp/lib/local/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/local/opentest4j-1\\.3\\.0\\.jar
/myapp/lib/local/rife2-.*-sources\\.jar
/myapp/lib/local/rife2-.*\\.jar
/myapp/lib/local/slf4j-api-2\\.0\\.7-sources\\.jar
/myapp/lib/local/slf4j-api-2\\.0\\.7\\.jar
/myapp/lib/local/slf4j-simple-2\\.0\\.7-sources\\.jar
/myapp/lib/local/slf4j-simple-2\\.0\\.7\\.jar
/myapp/lib/local/slf4j-api-2\\.0\\.9-sources\\.jar
/myapp/lib/local/slf4j-api-2\\.0\\.9\\.jar
/myapp/lib/local/slf4j-simple-2\\.0\\.9-sources\\.jar
/myapp/lib/local/slf4j-simple-2\\.0\\.9\\.jar
/myapp/lib/runtime
/myapp/lib/standalone
/myapp/lib/test
@ -644,31 +644,31 @@ public class TestCreateRife2Operation {
/myapp/lib/local_standalone/jetty-servlet-11\\.0\\.15\\.jar
/myapp/lib/local_standalone/jetty-util-11\\.0\\.15-sources\\.jar
/myapp/lib/local_standalone/jetty-util-11\\.0\\.15\\.jar
/myapp/lib/local_standalone/slf4j-api-2\\.0\\.7-sources\\.jar
/myapp/lib/local_standalone/slf4j-api-2\\.0\\.7\\.jar
/myapp/lib/local_standalone/slf4j-simple-2\\.0\\.7-sources\\.jar
/myapp/lib/local_standalone/slf4j-simple-2\\.0\\.7\\.jar
/myapp/lib/local_standalone/slf4j-api-2\\.0\\.9-sources\\.jar
/myapp/lib/local_standalone/slf4j-api-2\\.0\\.9\\.jar
/myapp/lib/local_standalone/slf4j-simple-2\\.0\\.9-sources\\.jar
/myapp/lib/local_standalone/slf4j-simple-2\\.0\\.9\\.jar
/myapp/lib/local_test
/myapp/lib/local_test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/local_test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/local_test/jsoup-1\\.16\\.1-sources\\.jar
/myapp/lib/local_test/jsoup-1\\.16\\.1\\.jar
/myapp/lib/local_test/junit-jupiter-5\\.9\\.3-sources\\.jar
/myapp/lib/local_test/junit-jupiter-5\\.9\\.3\\.jar
/myapp/lib/local_test/junit-jupiter-api-5\\.9\\.3-sources\\.jar
/myapp/lib/local_test/junit-jupiter-api-5\\.9\\.3\\.jar
/myapp/lib/local_test/junit-jupiter-engine-5\\.9\\.3-sources\\.jar
/myapp/lib/local_test/junit-jupiter-engine-5\\.9\\.3\\.jar
/myapp/lib/local_test/junit-jupiter-params-5\\.9\\.3-sources\\.jar
/myapp/lib/local_test/junit-jupiter-params-5\\.9\\.3\\.jar
/myapp/lib/local_test/junit-platform-commons-1\\.9\\.3-sources\\.jar
/myapp/lib/local_test/junit-platform-commons-1\\.9\\.3\\.jar
/myapp/lib/local_test/junit-platform-console-standalone-1\\.9\\.3-sources\\.jar
/myapp/lib/local_test/junit-platform-console-standalone-1\\.9\\.3\\.jar
/myapp/lib/local_test/junit-platform-engine-1\\.9\\.3-sources\\.jar
/myapp/lib/local_test/junit-platform-engine-1\\.9\\.3\\.jar
/myapp/lib/local_test/opentest4j-1\\.2\\.0-sources\\.jar
/myapp/lib/local_test/opentest4j-1\\.2\\.0\\.jar
/myapp/lib/local_test/jsoup-1\\.16\\.2-sources\\.jar
/myapp/lib/local_test/jsoup-1\\.16\\.2\\.jar
/myapp/lib/local_test/junit-jupiter-5\\.10\\.0-sources\\.jar
/myapp/lib/local_test/junit-jupiter-5\\.10\\.0\\.jar
/myapp/lib/local_test/junit-jupiter-api-5\\.10\\.0-sources\\.jar
/myapp/lib/local_test/junit-jupiter-api-5\\.10\\.0\\.jar
/myapp/lib/local_test/junit-jupiter-engine-5\\.10\\.0-sources\\.jar
/myapp/lib/local_test/junit-jupiter-engine-5\\.10\\.0\\.jar
/myapp/lib/local_test/junit-jupiter-params-5\\.10\\.0-sources\\.jar
/myapp/lib/local_test/junit-jupiter-params-5\\.10\\.0\\.jar
/myapp/lib/local_test/junit-platform-commons-1\\.10\\.0-sources\\.jar
/myapp/lib/local_test/junit-platform-commons-1\\.10\\.0\\.jar
/myapp/lib/local_test/junit-platform-console-standalone-1\\.10\\.0-sources\\.jar
/myapp/lib/local_test/junit-platform-console-standalone-1\\.10\\.0\\.jar
/myapp/lib/local_test/junit-platform-engine-1\\.10\\.0-sources\\.jar
/myapp/lib/local_test/junit-platform-engine-1\\.10\\.0\\.jar
/myapp/lib/local_test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/local_test/opentest4j-1\\.3\\.0\\.jar
/myapp/lib/runtime
/myapp/lib/standalone
/myapp/lib/test

View file

@ -5,6 +5,8 @@
package rife.bld.operations;
import org.junit.jupiter.api.Test;
import rife.bld.Project;
import rife.bld.dependencies.Scope;
import rife.tools.FileUtils;
import rife.tools.StringUtils;
@ -14,6 +16,7 @@ import java.util.List;
import java.util.function.Function;
import static org.junit.jupiter.api.Assertions.*;
import static rife.bld.dependencies.Scope.test;
public class TestJUnitOperation {
@Test
@ -210,4 +213,58 @@ public class TestJUnitOperation {
FileUtils.deleteDirectory(tmp);
}
}
@Test
void testFromOldProject()
throws Exception {
var tmp = Files.createTempDirectory("test").toFile();
try {
var create_operation = new CreateBlankOperation() {
@Override
protected Project createProjectBlueprint() {
var project = super.createProjectBlueprint();
project.scope(Scope.test).clear();
project.scope(Scope.test)
.include(project.dependency("org.junit.jupiter", "junit-jupiter", project.version(5,9,3)))
.include(project.dependency("org.junit.platform", "junit-platform-console-standalone", project.version(1,9,3)));
return project;
}
}
.workDirectory(tmp)
.packageName("com.example")
.projectName("myapp")
.downloadDependencies(true);
create_operation.execute();
new CompileOperation()
.fromProject(create_operation.project()).execute();
var check_result = new StringBuilder();
new JUnitOperation()
.fromProject(create_operation.project())
.outputProcessor(s -> {
check_result.append(s).append(System.lineSeparator());
return true;
})
.execute();
assertTrue(check_result.toString().contains(StringUtils.convertLineSeparator("""
[ 2 containers found ]
[ 0 containers skipped ]
[ 2 containers started ]
[ 0 containers aborted ]
[ 2 containers successful ]
[ 0 containers failed ]
[ 1 tests found ]
[ 0 tests skipped ]
[ 1 tests started ]
[ 0 tests aborted ]
[ 1 tests successful ]
[ 0 tests failed ]
""")));
} finally {
FileUtils.deleteDirectory(tmp);
}
}
}