This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/causeway.git


The following commit(s) were added to refs/heads/master by this push:
     new b2d77eb3ce CAUSEWAY-3411: adds JUnit tests to spin up the demo domain
b2d77eb3ce is described below

commit b2d77eb3ce623d53fc3ef42ff81cebce20547f8f
Author: Andi Huber <[email protected]>
AuthorDate: Tue Apr 4 11:17:00 2023 +0200

    CAUSEWAY-3411: adds JUnit tests to spin up the demo domain
---
 examples/demo/pom.xml                              |  13 +++
 examples/demo/testing/jdo/pom.xml                  |  45 +++++++++
 .../testing/jdo/DemoDomainJdo_forTesting.java      |  36 +++++++
 .../demoapp/testing/jdo/SpinUpDemoJdoTest.java     |  40 ++++++++
 examples/demo/testing/jpa/pom.xml                  |  51 ++++++++++
 .../testing/jpa/DemoDomainJpa_forTesting.java      |  37 +++++++
 .../demoapp/testing/jpa/SpinUpDemoJpaTest.java     |  41 ++++++++
 examples/demo/testing/pom.xml                      | 107 +++++++++++++++++++++
 .../main/java/demoapp/web/DemoAppManifestJpa.java  |   1 -
 pom.xml                                            |  11 +++
 10 files changed, 381 insertions(+), 1 deletion(-)

diff --git a/examples/demo/pom.xml b/examples/demo/pom.xml
index aff58b9f40..58e6288876 100644
--- a/examples/demo/pom.xml
+++ b/examples/demo/pom.xml
@@ -216,6 +216,19 @@
        </dependencies>
 
        <profiles>
+               <profile>
+                       <id>module-examples-demo-testing</id>
+                       <activation>
+                               <property>
+                                       
<name>module-examples-demo-testing</name>
+                               </property>
+                       </activation>
+                       <modules>
+                               <module>domain</module>
+                               <module>web</module>
+                               <module>testing</module>
+                       </modules>
+               </profile>
                <profile>
                        <id>module-examples-demo-wicket</id>
                        <activation>
diff --git a/examples/demo/testing/jdo/pom.xml 
b/examples/demo/testing/jdo/pom.xml
new file mode 100644
index 0000000000..f695c651d1
--- /dev/null
+++ b/examples/demo/testing/jdo/pom.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more 
contributor
+       license agreements. See the NOTICE file distributed with this work for 
additional
+       information regarding copyright ownership. The ASF licenses this file to
+       you under the Apache License, Version 2.0 (the "License"); you may not 
use
+       this file except in compliance with the License. You may obtain a copy 
of
+       the License at http://www.apache.org/licenses/LICENSE-2.0 Unless 
required
+       by applicable law or agreed to in writing, software distributed under 
the
+       License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
CONDITIONS
+       OF ANY KIND, either express or implied. See the License for the specific
+       language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+       <modelVersion>4.0.0</modelVersion>
+
+       <parent>
+               <groupId>org.apache.causeway.examples.apps</groupId>
+               <artifactId>demo-testing</artifactId>
+               <version>2.0.0-SNAPSHOT</version>
+               <relativePath>../pom.xml</relativePath>
+       </parent>
+       
+       <artifactId>demo-testing-jdo</artifactId>
+
+       <name>Demo - Testing (JDO)</name>
+
+       <packaging>jar</packaging>
+
+       <properties>
+               <sonar.skip>true</sonar.skip>
+       </properties>
+
+       <dependencies>
+
+               <!-- PERSISTENCE -->
+               
+               <dependency>
+                       <groupId>org.apache.causeway.persistence</groupId>
+                       
<artifactId>causeway-persistence-jdo-datanucleus</artifactId>
+               </dependency>
+
+       </dependencies>
+
+</project>
diff --git 
a/examples/demo/testing/jdo/src/main/java/demoapp/testing/jdo/DemoDomainJdo_forTesting.java
 
b/examples/demo/testing/jdo/src/main/java/demoapp/testing/jdo/DemoDomainJdo_forTesting.java
new file mode 100644
index 0000000000..490e107671
--- /dev/null
+++ 
b/examples/demo/testing/jdo/src/main/java/demoapp/testing/jdo/DemoDomainJdo_forTesting.java
@@ -0,0 +1,36 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package demoapp.testing.jdo;
+
+import org.springframework.boot.SpringBootConfiguration;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.context.annotation.Import;
+import org.springframework.context.annotation.Profile;
+
+import demoapp.web.DemoAppManifestJdo;
+
+@SpringBootConfiguration
+@Profile("demo-jdo")
+@EnableAutoConfiguration
+@Import({
+    DemoAppManifestJdo.class
+})
+public class DemoDomainJdo_forTesting {
+
+}
diff --git 
a/examples/demo/testing/jdo/src/test/java/demoapp/testing/jdo/SpinUpDemoJdoTest.java
 
