Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75a9126
commit 226ecd8
Showing
28 changed files
with
496 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
dependencies { | |||
} |
2 changes: 1 addition & 1 deletion
2
...java/org/junit/core/util/ObjectUtils.java → .../junit/gen5/commons/util/ObjectUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...va/org/junit/core/util/Preconditions.java → ...unit/gen5/commons/util/Preconditions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
junit-engine-api/src/main/java/org/junit/gen5/engine/EngineTestDescription.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,3 +1,4 @@ | |||
dependencies { | dependencies { | ||
compile(project(':junit-engine-api')) | compile(project(':junit-engine-api')) | ||
testCompile('junit:junit:4.12') | |||
} | } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
junit-launcher/src/main/java/org/junit/gen5/launcher/TestExecutionPlan.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
package org.junit.gen5.launcher; | |||
|
|||
import java.util.Collection; | |||
import java.util.LinkedList; | |||
import java.util.List; | |||
|
|||
// TODO make immutable? | |||
// TODO name? | |||
public class TestExecutionPlan { | |||
|
|||
private final List<TestIdentifier> testIdentifiers = new LinkedList<>(); | |||
|
|||
public List<TestIdentifier> getTestIdentifiers() { | |||
return testIdentifiers; | |||
} | |||
|
|||
public void addTestIdentifiers(Collection<TestIdentifier> testDescriptions) { | |||
this.testIdentifiers.addAll(testDescriptions); | |||
} | |||
|
|||
} |
73 changes: 63 additions & 10 deletions
73
junit-launcher/src/main/java/org/junit/gen5/launcher/TestPlan.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,20 +1,73 @@ | |||
|
|||
package org.junit.gen5.launcher; | package org.junit.gen5.launcher; | ||
|
|
||
import java.util.Collection; | import java.nio.file.Path; | ||
import java.util.LinkedList; | import java.util.Map; | ||
import java.util.List; | |||
|
|
||
// TODO make immutable? | /** | ||
public class TestPlan { | * @author Sam Brannen | ||
* @since 5.0 | |||
*/ | |||
public final class TestPlan { | |||
|
|
||
private final List<TestIdentifier> testIdentifiers = new LinkedList<>(); | private TestPlan() { | ||
/* no-op */ | |||
} | |||
|
|
||
public List<TestIdentifier> getTestIdentifiers() { | public static TestPlanBuilder builder() { | ||
return testIdentifiers; | return new TestPlanBuilder(); | ||
} | } | ||
|
|
||
public void addTestIdentifiers(Collection<TestIdentifier> testDescriptions) { | public static final class TestPlanBuilder { | ||
this.testIdentifiers.addAll(testDescriptions); |
|
||
private TestPlanBuilder() { | |||
/* no-op */ | |||
} | |||
|
|||
public TestPlanBuilder configuration(Map<String, String> parameters) { | |||
return this; | |||
} | |||
|
|||
public TestPlanBuilder classes(Class<?>... classes) { | |||
return this; | |||
} | |||
|
|||
public TestPlanBuilder classNames(String... classNames) { | |||
return this; | |||
} | |||
|
|||
public TestPlanBuilder packages(Package... packages) { | |||
return this; | |||
} | |||
|
|||
public TestPlanBuilder packageNames(String... packageNames) { | |||
return this; | |||
} | |||
|
|||
public TestPlanBuilder paths(Path... paths) { | |||
return this; | |||
} | |||
|
|||
public TestPlanBuilder fileNames(String... fileNames) { | |||
return this; | |||
} | |||
|
|||
public TestPlanBuilder descriptorIds(String... descriptorIds) { | |||
return this; | |||
} | |||
|
|||
public TestPlanBuilder includePatterns(String... patterns) { | |||
return this; | |||
} | |||
|
|||
public TestPlanBuilder excludePatterns(String... patterns) { | |||
return this; | |||
} | |||
|
|||
public TestPlan build() { | |||
return new TestPlan(); | |||
} | |||
|
|||
} | } | ||
|
|
||
} | } |
34 changes: 34 additions & 0 deletions
34
junit-launcher/src/test/java/org/junit/gen5/launcher/TestPlanBuilderTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,34 @@ | |||
|
|||
package org.junit.gen5.launcher; | |||
|
|||
import static org.assertj.core.api.Assertions.assertThat; | |||
|
|||
import java.util.HashMap; | |||
|
|||
import org.junit.Test; | |||
import org.junit.gen5.launcher.TestPlan.TestPlanBuilder; | |||
|
|||
/** | |||
* Unit tests for {@link TestPlanBuilder}. | |||
* | |||
* @author Sam Brannen | |||
* @since 5.0 | |||
*/ | |||
public class TestPlanBuilderTests { | |||
|
|||
@Test | |||
public void testPlanBuilderDemo() { | |||
@SuppressWarnings("serial") | |||
TestPlan testPlan = TestPlan.builder() | |||
.configuration(new HashMap<String, String>(){{ | |||
put("category", "smoke"); | |||
}}) | |||
.packageNames("org.example.service.impl") | |||
.includePatterns("*Tests") | |||
.descriptorIds("junit5:org.example.UserTests#fullname()") | |||
.build(); | |||
|
|||
assertThat(testPlan).isNotNull(); | |||
} | |||
|
|||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,2 +1,4 @@ | |||
dependencies { | dependencies { | ||
compile(project(':open-test-alliance')) | |||
compile(project(':junit-commons')) | |||
} | } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
.../main/java/org/junit/core/Executable.java → ...n/java/org/junit/gen5/api/Executable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,5 +1,20 @@ | |||
package org.junit.gen5.api; | package org.junit.gen5.api; | ||
|
|
||
import java.lang.annotation.Documented; | |||
import java.lang.annotation.ElementType; | |||
import java.lang.annotation.Retention; | |||
import java.lang.annotation.RetentionPolicy; | |||
import java.lang.annotation.Target; | |||
|
|||
/** | |||
* @author Sam Brannen | |||
* @since 5.0 | |||
*/ | |||
@Target({ ElementType.TYPE, ElementType.METHOD }) | |||
@Retention(RetentionPolicy.RUNTIME) | |||
@Documented | |||
public @interface Test { | public @interface Test { | ||
|
|
||
String name() default ""; | |||
|
|||
} | } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,5 @@ | |||
dependencies { | dependencies { | ||
compile(project(':junit-engine-api')) | compile(project(':junit-engine-api')) | ||
compile(project(':junit5-api')) | compile(project(':junit5-api')) | ||
testCompile("junit:junit:4.12") | |||
} | } |
Oops, something went wrong.