You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2019/10/29 20:28:02 UTC
[isis] 07/23: ISIS-2094: fixes simpleapp integ tests
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 0cd57a2314ea8b33b93353f213cef83525692367
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Oct 28 15:22:32 2019 +0000
ISIS-2094: fixes simpleapp integ tests
requires change to the DN bootstrapping subtly for autocreate
---
.../DataNucleusApplicationComponents5.java | 14 +++----
core/pom.xml | 1 +
examples/apps/demo/pom.xml | 2 +-
examples/apps/helloworld/pom.xml | 39 ++++++++++++++++----
examples/apps/simpleapp/application/pom.xml | 34 ++++++++++++-----
examples/apps/simpleapp/module-simple/pom.xml | 43 ++++++++++++++++++----
.../integtests/SimpleModuleManifestForTesting.java | 2 +-
.../integtests/tests/SimpleObjects_IntegTest.java | 3 +-
examples/apps/simpleapp/webapp/pom.xml | 30 +++++++++++----
examples/pom.xml | 28 --------------
examples/smoketests/pom.xml | 31 ++++++++++++++++
mixins/datanucleus-enhance/pom.xml | 2 +-
pom.xml | 2 +
13 files changed, 162 insertions(+), 69 deletions(-)
diff --git a/core/plugins/jdo/datanucleus-5/src/main/java/org/apache/isis/jdo/persistence/DataNucleusApplicationComponents5.java b/core/plugins/jdo/datanucleus-5/src/main/java/org/apache/isis/jdo/persistence/DataNucleusApplicationComponents5.java
index 82d4176..a83337e 100644
--- a/core/plugins/jdo/datanucleus-5/src/main/java/org/apache/isis/jdo/persistence/DataNucleusApplicationComponents5.java
+++ b/core/plugins/jdo/datanucleus-5/src/main/java/org/apache/isis/jdo/persistence/DataNucleusApplicationComponents5.java
@@ -131,15 +131,15 @@ public class DataNucleusApplicationComponents5 implements ApplicationScopedCompo
}
private void configureAutoCreateSchema(final Map<String, String> datanucleusProps) {
- // we *don't* use DN's eager loading (autoStart), because doing so means that it attempts to
- // create the table before the schema (for any entities annotated @PersistenceCapable(schema=...)
+ // unlike v1, we DO now use we DN's eager loading for schema (ie set to PROPERTY_SCHEMA_AUTOCREATE_ALL to true).
//
- // instead, we manually create the schema ourselves
- // (if the configured StoreMgr supports it, and if requested in isis.properties)
- //
- datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_ALL, "false"); // turn off, cos want to do the schema object ourselves...
+ // the mechanism in v1 was to register a listener to create a schema just-in-time
+ // (CreateSchemaObjectFromClassMetadata); this does seem to be needed still if running the tests within an IDE
+ // but it is called too late if running from mvn. Luckily, it seems that DN's autocreate works within mvn.
+ datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_ALL, "true");
+
datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_DATABASE, "false");
- datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_TABLES, "true"); // but have DN do everything else...
+ datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_TABLES, "true");
datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_COLUMNS, "true");
datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_CONSTRAINTS, "true");
}
diff --git a/core/pom.xml b/core/pom.xml
index 38413f7..31a2625 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -143,6 +143,7 @@
<spring-boot.version>2.2.0.RELEASE</spring-boot.version>
<slf4j-api.version>1.7.26</slf4j-api.version> <!-- as provided by spring-boot, needed to solve convergence issues -->
+ <javax-servlet.version>3.1.0</javax-servlet.version>
<wicket.version>8.6.1</wicket.version>
<wicketstuff.version>8.6.0</wicketstuff.version> <!-- org.wicketstuff:wicketstuff-select2 -->
<wicket-bootstrap.version>2.0.10</wicket-bootstrap.version> <!-- de.agilecoders.wicket:wicket-bootstrap-core -->
diff --git a/examples/apps/demo/pom.xml b/examples/apps/demo/pom.xml
index 7b10528..6a42a1b 100644
--- a/examples/apps/demo/pom.xml
+++ b/examples/apps/demo/pom.xml
@@ -164,7 +164,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
- <version>2.1.6.RELEASE</version>
+ <version>2.2.0.RELEASE</version>
<executions>
<execution>
<goals>
diff --git a/examples/apps/helloworld/pom.xml b/examples/apps/helloworld/pom.xml
index be6d9e6..bb311a2 100644
--- a/examples/apps/helloworld/pom.xml
+++ b/examples/apps/helloworld/pom.xml
@@ -32,6 +32,37 @@
<maven-war-plugin.warName>${project.artifactId}</maven-war-plugin.warName>
</properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.odavid.maven.plugins</groupId>
+ <artifactId>mixin-maven-plugin</artifactId>
+ <version>0.1-alpha-40</version>
+ <extensions>true</extensions>
+ <configuration>
+ <mixins>
+ <mixin>
+ <groupId>org.apache.isis.mixins</groupId>
+ <artifactId>isis-mixin-standard</artifactId>
+ </mixin>
+ <mixin>
+ <groupId>org.apache.isis.mixins</groupId>
+ <artifactId>isis-mixin-datanucleus-enhance</artifactId>
+ </mixin>
+ <mixin>
+ <groupId>org.apache.isis.mixins</groupId>
+ <artifactId>isis-mixin-surefire</artifactId>
+ </mixin>
+ <mixin>
+ <groupId>org.apache.isis.mixins</groupId>
+ <artifactId>isis-mixin-docker</artifactId>
+ </mixin>
+ </mixins>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
<dependencies>
<!-- ISIS WEB-APP BUNDLE -->
@@ -66,12 +97,6 @@
<!-- OTHER DEPENDENCIES -->
- <!--
- <dependency>
- <groupId>org.hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- </dependency>
- -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
@@ -108,7 +133,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
- <version>2.1.6.RELEASE</version>
+ <version>2.2.0.RELEASE</version>
<executions>
<execution>
<goals>
diff --git a/examples/apps/simpleapp/application/pom.xml b/examples/apps/simpleapp/application/pom.xml
index 8946688..1510fcb 100644
--- a/examples/apps/simpleapp/application/pom.xml
+++ b/examples/apps/simpleapp/application/pom.xml
@@ -33,6 +33,28 @@
<packaging>jar</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.odavid.maven.plugins</groupId>
+ <artifactId>mixin-maven-plugin</artifactId>
+ <version>0.1-alpha-40</version>
+ <extensions>true</extensions>
+ <configuration>
+ <mixins>
+ <mixin>
+ <groupId>org.apache.isis.mixins</groupId>
+ <artifactId>isis-mixin-standard</artifactId>
+ </mixin>
+ <mixin>
+ <groupId>org.apache.isis.mixins</groupId>
+ <artifactId>isis-mixin-surefire</artifactId>
+ </mixin>
+ </mixins>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
<dependencies>
<dependency>
@@ -72,9 +94,9 @@
<!-- PERSISTENCE -->
- <dependency>
- <groupId>org.hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
</dependency>
<!--
@@ -116,12 +138,6 @@
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <scope>test</scope>
- </dependency>
-
</dependencies>
diff --git a/examples/apps/simpleapp/module-simple/pom.xml b/examples/apps/simpleapp/module-simple/pom.xml
index c1bbec9..7f92500 100644
--- a/examples/apps/simpleapp/module-simple/pom.xml
+++ b/examples/apps/simpleapp/module-simple/pom.xml
@@ -28,6 +28,33 @@
<maven-pmd-plugin.ruleset>${project.parent.basedir}/_checks/pmd.xml</maven-pmd-plugin.ruleset>
</properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.odavid.maven.plugins</groupId>
+ <artifactId>mixin-maven-plugin</artifactId>
+ <version>0.1-alpha-40</version>
+ <extensions>true</extensions>
+ <configuration>
+ <mixins>
+ <mixin>
+ <groupId>org.apache.isis.mixins</groupId>
+ <artifactId>isis-mixin-standard</artifactId>
+ </mixin>
+ <mixin>
+ <groupId>org.apache.isis.mixins</groupId>
+ <artifactId>isis-mixin-datanucleus-enhance</artifactId>
+ </mixin>
+ <mixin>
+ <groupId>org.apache.isis.mixins</groupId>
+ <artifactId>isis-mixin-surefire</artifactId>
+ </mixin>
+ </mixins>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
<dependencies>
<!-- ISIS API -->
@@ -82,17 +109,19 @@
<scope>test</scope>
</dependency>
-<!-- <dependency> -->
-<!-- <groupId>com.h2database</groupId> -->
-<!-- <artifactId>h2</artifactId> -->
-<!-- <scope>test</scope> -->
-<!-- </dependency> -->
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
- <groupId>org.hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>${javax-servlet.version}</version>
<scope>test</scope>
</dependency>
+
</dependencies>
diff --git a/examples/apps/simpleapp/module-simple/src/test/java/domainapp/modules/simple/integtests/SimpleModuleManifestForTesting.java b/examples/apps/simpleapp/module-simple/src/test/java/domainapp/modules/simple/integtests/SimpleModuleManifestForTesting.java
index 115dff8..a7874bf 100644
--- a/examples/apps/simpleapp/module-simple/src/test/java/domainapp/modules/simple/integtests/SimpleModuleManifestForTesting.java
+++ b/examples/apps/simpleapp/module-simple/src/test/java/domainapp/modules/simple/integtests/SimpleModuleManifestForTesting.java
@@ -43,7 +43,7 @@ import domainapp.modules.simple.SimpleModule;
@Configuration
@PropertySources({
//@PropertySource("classpath:/domainapp/application/manifest/isis-non-changing.properties"),
- @PropertySource(IsisPresets.HsqlDbInMemory),
+ @PropertySource(IsisPresets.H2InMemory),
@PropertySource(IsisPresets.DataNucleusAutoCreate),
})
@Import({
diff --git a/examples/apps/simpleapp/module-simple/src/test/java/domainapp/modules/simple/integtests/tests/SimpleObjects_IntegTest.java b/examples/apps/simpleapp/module-simple/src/test/java/domainapp/modules/simple/integtests/tests/SimpleObjects_IntegTest.java
index c64b414..1769414 100644
--- a/examples/apps/simpleapp/module-simple/src/test/java/domainapp/modules/simple/integtests/tests/SimpleObjects_IntegTest.java
+++ b/examples/apps/simpleapp/module-simple/src/test/java/domainapp/modules/simple/integtests/tests/SimpleObjects_IntegTest.java
@@ -22,6 +22,7 @@ import java.sql.SQLIntegrityConstraintViolationException;
import java.util.List;
import javax.inject.Inject;
+import javax.jdo.JDODataStoreException;
import org.hamcrest.MatcherAssert;
import org.junit.jupiter.api.Test;
@@ -100,7 +101,7 @@ public class SimpleObjects_IntegTest extends SimpleModuleIntegTestAbstract {
// also expect
MatcherAssert.assertThat(cause,
- ThrowableMatchers.causedBy(SQLIntegrityConstraintViolationException.class));
+ ThrowableMatchers.causedBy(JDODataStoreException.class));
}
diff --git a/examples/apps/simpleapp/webapp/pom.xml b/examples/apps/simpleapp/webapp/pom.xml
index 1b3c920..1e61224 100644
--- a/examples/apps/simpleapp/webapp/pom.xml
+++ b/examples/apps/simpleapp/webapp/pom.xml
@@ -45,6 +45,28 @@
<docker-plugin.registryUrl>https://index.docker.io/v1/</docker-plugin.registryUrl>
</properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.odavid.maven.plugins</groupId>
+ <artifactId>mixin-maven-plugin</artifactId>
+ <version>0.1-alpha-40</version>
+ <extensions>true</extensions>
+ <configuration>
+ <mixins>
+ <mixin>
+ <groupId>org.apache.isis.mixins</groupId>
+ <artifactId>isis-mixin-standard</artifactId>
+ </mixin>
+ <mixin>
+ <groupId>org.apache.isis.mixins</groupId>
+ <artifactId>isis-mixin-docker</artifactId>
+ </mixin>
+ </mixins>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
<dependencies>
<!-- this app -->
@@ -60,12 +82,6 @@
<type>pom</type>
</dependency>
- <!--
- <dependency>
- <groupId>org.hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- </dependency>
- -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
@@ -92,7 +108,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
- <version>2.1.6.RELEASE</version>
+ <version>2.2.0.RELEASE</version>
<executions>
<execution>
<goals>
diff --git a/examples/pom.xml b/examples/pom.xml
index 17c5e44..c19e227 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -130,34 +130,6 @@
</resource>
</resources>
<plugins>
-
- <plugin>
- <groupId>com.github.odavid.maven.plugins</groupId>
- <artifactId>mixin-maven-plugin</artifactId>
- <version>0.1-alpha-40</version>
- <extensions>true</extensions>
- <configuration>
- <mixins>
- <mixin>
- <groupId>org.apache.isis.mixins</groupId>
- <artifactId>isis-mixin-standard</artifactId>
- </mixin>
- <mixin>
- <groupId>org.apache.isis.mixins</groupId>
- <artifactId>isis-mixin-datanucleus-enhance</artifactId>
- </mixin>
- <mixin>
- <groupId>org.apache.isis.mixins</groupId>
- <artifactId>isis-mixin-surefire</artifactId>
- </mixin>
- <mixin>
- <groupId>org.apache.isis.mixins</groupId>
- <artifactId>isis-mixin-docker</artifactId>
- </mixin>
- </mixins>
- </configuration>
- </plugin>
-
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
diff --git a/examples/smoketests/pom.xml b/examples/smoketests/pom.xml
index 9b5eee8..6eb4ecf 100644
--- a/examples/smoketests/pom.xml
+++ b/examples/smoketests/pom.xml
@@ -29,6 +29,37 @@
<maven-war-plugin.warName>${project.artifactId}</maven-war-plugin.warName>
</properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.odavid.maven.plugins</groupId>
+ <artifactId>mixin-maven-plugin</artifactId>
+ <version>0.1-alpha-40</version>
+ <extensions>true</extensions>
+ <configuration>
+ <mixins>
+ <mixin>
+ <groupId>org.apache.isis.mixins</groupId>
+ <artifactId>isis-mixin-standard</artifactId>
+ </mixin>
+ <mixin>
+ <groupId>org.apache.isis.mixins</groupId>
+ <artifactId>isis-mixin-datanucleus-enhance</artifactId>
+ </mixin>
+ <mixin>
+ <groupId>org.apache.isis.mixins</groupId>
+ <artifactId>isis-mixin-surefire</artifactId>
+ </mixin>
+ <mixin>
+ <groupId>org.apache.isis.mixins</groupId>
+ <artifactId>isis-mixin-docker</artifactId>
+ </mixin>
+ </mixins>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
<dependencies>
<!-- ISIS WEB-APP BUNDLE -->
diff --git a/mixins/datanucleus-enhance/pom.xml b/mixins/datanucleus-enhance/pom.xml
index fe9edb5..62cd503 100644
--- a/mixins/datanucleus-enhance/pom.xml
+++ b/mixins/datanucleus-enhance/pom.xml
@@ -74,7 +74,7 @@
<id>process-test-classes</id>
<phase>process-test-classes</phase>
<goals>
- <goal>enhance</goal>
+ <goal>test-enhance</goal>
</goals>
<configuration>
<metadataDirectory>${project.build.testOutputDirectory}</metadataDirectory>
diff --git a/pom.xml b/pom.xml
index 7e139cd..bbd69d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,6 +34,7 @@
</scm>
<modules>
+ <module>mixins</module>
<module>core</module>
</modules>
@@ -49,6 +50,7 @@
</property>
</activation>
<modules>
+ <module>mixins</module>
<module>core</module>
<module>examples</module>
</modules>