b/examples/demo/testing/jdo/src/test/java/demoapp/testing/jdo/SpinUpDemoJdoTest.java
new file mode 100644
index 0000000000..d9dc037ba5
--- /dev/null
+++ 
b/examples/demo/testing/jdo/src/test/java/demoapp/testing/jdo/SpinUpDemoJdoTest.java
@@ -0,0 +1,40 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package demoapp.testing.jdo;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
+
+@SpringBootTest(
+        classes = {
+                DemoDomainJdo_forTesting.class
+        },
+        properties = {
+        })
+@ActiveProfiles(profiles = "demo-jdo")
+class SpinUpDemoJdoTest {
+    
+    @Test @Disabled("missing DomainObjectAliasedJdo, ...") //TODO demo domain 
is currently WIP
+    void contextLoads() {
+        
+    }
+
+}
\ No newline at end of file
diff --git a/examples/demo/testing/jpa/pom.xml 
b/examples/demo/testing/jpa/pom.xml
new file mode 100644
index 0000000000..636fde22d1
--- /dev/null
+++ b/examples/demo/testing/jpa/pom.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more 
contributor
+       license agreements. See the NOTICE file distributed with this work for 
additional
+       information regarding copyright ownership. The ASF licenses this file to
+       you under the Apache License, Version 2.0 (the "License"); you may not 
use
+       this file except in compliance with the License. You may obtain a copy 
of
+       the License at http://www.apache.org/licenses/LICENSE-2.0 Unless 
required
+       by applicable law or agreed to in writing, software distributed under 
the
+       License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
CONDITIONS
+       OF ANY KIND, either express or implied. See the License for the specific
+       language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+       <modelVersion>4.0.0</modelVersion>
+
+       <parent>
+               <groupId>org.apache.causeway.examples.apps</groupId>
+               <artifactId>demo-testing</artifactId>
+               <version>2.0.0-SNAPSHOT</version>
+               <relativePath>../pom.xml</relativePath>
+       </parent>
+       
+       <artifactId>demo-testing-jpa</artifactId>
+
+       <name>Demo - Testing (JPA)</name>
+
+       <packaging>jar</packaging>
+
+       <properties>
+               <sonar.skip>true</sonar.skip>
+       </properties>
+
+       <dependencies>
+
+               <!-- PERSISTENCE -->
+               
+               <dependency>
+                       <groupId>org.apache.causeway.persistence</groupId>
+                       
<artifactId>causeway-persistence-jpa-eclipselink</artifactId>
+                       <exclusions>
+                               <exclusion>
+                                       
<groupId>org.eclipse.persistence</groupId>
+                                       
<artifactId>jakarta.persistence</artifactId>
+                               </exclusion>
+                       </exclusions>
+               </dependency>
+
+       </dependencies>
+
+</project>
diff --git 
a/examples/demo/testing/jpa/src/main/java/demoapp/testing/jpa/DemoDomainJpa_forTesting.java
 
b/examples/demo/testing/jpa/src/main/java/demoapp/testing/jpa/DemoDomainJpa_forTesting.java
new file mode 100644
index 0000000000..1992d7d57d
--- /dev/null
+++ 
b/examples/demo/testing/jpa/src/main/java/demoapp/testing/jpa/DemoDomainJpa_forTesting.java
@@ -0,0 +1,37 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package demoapp.testing.jpa;
+
+import org.springframework.boot.SpringBootConfiguration;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.context.annotation.Import;
+import org.springframework.context.annotation.Profile;
+
+import demoapp.web.DemoAppManifestJpa;
+
+@SpringBootConfiguration
+@Profile("demo-jpa")
+@EnableAutoConfiguration
+@Import({
+    DemoAppManifestJpa.class
+})
+public class DemoDomainJpa_forTesting {
+    
+
+}
diff --git 
a/examples/demo/testing/jpa/src/test/java/demoapp/testing/jpa/SpinUpDemoJpaTest.java
 
