-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update project template for CUBA 7.2 #190
- Loading branch information
1 parent
fc6824f
commit 2698fda
Showing
16 changed files
with
347 additions
and
194 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
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
54 changes: 54 additions & 0 deletions
54
...modules/core/test/$[project.rootPackage]/${project.testContainerPrefix}TestContainer.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,54 @@ | ||
package ${project.rootPackage}; | ||
|
||
import com.haulmont.cuba.testsupport.TestContainer; | ||
import org.junit.jupiter.api.extension.ExtensionContext; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
|
||
public class ${project.testContainerPrefix}TestContainer extends TestContainer { | ||
|
||
public ${project.testContainerPrefix}TestContainer() { | ||
super(); | ||
//noinspection ArraysAsListWithZeroOrOneArgument | ||
appComponents = new ArrayList<>(Arrays.asList( | ||
// list add-ons here: "com.haulmont.reports", "com.haulmont.addon.bproc", etc.<% | ||
"com.haulmont.cuba" | ||
)); | ||
appPropertiesFiles = Arrays.asList( | ||
// List the files defined in your web.xml | ||
// in appPropertiesConfig context parameter of the core module | ||
"${project.rootPackageDirectory}/app.properties", | ||
// Add this file which is located in CUBA and defines some properties | ||
// specifically for test environment. You can replace it with your own | ||
// or add another one in the end. | ||
"${project.rootPackageDirectory}/test-app.properties"); | ||
autoConfigureDataSource(); | ||
} | ||
|
||
public static class Common extends ${project.testContainerPrefix}TestContainer { | ||
|
||
public static final ${project.testContainerPrefix}TestContainer.Common INSTANCE = new ${project.testContainerPrefix}TestContainer.Common(); | ||
|
||
private static volatile boolean initialized; | ||
|
||
private Common() { | ||
} | ||
|
||
@Override | ||
public void beforeAll(ExtensionContext extensionContext) throws Exception { | ||
if (!initialized) { | ||
super.beforeAll(extensionContext); | ||
initialized = true; | ||
} | ||
setupContext(); | ||
} | ||
|
||
@SuppressWarnings("RedundantThrows") | ||
@Override | ||
public void afterAll(ExtensionContext extensionContext) throws Exception { | ||
cleanupContext(); | ||
// never stops - do not call super | ||
} | ||
} | ||
} |
Oops, something went wrong.