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 2020/02/11 14:28:41 UTC

[isis] branch master updated: ISIS-2275: fixes a smoketest, also enables more tests for surefire

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/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new beed928  ISIS-2275: fixes a smoketest, also enables more tests for surefire
beed928 is described below

commit beed928c838deab17a2dafda7926100e317f0829
Author: Andi Huber <ah...@apache.org>
AuthorDate: Tue Feb 11 15:28:28 2020 +0100

    ISIS-2275: fixes a smoketest, also enables more tests for surefire
---
 .../src/test/java/org/apache/isis/testdomain/Smoketest.java          | 5 +----
 .../apache/isis/testdomain/commandexecution/WrapperAsyncTest.java    | 5 +++--
 .../org/apache/isis/testdomain/commandexecution/WrapperSyncTest.java | 2 --
 .../isis/testdomain/domainmodel/DomainModelTest_usingGoodDomain.java | 4 ++--
 4 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/examples/smoketests/src/test/java/org/apache/isis/testdomain/Smoketest.java b/examples/smoketests/src/test/java/org/apache/isis/testdomain/Smoketest.java
index d977a52..95e82bb 100644
--- a/examples/smoketests/src/test/java/org/apache/isis/testdomain/Smoketest.java
+++ b/examples/smoketests/src/test/java/org/apache/isis/testdomain/Smoketest.java
@@ -24,15 +24,12 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.annotation.DirtiesContext.ClassMode;
-
 /**
  * To be used on all smoke-test classes, to allow for a convenient means to globally apply meta-annotations.
  */
 @Target({ ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)
-@DirtiesContext(classMode = ClassMode.BEFORE_CLASS) //XXX prevents re-use of cached application-context
+//@DirtiesContext(classMode = ClassMode.BEFORE_CLASS) // prevents re-use of cached application-context
 @Documented
 public @interface Smoketest {
 
diff --git a/examples/smoketests/src/test/java/org/apache/isis/testdomain/commandexecution/WrapperAsyncTest.java b/examples/smoketests/src/test/java/org/apache/isis/testdomain/commandexecution/WrapperAsyncTest.java
index 702f86f..dfa1798 100644
--- a/examples/smoketests/src/test/java/org/apache/isis/testdomain/commandexecution/WrapperAsyncTest.java
+++ b/examples/smoketests/src/test/java/org/apache/isis/testdomain/commandexecution/WrapperAsyncTest.java
@@ -62,7 +62,7 @@ import lombok.extern.log4j.Log4j2;
         }
 )
 @TestPropertySource(IsisPresets.UseLog4j2Test)
-@Incubating("inconsitent state when run in a test batch")
+@Incubating("wrapper.wrap(inventoryManager) throws NPE")
 class WrapperAsyncTest {
 
     @Inject private FixtureScripts fixtureScripts;
@@ -90,7 +90,8 @@ class WrapperAsyncTest {
 
         actionDomainEventListener.prepareLatch();
 
-        wrapper.wrap(inventoryManager).updateProductPrice(product, 123);
+        wrapper.wrap(inventoryManager)
+        .updateProductPrice(product, 123);
 
         assertTrue(
                 actionDomainEventListener.getCountDownLatch()
diff --git a/examples/smoketests/src/test/java/org/apache/isis/testdomain/commandexecution/WrapperSyncTest.java b/examples/smoketests/src/test/java/org/apache/isis/testdomain/commandexecution/WrapperSyncTest.java
index 91905e5..7654e11 100644
--- a/examples/smoketests/src/test/java/org/apache/isis/testdomain/commandexecution/WrapperSyncTest.java
+++ b/examples/smoketests/src/test/java/org/apache/isis/testdomain/commandexecution/WrapperSyncTest.java
@@ -33,7 +33,6 @@ import org.apache.isis.applib.services.factory.FactoryService;
 import org.apache.isis.applib.services.repository.RepositoryService;
 import org.apache.isis.applib.services.wrapper.WrapperFactory;
 import org.apache.isis.core.config.presets.IsisPresets;
-import org.apache.isis.testdomain.Incubating;
 import org.apache.isis.testdomain.Smoketest;
 import org.apache.isis.testdomain.conf.Configuration_usingJdo;
 import org.apache.isis.testdomain.jdo.Book;
@@ -51,7 +50,6 @@ import lombok.val;
         }
 )
 @TestPropertySource(IsisPresets.UseLog4j2Test)
-@Incubating("inconsitent state when run in a test batch")
 class WrapperSyncTest {
 
     @Inject private FixtureScripts fixtureScripts;
diff --git a/examples/smoketests/src/test/java/org/apache/isis/testdomain/domainmodel/DomainModelTest_usingGoodDomain.java b/examples/smoketests/src/test/java/org/apache/isis/testdomain/domainmodel/DomainModelTest_usingGoodDomain.java
index 24d8cc0..e3b528f 100644
--- a/examples/smoketests/src/test/java/org/apache/isis/testdomain/domainmodel/DomainModelTest_usingGoodDomain.java
+++ b/examples/smoketests/src/test/java/org/apache/isis/testdomain/domainmodel/DomainModelTest_usingGoodDomain.java
@@ -149,7 +149,7 @@ class DomainModelTest_usingGoodDomain {
         val mx_openRestApi = holderSpec.getObjectAction("openRestApi"); // built-in mixin support
         assertNotNull(mx_openRestApi);
         
-        assertThrows(Exception.class, ()->holderSpec.getAssociation("openRestApi")); // should not be picked up as a property
+        assertThrows(Exception.class, ()->holderSpec.getAssociationElseFail("openRestApi")); // should not be picked up as a property
         
     }
     
@@ -158,7 +158,7 @@ class DomainModelTest_usingGoodDomain {
         
         val holderSpec = specificationLoader.loadSpecification(Product.class);
         
-        val mx_datanucleusIdLong = holderSpec.getAssociation("datanucleusIdLong"); // plugged in mixin
+        val mx_datanucleusIdLong = holderSpec.getAssociationElseFail("datanucleusIdLong"); // plugged in mixin
         assertNotNull(mx_datanucleusIdLong);
         
     }