b/examples/demo/testing/jpa/src/test/java/demoapp/testing/jpa/SpinUpDemoJpaTest.java
new file mode 100644
index 0000000000..67b1c69cb4
--- /dev/null
+++ 
b/examples/demo/testing/jpa/src/test/java/demoapp/testing/jpa/SpinUpDemoJpaTest.java
@@ -0,0 +1,41 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package demoapp.testing.jpa;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
+
+@SpringBootTest(
+        classes = {
+                DemoDomainJpa_forTesting.class
+        },
+        properties = {
+                //"spring.jpa.show-sql=true",
+                //"logging.level.org.springframework.orm.jpa=DEBUG"
+        })
+@ActiveProfiles(profiles = "demo-jpa")
+class SpinUpDemoJpaTest {
+    
+    @Test
+    void contextLoads() {
+        
+    }
+
+}
diff --git a/examples/demo/testing/pom.xml b/examples/demo/testing/pom.xml
new file mode 100644
index 0000000000..5618b8af95
--- /dev/null
+++ b/examples/demo/testing/pom.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more 
contributor
+       license agreements. See the NOTICE file distributed with this work for 
additional
+       information regarding copyright ownership. The ASF licenses this file to
+       you under the Apache License, Version 2.0 (the "License"); you may not 
use
+       this file except in compliance with the License. You may obtain a copy 
of
+       the License at http://www.apache.org/licenses/LICENSE-2.0 Unless 
required
+       by applicable law or agreed to in writing, software distributed under 
the
+       License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
CONDITIONS
+       OF ANY KIND, either express or implied. See the License for the specific
+       language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+       <modelVersion>4.0.0</modelVersion>
+
+       <parent>
+               <groupId>org.apache.causeway.examples.apps</groupId>
+               <artifactId>demo-parent</artifactId>
+               <version>2.0.0-SNAPSHOT</version>
+               <relativePath>../pom.xml</relativePath>
+       </parent>
+
+       <artifactId>demo-testing</artifactId>
+
+       <name>Demo - Testing</name>
+
+       <packaging>pom</packaging>
+
+       <dependencies>
+
+               <!-- WEB APPLICATION DEPENDENCY BUNDLE -->
+
+               <dependency>
+                       <groupId>org.apache.causeway.mavendeps</groupId>
+                       <artifactId>causeway-mavendeps-webapp</artifactId>
+                       <type>pom</type>
+               </dependency>
+
+               <!-- DEMO DOMAIN -->
+
+               <dependency>
+                       <groupId>org.apache.causeway.examples.apps</groupId>
+                       <artifactId>demo-domain</artifactId>
+               </dependency>
+               
+               <dependency>
+                   <groupId>org.apache.causeway.examples.apps</groupId>
+                   <artifactId>demo-web</artifactId>
+               </dependency>
+
+               <!-- CORS -->
+
+               <dependency>
+                       <groupId>org.apache.causeway.extensions</groupId>
+                       <artifactId>causeway-extensions-cors-impl</artifactId>
+               </dependency>
+               
+               <!-- EXTENSIONS -->
+               
+               <dependency>
+                       <groupId>org.apache.causeway.valuetypes</groupId>
+                       <artifactId>causeway-valuetypes-asciidoc-ui</artifactId>
+                       <version>${project.version}</version>
+                       <type>pom</type>
+               </dependency>
+
+               <!-- SPRING -->
+
+               <dependency>
+                       <groupId>org.springframework.boot</groupId>
+                       <artifactId>spring-boot-starter-actuator</artifactId>
+               </dependency>
+
+               <dependency>
+                       <groupId>org.springframework.boot</groupId>
+                       <artifactId>spring-boot-starter</artifactId>
+                       <exclusions>
+                               <exclusion>
+                                       
<groupId>org.springframework.boot</groupId>
+                                       
<artifactId>spring-boot-starter-logging</artifactId>
+                               </exclusion>
+                       </exclusions>
+               </dependency>
+               <dependency>
+                       <groupId>org.springframework.boot</groupId>
+                       <artifactId>spring-boot-starter-test</artifactId>
+                       <exclusions>
+                               <exclusion>
+                                       
<groupId>org.springframework.boot</groupId>
+                                       
<artifactId>spring-boot-starter-logging</artifactId>
+                               </exclusion>
+                       </exclusions>
+               </dependency>
+               <dependency>
+                       <groupId>org.springframework.boot</groupId>
+                       <artifactId>spring-boot-starter-log4j2</artifactId>
+               </dependency>
+               
+       </dependencies>
+       
+       <modules>
+               <module>jdo</module>
+               <module>jpa</module>
+       </modules>
+
+</project>
diff --git 
a/examples/demo/web/src/main/java/demoapp/web/DemoAppManifestJpa.java 
b/examples/demo/web/src/main/java/demoapp/web/DemoAppManifestJpa.java
index 0a1ae9a0a1..2af62175ba 100644
--- a/examples/demo/web/src/main/java/demoapp/web/DemoAppManifestJpa.java
+++ b/examples/demo/web/src/main/java/demoapp/web/DemoAppManifestJpa.java
@@ -46,7 +46,6 @@ import demoapp.dom.DemoModuleJpa;
     CausewayModuleExtExecutionOutboxPersistenceJpa.class,
     CausewayModuleExtAuditTrailPersistenceJpa.class,
 })
-
 public class DemoAppManifestJpa {
 
 }
diff --git a/pom.xml b/pom.xml
index b7eed5a8c6..d3d1abdca9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -197,6 +197,17 @@
                        </modules>
                </profile>
 
+               <profile>
+                       <id>module-examples-demo-testing</id>
+                       <activation>
+                               <property>
+                                       
<name>module-examples-demo-testing</name>
+                               </property>
+                       </activation>
+                       <modules>
+                               <module>examples/demo</module>
+                       </modules>
+               </profile>
                <profile>
                        <id>module-examples-demo-wicket</id>
                        <activation>

Reply via email to