polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [08/14] polygene-java git commit: Migrating to JUnit5. Intermediary build where all tests of phase 1 compiles, but not necessarily succeeds.
Date Sun, 15 Apr 2018 05:55:23 GMT
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientVisibilityTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientVisibilityTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientVisibilityTest.java
index c71d526..0a760f5 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientVisibilityTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientVisibilityTest.java
@@ -41,9 +41,11 @@ import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.Energy4Java;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.EntityTestAssembler;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 public class TransientVisibilityTest
 {
@@ -53,7 +55,7 @@ public class TransientVisibilityTest
     private Application app;
     private UnitOfWorkFactory uowf;
 
-    @Before
+    @BeforeEach
     public void setup()
         throws Exception
     {
@@ -88,7 +90,7 @@ public class TransientVisibilityTest
         uowf = module.unitOfWorkFactory();
     }
 
-    @After
+    @AfterEach
     public void tearDown()
         throws Exception
     {
@@ -130,11 +132,13 @@ public class TransientVisibilityTest
         service.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromServiceWhenAccessingBesideModuleVisibleExpectException()
     {
-        FromService service = module.findService( FromService.class ).get();
-        service.besideModuleVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromService service = module.findService( FromService.class ).get();
+            service.besideModuleVisible();
+        } );
     }
 
     @Test
@@ -144,39 +148,49 @@ public class TransientVisibilityTest
         service.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromServiceWhenAccessingBelowLayerVisibleExpectException()
     {
-        FromService service = module.findService( FromService.class ).get();
-        service.belowLayerVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromService service = module.findService( FromService.class ).get();
+            service.belowLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromServiceWhenAccessingBelowModuleVisibleExpectException()
     {
-        FromService service = module.findService( FromService.class ).get();
-        service.belowModuleVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromService service = module.findService( FromService.class ).get();
+            service.belowModuleVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromServiceWhenAccessingAboveApplicationVisibleExpectException()
     {
-        FromService service = module.findService( FromService.class ).get();
-        service.aboveApplicationVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromService service = module.findService( FromService.class ).get();
+            service.aboveApplicationVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromServiceWhenAccessingAboveLayerVisibleExpectException()
     {
-        FromService service = module.findService( FromService.class ).get();
-        service.aboveLayerVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromService service = module.findService( FromService.class ).get();
+            service.aboveLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromServiceWhenAccessingAboveModuleVisibleExpectException()
     {
-        FromService service = module.findService( FromService.class ).get();
-        service.aboveModuleVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromService service = module.findService( FromService.class ).get();
+            service.aboveModuleVisible();
+        } );
     }
 
     @Test
@@ -269,22 +283,24 @@ public class TransientVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromEntityWhenAccessingBesideModuleVisibleExpectException()
     {
-        UnitOfWork unitOfWork = uowf.newUnitOfWork();
-        try
-        {
-            FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTITY);
-            entity.besideModuleVisible();
-        }
-        finally
-        {
-            if( unitOfWork.isOpen() )
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            UnitOfWork unitOfWork = uowf.newUnitOfWork();
+            try
             {
-                unitOfWork.discard();
+                FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTITY );
+                entity.besideModuleVisible();
             }
-        }
+            finally
+            {
+                if( unitOfWork.isOpen() )
+                {
+                    unitOfWork.discard();
+                }
+            }
+        } );
     }
 
     @Test
@@ -305,94 +321,104 @@ public class TransientVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromEntityWhenAccessingBelowLayerVisibleExpectException()
     {
-        UnitOfWork unitOfWork = uowf.newUnitOfWork();
-        try
-        {
-            FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTITY);
-            entity.belowLayerVisible();
-        }
-        finally
-        {
-            if( unitOfWork.isOpen() )
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            UnitOfWork unitOfWork = uowf.newUnitOfWork();
+            try
             {
-                unitOfWork.discard();
+                FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTITY );
+                entity.belowLayerVisible();
             }
-        }
+            finally
+            {
+                if( unitOfWork.isOpen() )
+                {
+                    unitOfWork.discard();
+                }
+            }
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromEntityWhenAccessingBelowModuleVisibleExpectException()
     {
-        UnitOfWork unitOfWork = uowf.newUnitOfWork();
-        try
-        {
-            FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTITY);
-            entity.belowModuleVisible();
-        }
-        finally
-        {
-            if( unitOfWork.isOpen() )
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            UnitOfWork unitOfWork = uowf.newUnitOfWork();
+            try
             {
-                unitOfWork.discard();
+                FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTITY );
+                entity.belowModuleVisible();
             }
-        }
+            finally
+            {
+                if( unitOfWork.isOpen() )
+                {
+                    unitOfWork.discard();
+                }
+            }
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromEntityWhenAccessingAboveApplicationVisibleExpectException()
     {
-        UnitOfWork unitOfWork = uowf.newUnitOfWork();
-        try
-        {
-            FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTITY);
-            entity.aboveApplicationVisible();
-        }
-        finally
-        {
-            if( unitOfWork.isOpen() )
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            UnitOfWork unitOfWork = uowf.newUnitOfWork();
+            try
             {
-                unitOfWork.discard();
+                FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTITY );
+                entity.aboveApplicationVisible();
             }
-        }
+            finally
+            {
+                if( unitOfWork.isOpen() )
+                {
+                    unitOfWork.discard();
+                }
+            }
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromEntityWhenAccessingAboveLayerVisibleExpectException()
     {
-        UnitOfWork unitOfWork = uowf.newUnitOfWork();
-        try
-        {
-            FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTITY);
-            entity.aboveLayerVisible();
-        }
-        finally
-        {
-            if( unitOfWork.isOpen() )
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            UnitOfWork unitOfWork = uowf.newUnitOfWork();
+            try
             {
-                unitOfWork.discard();
+                FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTITY );
+                entity.aboveLayerVisible();
             }
-        }
+            finally
+            {
+                if( unitOfWork.isOpen() )
+                {
+                    unitOfWork.discard();
+                }
+            }
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromEntityWhenAccessingAboveModuleVisibleExpectException()
     {
-        UnitOfWork unitOfWork = uowf.newUnitOfWork();
-        try
-        {
-            FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTITY);
-            entity.aboveModuleVisible();
-        }
-        finally
-        {
-            if( unitOfWork.isOpen() )
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            UnitOfWork unitOfWork = uowf.newUnitOfWork();
+            try
             {
-                unitOfWork.discard();
+                FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTITY );
+                entity.aboveModuleVisible();
             }
-        }
+            finally
+            {
+                if( unitOfWork.isOpen() )
+                {
+                    unitOfWork.discard();
+                }
+            }
+        } );
     }
 
     @Test
@@ -430,11 +456,13 @@ public class TransientVisibilityTest
         value.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromValueWhenAccessingBesideModuleVisibleExpectException()
     {
-        FromValue value = module.newValue( FromValue.class );
-        value.besideModuleVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromValue value = module.newValue( FromValue.class );
+            value.besideModuleVisible();
+        } );
     }
 
     @Test
