-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Framework-agnostic container & test lifecycle (#702)
* Implement framework-agnostic container & test lifecycle * Simpliy TestDescription interface * {before,after}TestBlock -> {before,after}Test
- Loading branch information
Showing
9 changed files
with
158 additions
and
44 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
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
13 changes: 13 additions & 0 deletions
13
core/src/main/java/org/testcontainers/lifecycle/Startable.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.testcontainers.lifecycle; | ||
|
||
public interface Startable extends AutoCloseable { | ||
|
||
void start(); | ||
|
||
void stop(); | ||
|
||
@Override | ||
default void close() { | ||
stop(); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
core/src/main/java/org/testcontainers/lifecycle/TestDescription.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.testcontainers.lifecycle; | ||
|
||
public interface TestDescription { | ||
|
||
String getTestId(); | ||
|
||
String getFilesystemFriendlyName(); | ||
} |
14 changes: 14 additions & 0 deletions
14
core/src/main/java/org/testcontainers/lifecycle/TestLifecycleAware.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.testcontainers.lifecycle; | ||
|
||
import java.util.Optional; | ||
|
||
public interface TestLifecycleAware { | ||
|
||
default void beforeTest(TestDescription description) { | ||
|
||
} | ||
|
||
default void afterTest(TestDescription description, Optional<Throwable> throwable) { | ||
|
||
} | ||
} |
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
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