@@ -444,39 +472,49 @@ public class TransientVisibilityTest
         value.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromValueWhenAccessingBelowLayerVisibleExpectException()
     {
-        FromValue value = module.newValue( FromValue.class );
-        value.belowLayerVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromValue value = module.newValue( FromValue.class );
+            value.belowLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromValueWhenAccessingBelowModuleVisibleExpectException()
     {
-        FromValue value = module.newValue( FromValue.class );
-        value.belowModuleVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromValue value = module.newValue( FromValue.class );
+            value.belowModuleVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromValueWhenAccessingAboveApplicationVisibleExpectException()
     {
-        FromValue value = module.newValue( FromValue.class );
-        value.aboveApplicationVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromValue value = module.newValue( FromValue.class );
+            value.aboveApplicationVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromValueWhenAccessingAboveLayerVisibleExpectException()
     {
-        FromValue value = module.newValue( FromValue.class );
-        value.aboveLayerVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromValue value = module.newValue( FromValue.class );
+            value.aboveLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromValueWhenAccessingAboveModuleVisibleExpectException()
     {
-        FromValue value = module.newValue( FromValue.class );
-        value.aboveModuleVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromValue value = module.newValue( FromValue.class );
+            value.aboveModuleVisible();
+        } );
     }
 
     @Test
@@ -514,11 +552,13 @@ public class TransientVisibilityTest
         transientt.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromTransientWhenAccessingBesideModuleVisibleExpectException()
     {
-        FromTransient transientt = module.newTransient( FromTransient.class );
-        transientt.besideModuleVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromTransient transientt = module.newTransient( FromTransient.class );
+            transientt.besideModuleVisible();
+        } );
     }
 
     @Test
@@ -528,39 +568,49 @@ public class TransientVisibilityTest
         transientt.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromTransientWhenAccessingBelowLayerVisibleExpectException()
     {
-        FromTransient transientt = module.newTransient( FromTransient.class );
-        transientt.belowLayerVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromTransient transientt = module.newTransient( FromTransient.class );
+            transientt.belowLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromTransientWhenAccessingBelowModuleVisibleExpectException()
     {
-        FromTransient transientt = module.newTransient( FromTransient.class );
-        transientt.belowModuleVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromTransient transientt = module.newTransient( FromTransient.class );
+            transientt.belowModuleVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromTransientWhenAccessingAboveApplicationVisibleExpectException()
     {
-        FromTransient transientt = module.newTransient( FromTransient.class );
-        transientt.aboveApplicationVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromTransient transientt = module.newTransient( FromTransient.class );
+            transientt.aboveApplicationVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromTransientWhenAccessingAboveLayerVisibleExpectException()
     {
-        FromTransient transientt = module.newTransient( FromTransient.class );
-        transientt.aboveLayerVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromTransient transientt = module.newTransient( FromTransient.class );
+            transientt.aboveLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromTransientWhenAccessingAboveModuleVisibleExpectException()
     {
-        FromTransient transientt = module.newTransient( FromTransient.class );
-        transientt.aboveModuleVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromTransient transientt = module.newTransient( FromTransient.class );
+            transientt.aboveModuleVisible();
+        } );
     }
 
     @Test
@@ -598,11 +648,13 @@ public class TransientVisibilityTest
         object.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromObjectWhenAccessingBesideModuleVisibleExpectException()
     {
-        FromObject object = module.newObject( FromObject.class );
-        object.besideModuleVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromObject object = module.newObject( FromObject.class );
+            object.besideModuleVisible();
+        } );
     }
 
     @Test
@@ -612,39 +664,49 @@ public class TransientVisibilityTest
         object.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromObjectWhenAccessingBelowLayerVisibleExpectException()
     {
-        FromObject object = module.newObject( FromObject.class );
-        object.belowLayerVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromObject object = module.newObject( FromObject.class );
+            object.belowLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromObjectWhenAccessingBelowModuleVisibleExpectException()
     {
-        FromObject object = module.newObject( FromObject.class );
-        object.belowModuleVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromObject object = module.newObject( FromObject.class );
+            object.belowModuleVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromObjectWhenAccessingAboveApplicationVisibleExpectException()
     {
-        FromObject object = module.newObject( FromObject.class );
-        object.aboveApplicationVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromObject object = module.newObject( FromObject.class );
+            object.aboveApplicationVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromObjectWhenAccessingAboveLayerVisibleExpectException()
     {
-        FromObject object = module.newObject( FromObject.class );
-        object.aboveLayerVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromObject object = module.newObject( FromObject.class );
+            object.aboveLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchTransientTypeException.class )
+    @Test
     public void givenFromObjectWhenAccessingAboveModuleVisibleExpectException()
     {
-        FromObject object = module.newObject( FromObject.class );
-        object.aboveModuleVisible();
+        assertThrows( NoSuchTransientTypeException.class, () -> {
+            FromObject object = module.newObject( FromObject.class );
+            object.aboveModuleVisible();
+        } );
     }
 
     private static class FromAssembler

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/AutoCloseableUoWTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/AutoCloseableUoWTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/AutoCloseableUoWTest.java
index 3c10c1f..b615886 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/AutoCloseableUoWTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/AutoCloseableUoWTest.java
@@ -19,9 +19,6 @@
  */
 package org.apache.polygene.runtime.unitofwork;
 
-import org.apache.polygene.test.AbstractPolygeneTest;
-import org.junit.After;
-import org.junit.Test;
 import org.apache.polygene.api.constraint.ConstraintViolationException;
 import org.apache.polygene.api.entity.EntityBuilder;
 import org.apache.polygene.api.property.Property;
@@ -29,10 +26,14 @@ import org.apache.polygene.api.unitofwork.UnitOfWork;
 import org.apache.polygene.api.unitofwork.UnitOfWorkCompletionException;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
+import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
 
 import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 /**
  * Assert that Automatic Resource Management (ie. Java 7 try-with-resources) work on UoWs.
@@ -69,18 +70,20 @@ public class AutoCloseableUoWTest
         }
     }
 
-    @Test( expected = ConstraintViolationException.class )
+    @Test
     public void givenWrongAutoCloseableUoWWhenTryWithResourceExpectSuccess()
         throws UnitOfWorkCompletionException
     {
-        try( UnitOfWork uow = unitOfWorkFactory.newUnitOfWork() )
-        {
-            uow.newEntity( TestEntity.class );
-            uow.complete();
-        }
+        assertThrows( ConstraintViolationException.class, () -> {
+            try (UnitOfWork uow = unitOfWorkFactory.newUnitOfWork())
+            {
+                uow.newEntity( TestEntity.class );
+                uow.complete();
+            }
+        } );
     }
 
-    @After
+    @AfterEach
     public void afterEachTest()
     {
         assertThat( unitOfWorkFactory.isUnitOfWorkActive(), is( false ) );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/PrivateEntityUnitOfWorkTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/PrivateEntityUnitOfWorkTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/PrivateEntityUnitOfWorkTest.java
index c1a04f0..2531046 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/PrivateEntityUnitOfWorkTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/PrivateEntityUnitOfWorkTest.java
@@ -42,10 +42,10 @@ import org.apache.polygene.api.value.ValueComposite;
 import org.apache.polygene.bootstrap.Assembler;
 import org.apache.polygene.bootstrap.Energy4Java;
 import org.apache.polygene.test.EntityTestAssembler;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static org.apache.polygene.api.common.Visibility.application;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
 
 /**
  * JAVADOC

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/RemovalTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/RemovalTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/RemovalTest.java
index 617914a..6d361d5 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/RemovalTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/RemovalTest.java
@@ -31,10 +31,11 @@ import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.junit.jupiter.api.Assertions.fail;
 
 public class RemovalTest
     extends AbstractPolygeneTest
@@ -62,7 +63,7 @@ public class RemovalTest
             uow.complete();
             uow = unitOfWorkFactory.newUnitOfWork();
             Abc abc = uow.get( Abc.class, TEST_IDENTITY);
-            assertEquals( "Niclas", abc.name().get() );
+            assertThat( abc.name().get(), equalTo( "Niclas" ) );
         }
         finally
         {
@@ -83,7 +84,7 @@ public class RemovalTest
             uow.complete();
             uow = unitOfWorkFactory.newUnitOfWork();
             Abc abc = uow.get( Abc.class, TEST_IDENTITY);
-            assertEquals( "Niclas", abc.name().get() );
+            assertThat( abc.name().get(), equalTo( "Niclas" ) );
             uow.remove( abc );
             uow.complete();
             uow = unitOfWorkFactory.newUnitOfWork();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/UnitOfWorkFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/UnitOfWorkFactoryTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/UnitOfWorkFactoryTest.java
index a7adb40..03bc089 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/UnitOfWorkFactoryTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/UnitOfWorkFactoryTest.java
@@ -19,7 +19,6 @@
  */
 package org.apache.polygene.runtime.unitofwork;
 
-import org.junit.Test;
 import org.apache.polygene.api.association.Association;
 import org.apache.polygene.api.association.ManyAssociation;
 import org.apache.polygene.api.common.UseDefaults;
@@ -32,6 +31,10 @@ import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsEqual.equalTo;
 
 public class UnitOfWorkFactoryTest
     extends AbstractPolygeneTest
@@ -61,8 +64,8 @@ public class UnitOfWorkFactoryTest
         Product chair = cb.newInstance();
 
         String actual = chair.name().get();
-        org.junit.Assert.assertThat( "Chair.name()", actual, org.hamcrest.CoreMatchers.equalTo( "Chair" ) );
-        org.junit.Assert.assertThat( "Chair.price()", chair.price().get(), org.hamcrest.CoreMatchers.equalTo( 57 ) );
+        assertThat( "Chair.name()", actual, equalTo( "Chair" ) );
+        assertThat( "Chair.price()", chair.price().get(), equalTo( 57 ) );
 
         unitOfWork.complete();
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/util/AnnotationsTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/util/AnnotationsTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/util/AnnotationsTest.java
index cc00ba1..a3564f8 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/util/AnnotationsTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/util/AnnotationsTest.java
@@ -21,13 +21,14 @@ package org.apache.polygene.runtime.util;
 
 import java.lang.reflect.Type;
 import java.util.Collection;
-import org.junit.Test;
 import org.apache.polygene.api.mixin.Mixins;
 import org.apache.polygene.api.sideeffect.SideEffects;
 import org.apache.polygene.api.util.Annotations;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsNull.notNullValue;
+import static org.hamcrest.core.IsNull.nullValue;
 
 public class AnnotationsTest
 {
@@ -41,11 +42,11 @@ public class AnnotationsTest
     public void getAnnotationOrNull()
         throws NoSuchMethodException
     {
-        assertNotNull( "Mixins annotation found", Annotations.annotationOn( AnnotatedClass.class, Mixins.class ) );
+        assertThat( "Mixins annotation found", Annotations.annotationOn( AnnotatedClass.class, Mixins.class ), notNullValue() );
 
-        assertNull( "No SideEffects annotation found", Annotations.annotationOn( AnnotatedClass.class, SideEffects.class ) );
+        assertThat( "No SideEffects annotation found", Annotations.annotationOn( AnnotatedClass.class, SideEffects.class ), nullValue() );
 
         final Type returnType = AnnotatedClass.class.getDeclaredMethod( "list" ).getGenericReturnType();
-        assertNull( "Null on no class type", Annotations.annotationOn( returnType, Mixins.class ) );
+        assertThat( "Null on no class type", Annotations.annotationOn( returnType, Mixins.class ), nullValue() );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/value/AssociationToValueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/value/AssociationToValueTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/value/AssociationToValueTest.java
index d43cfc9..3101569 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/value/AssociationToValueTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/value/AssociationToValueTest.java
@@ -39,10 +39,10 @@ import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
+import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
-import static org.junit.Assert.assertThat;
 
 public class AssociationToValueTest extends AbstractPolygeneTest
 {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/value/NestedValueBuilderTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/value/NestedValueBuilderTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/value/NestedValueBuilderTest.java
index 0b5c77f..673a4ff 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/value/NestedValueBuilderTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/value/NestedValueBuilderTest.java
@@ -30,9 +30,9 @@ import org.apache.polygene.api.value.ValueComposite;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
 
 public class NestedValueBuilderTest
     extends AbstractPolygeneTest

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueComposite2Test.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueComposite2Test.java b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueComposite2Test.java
index a8a4d19..95da05b 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueComposite2Test.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueComposite2Test.java
@@ -33,8 +33,11 @@ import org.apache.polygene.api.value.ValueComposite;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.bootstrap.SingletonAssembler;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 public class ValueComposite2Test
 {
@@ -56,21 +59,23 @@ public class ValueComposite2Test
         Property<String> otherProperty = prototype.other();
         otherProperty.set( "Abc" );
         Some value = builder.newInstance();
-        Assert.assertEquals( value.other().get(), "Abc" );
+        assertThat( value.other().get(), equalTo( "Abc" ) );
     }
 
-    @Test( expected = AssemblyException.class )
+    @Test
     public void testUsesAnnotationIsNotAllowedInValueComposite()
         throws ActivationException, AssemblyException
     {
-        new SingletonAssembler()
-        {
-            public void assemble( ModuleAssembly module )
-                throws AssemblyException
+        assertThrows( AssemblyException.class, () ->
+            new SingletonAssembler()
             {
-                module.values( SomeValue2.class );
+                public void assemble( ModuleAssembly module )
+                    throws AssemblyException
+                {
+                    module.values( SomeValue2.class );
+                }
             }
-        };
+        );
     }
 
     public interface Some

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueCompositeBasicsTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueCompositeBasicsTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueCompositeBasicsTest.java
index 74f6226..ac71dec 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueCompositeBasicsTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueCompositeBasicsTest.java
@@ -26,10 +26,11 @@ import org.apache.polygene.api.value.ValueBuilder;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsEqual.equalTo;
 
 public class ValueCompositeBasicsTest
     extends AbstractPolygeneTest
@@ -48,13 +49,13 @@ public class ValueCompositeBasicsTest
     {
         ValueBuilder<SomeValue> builder = valueBuilderFactory.newValueBuilder( SomeValue.class );
         builder.prototypeFor( SomeInternalState.class ).name().set( "Niclas" );
-        assertEquals("Niclas", builder.prototype().name());
+        assertThat( builder.prototype().name(), equalTo( "Niclas" ) );
         SomeValue value1 = builder.newInstance();
         SomeValue value2 = builder.newInstance();
         builder.prototypeFor( SomeInternalState.class ).name().set( "Niclas2" );
         SomeValue value3 = builder.newInstance();
-        assertEquals( value1, value2 );
-        assertFalse( value1.equals( value3 ) );
+        assertThat( value1, equalTo( value2 ) );
+        assertThat( value1.equals( value3 ), is( false ) );
     }
 
     @Test
@@ -63,7 +64,7 @@ public class ValueCompositeBasicsTest
         ValueBuilder<SomeValue> builder = valueBuilderFactory.newValueBuilder( SomeValue.class );
         builder.prototypeFor( SomeInternalState.class ).name().set( "Niclas" );
         SomeValue underTest = builder.newInstance();
-        assertEquals( "{\"name\":\"Niclas\"}", underTest.toString() );
+        assertThat( underTest.toString(), equalTo( "{\"name\":\"Niclas\"}" ) );
     }
 
     @Test
@@ -72,7 +73,7 @@ public class ValueCompositeBasicsTest
         ValueBuilder<SomeValue> builder = valueBuilderFactory.newValueBuilder( SomeValue.class );
         builder.prototypeFor( SomeInternalState.class ).name().set( "Niclas" );
         SomeValue underTest = builder.newInstance();
-        assertEquals( "{\"name\":\"Niclas\"}", underTest.toString() );
+        assertThat( underTest.toString(), equalTo( "{\"name\":\"Niclas\"}" ) );
     }
 
     public abstract static class SomeMixin

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueEqualityTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueEqualityTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueEqualityTest.java
index fa57b28..e5869f6 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueEqualityTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueEqualityTest.java
@@ -19,7 +19,6 @@
  */
 package org.apache.polygene.runtime.value;
 
-import org.junit.Test;
 import org.apache.polygene.api.association.AssociationStateHolder;
 import org.apache.polygene.api.value.ValueComposite;
 import org.apache.polygene.api.value.ValueDescriptor;
@@ -30,16 +29,17 @@ import org.apache.polygene.runtime.property.PropertyEqualityTest.Other;
 import org.apache.polygene.runtime.property.PropertyEqualityTest.PrimitivesValue;
 import org.apache.polygene.runtime.property.PropertyEqualityTest.Some;
 import org.apache.polygene.test.AbstractPolygeneTest;
+import org.junit.jupiter.api.Test;
 
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.not;
-import static org.junit.Assert.assertThat;
 import static org.apache.polygene.runtime.property.PropertyEqualityTest.buildAnotherSomeValue;
 import static org.apache.polygene.runtime.property.PropertyEqualityTest.buildAnotherSomeValueWithDifferentState;
 import static org.apache.polygene.runtime.property.PropertyEqualityTest.buildOtherValue;
 import static org.apache.polygene.runtime.property.PropertyEqualityTest.buildPrimitivesValue;
 import static org.apache.polygene.runtime.property.PropertyEqualityTest.buildSomeValue;
 import static org.apache.polygene.runtime.property.PropertyEqualityTest.buildSomeValueWithDifferentState;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.MatcherAssert.assertThat;
 
 /**
  * Assert that Value equals/hashcode methods combine ValueDescriptor and ValueState.

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueInjectionDeserializationTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueInjectionDeserializationTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueInjectionDeserializationTest.java
index 3a77b79..43ea956 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueInjectionDeserializationTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueInjectionDeserializationTest.java
@@ -20,11 +20,9 @@
 
 package org.apache.polygene.runtime.value;
 
-import org.apache.polygene.api.identity.Identity;
-import org.junit.Assert;
-import org.junit.Test;
 import org.apache.polygene.api.entity.EntityBuilder;
 import org.apache.polygene.api.entity.EntityComposite;
+import org.apache.polygene.api.identity.Identity;
 import org.apache.polygene.api.injection.scope.Service;
 import org.apache.polygene.api.injection.scope.Structure;
 import org.apache.polygene.api.mixin.Mixins;
@@ -38,6 +36,11 @@ import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.hamcrest.core.IsNull.notNullValue;
 
 public class ValueInjectionDeserializationTest
     extends AbstractPolygeneTest
@@ -73,9 +76,9 @@ public class ValueInjectionDeserializationTest
             uow = unitOfWorkFactory.newUnitOfWork();
             Niclas niclas2 = uow.get( Niclas.class, id );
             Some someValue = niclas2.value().get();
-            Assert.assertEquals( someValue.data().get(), "Niclas" );
-            Assert.assertNotNull( someValue.module() );
-            Assert.assertNotNull( someValue.service() );
+            assertThat( someValue.data().get(), equalTo( "Niclas" ) );
+            assertThat( someValue.module(), notNullValue() );
+            assertThat( someValue.service(), notNullValue() );
         }
         finally
         {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueSerializationRegressionTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueSerializationRegressionTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueSerializationRegressionTest.java
index 2bb600a..e7c37f6 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueSerializationRegressionTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueSerializationRegressionTest.java
@@ -31,7 +31,7 @@ import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.entitystore.memory.MemoryEntityStoreService;
 import org.apache.polygene.test.AbstractPolygeneTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class ValueSerializationRegressionTest extends AbstractPolygeneTest
 {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueVisibilityTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueVisibilityTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueVisibilityTest.java
index 35052b4..bbaf426 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueVisibilityTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueVisibilityTest.java
@@ -41,9 +41,11 @@ import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.Energy4Java;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.EntityTestAssembler;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 public class ValueVisibilityTest
 {
@@ -54,7 +56,7 @@ public class ValueVisibilityTest
     private Application app;
     private UnitOfWorkFactory uowf;
 
-    @Before
+    @BeforeEach
     public void setup()
         throws Exception
     {
@@ -89,7 +91,7 @@ public class ValueVisibilityTest
         uowf = module.unitOfWorkFactory();
     }
 
-    @After
+    @AfterEach
     public void tearDown()
         throws Exception
     {
@@ -131,11 +133,13 @@ public class ValueVisibilityTest
         service.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromServiceWhenAccessingBesideModuleVisibleExpectException()
     {
-        FromService service = module.findService( FromService.class ).get();
-        service.besideModuleVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromService service = module.findService( FromService.class ).get();
+            service.besideModuleVisible();
+        } );
     }
 
     @Test
@@ -145,39 +149,49 @@ public class ValueVisibilityTest
         service.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromServiceWhenAccessingBelowLayerVisibleExpectException()
     {
-        FromService service = module.findService( FromService.class ).get();
-        service.belowLayerVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromService service = module.findService( FromService.class ).get();
+            service.belowLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromServiceWhenAccessingBelowModuleVisibleExpectException()
     {
-        FromService service = module.findService( FromService.class ).get();
-        service.belowModuleVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromService service = module.findService( FromService.class ).get();
+            service.belowModuleVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromServiceWhenAccessingAboveApplicationVisibleExpectException()
     {
-        FromService service = module.findService( FromService.class ).get();
-        service.aboveApplicationVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromService service = module.findService( FromService.class ).get();
+            service.aboveApplicationVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromServiceWhenAccessingAboveLayerVisibleExpectException()
     {
-        FromService service = module.findService( FromService.class ).get();
-        service.aboveLayerVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromService service = module.findService( FromService.class ).get();
+            service.aboveLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromServiceWhenAccessingAboveModuleVisibleExpectException()
     {
-        FromService service = module.findService( FromService.class ).get();
-        service.aboveModuleVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromService service = module.findService( FromService.class ).get();
+            service.aboveModuleVisible();
+        } );
     }
 
     @Test
@@ -270,22 +284,24 @@ public class ValueVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromEntityWhenAccessingBesideModuleVisibleExpectException()
     {
-        UnitOfWork unitOfWork = uowf.newUnitOfWork();
-        try
-        {
-            FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTIY);
-            entity.besideModuleVisible();
-        }
-        finally
-        {
-            if( unitOfWork.isOpen() )
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            UnitOfWork unitOfWork = uowf.newUnitOfWork();
+            try
             {
-                unitOfWork.discard();
+                FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTIY );
+                entity.besideModuleVisible();
             }
-        }
+            finally
+            {
+                if( unitOfWork.isOpen() )
+                {
+                    unitOfWork.discard();
+                }
+            }
+        } );
     }
 
     @Test
@@ -306,94 +322,104 @@ public class ValueVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromEntityWhenAccessingBelowLayerVisibleExpectException()
     {
-        UnitOfWork unitOfWork = uowf.newUnitOfWork();
-        try
-        {
-            FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTIY);
-            entity.belowLayerVisible();
-        }
-        finally
-        {
-            if( unitOfWork.isOpen() )
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            UnitOfWork unitOfWork = uowf.newUnitOfWork();
+            try
             {
-                unitOfWork.discard();
+                FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTIY );
+                entity.belowLayerVisible();
             }
-        }
+            finally
+            {
+                if( unitOfWork.isOpen() )
+                {
+                    unitOfWork.discard();
+                }
+            }
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromEntityWhenAccessingBelowModuleVisibleExpectException()
     {
-        UnitOfWork unitOfWork = uowf.newUnitOfWork();
-        try
-        {
-            FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTIY);
-            entity.belowModuleVisible();
-        }
-        finally
-        {
-            if( unitOfWork.isOpen() )
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            UnitOfWork unitOfWork = uowf.newUnitOfWork();
+            try
             {
-                unitOfWork.discard();
+                FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTIY );
+                entity.belowModuleVisible();
             }
-        }
+            finally
+            {
+                if( unitOfWork.isOpen() )
+                {
+                    unitOfWork.discard();
+                }
+            }
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromEntityWhenAccessingAboveApplicationVisibleExpectException()
     {
-        UnitOfWork unitOfWork = uowf.newUnitOfWork();
-        try
-        {
-            FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTIY);
-            entity.aboveApplicationVisible();
-        }
-        finally
-        {
-            if( unitOfWork.isOpen() )
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            UnitOfWork unitOfWork = uowf.newUnitOfWork();
+            try
             {
-                unitOfWork.discard();
+                FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTIY );
+                entity.aboveApplicationVisible();
             }
-        }
+            finally
+            {
+                if( unitOfWork.isOpen() )
+                {
+                    unitOfWork.discard();
+                }
+            }
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromEntityWhenAccessingAboveLayerVisibleExpectException()
     {
-        UnitOfWork unitOfWork = uowf.newUnitOfWork();
-        try
-        {
-            FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTIY);
-            entity.aboveLayerVisible();
-        }
-        finally
-        {
-            if( unitOfWork.isOpen() )
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            UnitOfWork unitOfWork = uowf.newUnitOfWork();
+            try
             {
-                unitOfWork.discard();
+                FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTIY );
+                entity.aboveLayerVisible();
             }
-        }
+            finally
+            {
+                if( unitOfWork.isOpen() )
+                {
+                    unitOfWork.discard();
+                }
+            }
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromEntityWhenAccessingAboveModuleVisibleExpectException()
     {
-        UnitOfWork unitOfWork = uowf.newUnitOfWork();
-        try
-        {
-            FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTIY);
-            entity.aboveModuleVisible();
-        }
-        finally
-        {
-            if( unitOfWork.isOpen() )
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            UnitOfWork unitOfWork = uowf.newUnitOfWork();
+            try
             {
-                unitOfWork.discard();
+                FromEntity entity = unitOfWork.newEntity( FromEntity.class, TEST_IDENTIY );
+                entity.aboveModuleVisible();
             }
-        }
+            finally
+            {
+                if( unitOfWork.isOpen() )
+                {
+                    unitOfWork.discard();
+                }
+            }
+        } );
     }
 
     @Test
@@ -431,11 +457,13 @@ public class ValueVisibilityTest
         value.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromValueWhenAccessingBesideModuleVisibleExpectException()
     {
-        FromValue value = module.newValue( FromValue.class );
-        value.besideModuleVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromValue value = module.newValue( FromValue.class );
+            value.besideModuleVisible();
+        } );
     }
 
     @Test
@@ -445,39 +473,49 @@ public class ValueVisibilityTest
         value.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromValueWhenAccessingBelowLayerVisibleExpectException()
     {
-        FromValue value = module.newValue( FromValue.class );
-        value.belowLayerVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromValue value = module.newValue( FromValue.class );
+            value.belowLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromValueWhenAccessingBelowModuleVisibleExpectException()
     {
-        FromValue value = module.newValue( FromValue.class );
-        value.belowModuleVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromValue value = module.newValue( FromValue.class );
+            value.belowModuleVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromValueWhenAccessingAboveApplicationVisibleExpectException()
     {
-        FromValue value = module.newValue( FromValue.class );
-        value.aboveApplicationVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromValue value = module.newValue( FromValue.class );
+            value.aboveApplicationVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromValueWhenAccessingAboveLayerVisibleExpectException()
     {
-        FromValue value = module.newValue( FromValue.class );
-        value.aboveLayerVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromValue value = module.newValue( FromValue.class );
+            value.aboveLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromValueWhenAccessingAboveModuleVisibleExpectException()
     {
-        FromValue value = module.newValue( FromValue.class );
-        value.aboveModuleVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromValue value = module.newValue( FromValue.class );
+            value.aboveModuleVisible();
+        } );
     }
 
     @Test
@@ -515,11 +553,13 @@ public class ValueVisibilityTest
         transientt.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromTransientWhenAccessingBesideModuleVisibleExpectException()
     {
-        FromTransient transientt = module.newTransient( FromTransient.class );
-        transientt.besideModuleVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromTransient transientt = module.newTransient( FromTransient.class );
+            transientt.besideModuleVisible();
+        } );
     }
 
     @Test
@@ -529,39 +569,49 @@ public class ValueVisibilityTest
         transientt.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromTransientWhenAccessingBelowLayerVisibleExpectException()
     {
-        FromTransient transientt = module.newTransient( FromTransient.class );
-        transientt.belowLayerVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromTransient transientt = module.newTransient( FromTransient.class );
+            transientt.belowLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromTransientWhenAccessingBelowModuleVisibleExpectException()
     {
-        FromTransient transientt = module.newTransient( FromTransient.class );
-        transientt.belowModuleVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromTransient transientt = module.newTransient( FromTransient.class );
+            transientt.belowModuleVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromTransientWhenAccessingAboveApplicationVisibleExpectException()
     {
-        FromTransient transientt = module.newTransient( FromTransient.class );
-        transientt.aboveApplicationVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromTransient transientt = module.newTransient( FromTransient.class );
+            transientt.aboveApplicationVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromTransientWhenAccessingAboveLayerVisibleExpectException()
     {
-        FromTransient transientt = module.newTransient( FromTransient.class );
-        transientt.aboveLayerVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromTransient transientt = module.newTransient( FromTransient.class );
+            transientt.aboveLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromTransientWhenAccessingAboveModuleVisibleExpectException()
     {
-        FromTransient transientt = module.newTransient( FromTransient.class );
-        transientt.aboveModuleVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromTransient transientt = module.newTransient( FromTransient.class );
+            transientt.aboveModuleVisible();
+        } );
     }
 
     @Test
@@ -599,11 +649,13 @@ public class ValueVisibilityTest
         object.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromObjectWhenAccessingBesideModuleVisibleExpectException()
     {
-        FromObject object = module.newObject( FromObject.class );
-        object.besideModuleVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromObject object = module.newObject( FromObject.class );
+            object.besideModuleVisible();
+        } );
     }
 
     @Test
@@ -613,39 +665,49 @@ public class ValueVisibilityTest
         object.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromObjectWhenAccessingBelowLayerVisibleExpectException()
     {
-        FromObject object = module.newObject( FromObject.class );
-        object.belowLayerVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromObject object = module.newObject( FromObject.class );
+            object.belowLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromObjectWhenAccessingBelowModuleVisibleExpectException()
     {
-        FromObject object = module.newObject( FromObject.class );
-        object.belowModuleVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromObject object = module.newObject( FromObject.class );
+            object.belowModuleVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromObjectWhenAccessingAboveApplicationVisibleExpectException()
     {
-        FromObject object = module.newObject( FromObject.class );
-        object.aboveApplicationVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromObject object = module.newObject( FromObject.class );
+            object.aboveApplicationVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromObjectWhenAccessingAboveLayerVisibleExpectException()
     {
-        FromObject object = module.newObject( FromObject.class );
-        object.aboveLayerVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromObject object = module.newObject( FromObject.class );
+            object.aboveLayerVisible();
+        } );
     }
 
-    @Test( expected = NoSuchValueTypeException.class )
+    @Test
     public void givenFromObjectWhenAccessingAboveModuleVisibleExpectException()
     {
-        FromObject object = module.newObject( FromObject.class );
-        object.aboveModuleVisible();
+        assertThrows( NoSuchValueTypeException.class, () -> {
+            FromObject object = module.newObject( FromObject.class );
+            object.aboveModuleVisible();
+        } );
     }
 
     private static class FromAssembler

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueWithAssociationTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueWithAssociationTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueWithAssociationTest.java
index c53a1a5..e23f072 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueWithAssociationTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueWithAssociationTest.java
@@ -38,10 +38,10 @@ import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
+import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertThat;
 
 public class ValueWithAssociationTest extends AbstractPolygeneTest
 {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/runtime/visibility/VisibilityInUnitOfWorkTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/visibility/VisibilityInUnitOfWorkTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/visibility/VisibilityInUnitOfWorkTest.java
index 239e7fe..59d6c3e 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/visibility/VisibilityInUnitOfWorkTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/visibility/VisibilityInUnitOfWorkTest.java
@@ -36,7 +36,7 @@ import org.apache.polygene.bootstrap.Energy4Java;
 import org.apache.polygene.bootstrap.LayerAssembly;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.EntityTestAssembler;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class VisibilityInUnitOfWorkTest
 {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/InstanceImporterTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/InstanceImporterTest.java b/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/InstanceImporterTest.java
index 538d365..ed5dc05 100644
--- a/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/InstanceImporterTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/InstanceImporterTest.java
@@ -20,15 +20,15 @@
 
 package org.apache.polygene.spi.service.importer;
 
-import org.junit.Test;
 import org.apache.polygene.api.common.Visibility;
 import org.apache.polygene.api.injection.scope.Service;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
+import org.junit.jupiter.api.Test;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
 
 /**
  * Test import of singleton services

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/NewObjectImporterTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/NewObjectImporterTest.java b/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/NewObjectImporterTest.java
index c863dc2..1b2b2be 100644
--- a/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/NewObjectImporterTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/NewObjectImporterTest.java
@@ -20,14 +20,15 @@
 
 package org.apache.polygene.spi.service.importer;
 
-import org.apache.polygene.test.AbstractPolygeneTest;
-import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
-import org.junit.Test;
 import org.apache.polygene.api.injection.scope.Service;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ImportedServiceDeclaration;
 import org.apache.polygene.bootstrap.ModuleAssembly;
+import org.apache.polygene.test.AbstractPolygeneTest;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsEqual.equalTo;
 
 /**
  * JAVADOC
@@ -51,7 +52,7 @@ public class NewObjectImporterTest
     @Test
     public void testImportServiceFromService()
     {
-        Assert.assertThat( service.helloWorld(), CoreMatchers.equalTo( "Hello World" ) );
+        assertThat( service.helloWorld(), equalTo( "Hello World" ) );
     }
 
     public static class TestService

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/ServiceInstanceImporterTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/ServiceInstanceImporterTest.java b/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/ServiceInstanceImporterTest.java
index b5f79a7..f0f8305 100644
--- a/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/ServiceInstanceImporterTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/ServiceInstanceImporterTest.java
@@ -31,9 +31,10 @@ import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ImportedServiceDeclaration;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
-import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsEqual.equalTo;
 
 /**
  * JAVADOC
@@ -59,7 +60,7 @@ public class ServiceInstanceImporterTest
     @Test
     public void testImportServiceFromService()
     {
-        Assert.assertThat( service.helloWorld(), CoreMatchers.equalTo( "Hello World" ) );
+        assertThat( service.helloWorld(), equalTo( "Hello World" ) );
     }
 
     public static class TestService

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/ServiceSelectorImporterTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/ServiceSelectorImporterTest.java b/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/ServiceSelectorImporterTest.java
index 334acd1..57d461c 100644
--- a/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/ServiceSelectorImporterTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/ServiceSelectorImporterTest.java
@@ -20,7 +20,6 @@
 
 package org.apache.polygene.spi.service.importer;
 
-import org.junit.Test;
 import org.apache.polygene.api.activation.ActivationException;
 import org.apache.polygene.api.common.Visibility;
 import org.apache.polygene.api.injection.scope.Service;
@@ -30,10 +29,11 @@ import org.apache.polygene.api.service.qualifier.ServiceQualifier;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.bootstrap.SingletonAssembler;
+import org.junit.jupiter.api.Test;
 
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.junit.Assert.assertThat;
 import static org.apache.polygene.bootstrap.ImportedServiceDeclaration.SERVICE_SELECTOR;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
 
 /**
  * Test of service selector importer

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/test/ASMTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/test/ASMTest.java b/core/runtime/src/test/java/org/apache/polygene/test/ASMTest.java
index 5179e8f..1fec75e 100644
--- a/core/runtime/src/test/java/org/apache/polygene/test/ASMTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/test/ASMTest.java
@@ -24,9 +24,11 @@ import java.io.PrintWriter;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.List;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.apache.polygene.api.composite.CompositeInvoker;
+import org.apache.polygene.runtime.composite.FragmentClassLoader;
+import org.apache.polygene.runtime.composite.QI256Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 import org.objectweb.asm.AnnotationVisitor;
 import org.objectweb.asm.ClassReader;
 import org.objectweb.asm.ClassWriter;
@@ -37,11 +39,46 @@ import org.objectweb.asm.Opcodes;
 import org.objectweb.asm.Type;
 import org.objectweb.asm.util.ASMifier;
 import org.objectweb.asm.util.TraceClassVisitor;
-import org.apache.polygene.api.composite.CompositeInvoker;
-import org.apache.polygene.runtime.composite.FragmentClassLoader;
-import org.apache.polygene.runtime.composite.QI256Test;
 
-import static org.objectweb.asm.Opcodes.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.objectweb.asm.Opcodes.AASTORE;
+import static org.objectweb.asm.Opcodes.ACC_PRIVATE;
+import static org.objectweb.asm.Opcodes.ACC_PUBLIC;
+import static org.objectweb.asm.Opcodes.ACC_STATIC;
+import static org.objectweb.asm.Opcodes.ACC_SUPER;
+import static org.objectweb.asm.Opcodes.ACONST_NULL;
+import static org.objectweb.asm.Opcodes.ALOAD;
+import static org.objectweb.asm.Opcodes.ANEWARRAY;
+import static org.objectweb.asm.Opcodes.ARETURN;
+import static org.objectweb.asm.Opcodes.ASTORE;
+import static org.objectweb.asm.Opcodes.ATHROW;
+import static org.objectweb.asm.Opcodes.BIPUSH;
+import static org.objectweb.asm.Opcodes.CHECKCAST;
+import static org.objectweb.asm.Opcodes.DLOAD;
+import static org.objectweb.asm.Opcodes.DUP;
+import static org.objectweb.asm.Opcodes.FLOAD;
+import static org.objectweb.asm.Opcodes.GETFIELD;
+import static org.objectweb.asm.Opcodes.GETSTATIC;
+import static org.objectweb.asm.Opcodes.GOTO;
+import static org.objectweb.asm.Opcodes.ICONST_0;
+import static org.objectweb.asm.Opcodes.ICONST_1;
+import static org.objectweb.asm.Opcodes.ICONST_2;
+import static org.objectweb.asm.Opcodes.ICONST_3;
+import static org.objectweb.asm.Opcodes.ICONST_4;
+import static org.objectweb.asm.Opcodes.ICONST_5;
+import static org.objectweb.asm.Opcodes.ILOAD;
+import static org.objectweb.asm.Opcodes.INVOKEINTERFACE;
+import static org.objectweb.asm.Opcodes.INVOKESPECIAL;
+import static org.objectweb.asm.Opcodes.INVOKESTATIC;
+import static org.objectweb.asm.Opcodes.INVOKEVIRTUAL;
+import static org.objectweb.asm.Opcodes.IRETURN;
+import static org.objectweb.asm.Opcodes.LLOAD;
+import static org.objectweb.asm.Opcodes.NEW;
+import static org.objectweb.asm.Opcodes.POP;
+import static org.objectweb.asm.Opcodes.PUTSTATIC;
+import static org.objectweb.asm.Opcodes.RETURN;
+import static org.objectweb.asm.Opcodes.V1_6;
 
 public class ASMTest
 {
@@ -149,7 +186,7 @@ public class ASMTest
     }
 
     @Test
-    @Ignore( "Convenience to look at what code is generated in the Fragment Classloader, and is not really a test case." )
+    @Disabled( "Convenience to look at what code is generated in the Fragment Classloader, and is not really a test case." )
     public void fragmentClassLoaderGenerateClassTest()
         throws Exception
     {
@@ -161,7 +198,7 @@ public class ASMTest
 
         new ClassReader( cl ).accept( new TraceClassVisitor( new PrintWriter( System.out, true ) ), 0 );
 
-        Assert.assertArrayEquals( asm, cl );
+        assertThat( cl, equalTo( asm ) );
     }
 
     // This is the code generated from the manual stub

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/runtime/src/test/java/org/apache/polygene/test/composite/CleanStackTraceTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/test/composite/CleanStackTraceTest.java b/core/runtime/src/test/java/org/apache/polygene/test/composite/CleanStackTraceTest.java
index d6c1a19..a880771 100644
--- a/core/runtime/src/test/java/org/apache/polygene/test/composite/CleanStackTraceTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/test/composite/CleanStackTraceTest.java
@@ -29,13 +29,13 @@ import org.apache.polygene.api.concern.GenericConcern;
 import org.apache.polygene.api.mixin.Mixins;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsEqual.equalTo;
 import static org.hamcrest.core.IsNull.notNullValue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assume.assumeTrue;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
 
 /**
  * Test if the stacktrace is cleaned up properly.
@@ -45,7 +45,7 @@ import static org.junit.Assume.assumeTrue;
  */
 public class CleanStackTraceTest extends AbstractPolygeneTest
 {
-    @BeforeClass
+    @BeforeAll
     public static void beforeClass_IBMJDK()
     {
         assumeTrue( !( System.getProperty( "java.vendor" ).contains( "IBM" ) ) );
@@ -99,7 +99,7 @@ public class CleanStackTraceTest extends AbstractPolygeneTest
 
         String actual = actualTrace.toString();
         actual = actual.substring( 0, correctTrace.length() );
-        assertEquals( correctTrace, actual );
+        assertThat( actual, equalTo( correctTrace ) );
     }
 
     @Concerns( NillyWilly.class )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/spi/src/test/java/org/apache/polygene/spi/entitystore/Polygene142Test.java
----------------------------------------------------------------------
diff --git a/core/spi/src/test/java/org/apache/polygene/spi/entitystore/Polygene142Test.java b/core/spi/src/test/java/org/apache/polygene/spi/entitystore/Polygene142Test.java
index b8af6ca..f2a8981 100644
--- a/core/spi/src/test/java/org/apache/polygene/spi/entitystore/Polygene142Test.java
+++ b/core/spi/src/test/java/org/apache/polygene/spi/entitystore/Polygene142Test.java
@@ -30,7 +30,7 @@ import org.apache.polygene.api.value.ValueBuilder;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class Polygene142Test extends AbstractPolygeneTest
 {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/spi/src/test/java/org/apache/polygene/spi/entitystore/helpers/JSONManyAssociationStateTest.java
----------------------------------------------------------------------
diff --git a/core/spi/src/test/java/org/apache/polygene/spi/entitystore/helpers/JSONManyAssociationStateTest.java b/core/spi/src/test/java/org/apache/polygene/spi/entitystore/helpers/JSONManyAssociationStateTest.java
index d901c6b..a7735a9 100644
--- a/core/spi/src/test/java/org/apache/polygene/spi/entitystore/helpers/JSONManyAssociationStateTest.java
+++ b/core/spi/src/test/java/org/apache/polygene/spi/entitystore/helpers/JSONManyAssociationStateTest.java
@@ -32,12 +32,11 @@ import org.apache.polygene.serialization.javaxjson.JavaxJsonFactories;
 import org.apache.polygene.spi.entity.EntityStatus;
 import org.apache.polygene.spi.serialization.JsonSerialization;
 import org.apache.polygene.test.AbstractPolygeneTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
 
 public class JSONManyAssociationStateTest extends AbstractPolygeneTest
 {
@@ -143,9 +142,6 @@ public class JSONManyAssociationStateTest extends AbstractPolygeneTest
             refList.add( ref.identity().toString() );
         }
         assertThat( refList.isEmpty(), is( false ) );
-        assertArrayEquals( new String[]
-                               {
-                                   "C", "B", "A", "0", "2", "1"
-                               }, refList.toArray() );
+        assertThat( refList.toArray(), equalTo( new String[]{ "C", "B", "A", "0", "2", "1" } ) );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/spi/src/test/java/org/apache/polygene/spi/entitystore/helpers/JsonNamedAssociationStateTest.java
----------------------------------------------------------------------
diff --git a/core/spi/src/test/java/org/apache/polygene/spi/entitystore/helpers/JsonNamedAssociationStateTest.java b/core/spi/src/test/java/org/apache/polygene/spi/entitystore/helpers/JsonNamedAssociationStateTest.java
index 5b55d1d..f771bb6 100644
--- a/core/spi/src/test/java/org/apache/polygene/spi/entitystore/helpers/JsonNamedAssociationStateTest.java
+++ b/core/spi/src/test/java/org/apache/polygene/spi/entitystore/helpers/JsonNamedAssociationStateTest.java
@@ -32,12 +32,12 @@ import org.apache.polygene.serialization.javaxjson.JavaxJsonFactories;
 import org.apache.polygene.spi.entity.EntityStatus;
 import org.apache.polygene.spi.serialization.JsonSerialization;
 import org.apache.polygene.test.AbstractPolygeneTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.hasItems;
 import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
 
 public class JsonNamedAssociationStateTest extends AbstractPolygeneTest
 {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/spi/src/test/java/org/apache/polygene/spi/metrics/DefaultMetricsTest.java
----------------------------------------------------------------------
diff --git a/core/spi/src/test/java/org/apache/polygene/spi/metrics/DefaultMetricsTest.java b/core/spi/src/test/java/org/apache/polygene/spi/metrics/DefaultMetricsTest.java
index acbb40d..3e4aad9 100644
--- a/core/spi/src/test/java/org/apache/polygene/spi/metrics/DefaultMetricsTest.java
+++ b/core/spi/src/test/java/org/apache/polygene/spi/metrics/DefaultMetricsTest.java
@@ -21,8 +21,6 @@
 package org.apache.polygene.spi.metrics;
 
 import java.time.Instant;
-import org.apache.polygene.api.time.SystemTime;
-import org.junit.Test;
 import org.apache.polygene.api.metrics.MetricsCounter;
 import org.apache.polygene.api.metrics.MetricsCounterFactory;
 import org.apache.polygene.api.metrics.MetricsGauge;
@@ -36,8 +34,11 @@ import org.apache.polygene.api.metrics.MetricsMeterFactory;
 import org.apache.polygene.api.metrics.MetricsProvider;
 import org.apache.polygene.api.metrics.MetricsTimer;
 import org.apache.polygene.api.metrics.MetricsTimerFactory;
+import org.apache.polygene.api.time.SystemTime;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsNull.nullValue;
 
 public class DefaultMetricsTest
 {
@@ -64,7 +65,7 @@ public class DefaultMetricsTest
                 return SystemTime.now();
             }
         } );
-        assertNull( test.value() );
+        assertThat( test.value(), nullValue() );
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/spi/src/test/java/org/apache/polygene/spi/property/DefaultValuesTest.java
----------------------------------------------------------------------
diff --git a/core/spi/src/test/java/org/apache/polygene/spi/property/DefaultValuesTest.java b/core/spi/src/test/java/org/apache/polygene/spi/property/DefaultValuesTest.java
index 5b7fc91..807750c 100644
--- a/core/spi/src/test/java/org/apache/polygene/spi/property/DefaultValuesTest.java
+++ b/core/spi/src/test/java/org/apache/polygene/spi/property/DefaultValuesTest.java
@@ -24,11 +24,11 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
-import org.junit.Test;
 import org.apache.polygene.api.property.DefaultValues;
+import org.junit.jupiter.api.Test;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
 
 /**
  * Test for DefaultValues

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneBaseTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneBaseTest.java b/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneBaseTest.java
index 177edb3..91fbda9 100644
--- a/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneBaseTest.java
+++ b/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneBaseTest.java
@@ -19,10 +19,6 @@
  */
 package org.apache.polygene.test;
 
-import org.apache.polygene.api.activation.PassivationException;
-import org.apache.polygene.test.util.NotYetImplemented;
-import org.junit.After;
-import org.junit.Before;
 import org.apache.polygene.api.PolygeneAPI;
 import org.apache.polygene.api.structure.Application;
 import org.apache.polygene.api.structure.ApplicationDescriptor;
@@ -31,11 +27,12 @@ import org.apache.polygene.bootstrap.ApplicationAssembly;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.Energy4Java;
 import org.apache.polygene.spi.PolygeneSPI;
-import org.junit.Rule;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public abstract class AbstractPolygeneBaseTest
 {
-    @Rule public NotYetImplemented.Rule notYetImplementedRule = new NotYetImplemented.Rule();
+//    @Rule public NotYetImplemented.Rule notYetImplementedRule = new NotYetImplemented.Rule();
 
     protected PolygeneAPI api;
     protected PolygeneSPI spi;
@@ -44,7 +41,7 @@ public abstract class AbstractPolygeneBaseTest
     protected ApplicationDescriptor applicationModel;
     protected Application application;
 
-    @Before
+    @BeforeEach
     public void setUp()
         throws Exception
     {
@@ -118,7 +115,7 @@ public abstract class AbstractPolygeneBaseTest
     {
     }
 
-    @After
+    @AfterEach
     public void tearDown()
     {
         if( application != null )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneScenarioTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneScenarioTest.java b/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneScenarioTest.java
index 4f85962..7d77aee 100644
--- a/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneScenarioTest.java
+++ b/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneScenarioTest.java
@@ -31,8 +31,8 @@ import org.apache.polygene.bootstrap.Assembler;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.Energy4Java;
 import org.apache.polygene.spi.PolygeneSPI;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
 
 /**
  * Base class for Polygene scenario tests. This will create one Polygene application per class instead of per test.
@@ -52,7 +52,7 @@ public abstract class AbstractPolygeneScenarioTest
     static protected Assembler assembler; // Initialize this in static block of subclass
     private static UnitOfWorkFactory uowf;
 
-    @BeforeClass
+    @BeforeAll
     public static void setUp()
         throws Exception
     {
@@ -111,7 +111,7 @@ public abstract class AbstractPolygeneScenarioTest
     {
     }
 
-    @AfterClass
+    @AfterAll
     public void tearDown()
         throws Exception
     {


Mime
View raw message