polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [4/4] zest-java git commit: Added test for ZestAPI.compositeDescriptorFor()
Date Mon, 24 Oct 2016 01:47:34 GMT
Added test for ZestAPI.compositeDescriptorFor()


Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/efdfb03b
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/efdfb03b
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/efdfb03b

Branch: refs/heads/develop
Commit: efdfb03b8d49a9a28fa0f0967a41418bf8c90e26
Parents: 68ecc61
Author: Niclas Hedhman <niclas@hedhman.org>
Authored: Mon Oct 24 09:46:48 2016 +0800
Committer: Niclas Hedhman <niclas@hedhman.org>
Committed: Mon Oct 24 09:46:48 2016 +0800

----------------------------------------------------------------------
 .../structure/CompositeDescriptorTest.java        | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/efdfb03b/core/runtime/src/test/java/org/apache/zest/runtime/structure/CompositeDescriptorTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/structure/CompositeDescriptorTest.java
b/core/runtime/src/test/java/org/apache/zest/runtime/structure/CompositeDescriptorTest.java
index 2c44fda..ec9aa4a 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/structure/CompositeDescriptorTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/structure/CompositeDescriptorTest.java
@@ -19,6 +19,7 @@
  */
 package org.apache.zest.runtime.structure;
 
+import org.apache.zest.api.composite.CompositeDescriptor;
 import org.junit.Test;
 import org.apache.zest.api.composite.TransientComposite;
 import org.apache.zest.api.composite.TransientDescriptor;
@@ -40,6 +41,19 @@ public class CompositeDescriptorTest
     {
         // Test with Standard composite
         AddressComposite address = transientBuilderFactory.newTransient( AddressComposite.class
);
+        CompositeDescriptor addressDescriptor = spi.compositeDescriptorFor( address );
+
+        assertNotNull( addressDescriptor );
+        assertEquals( AddressComposite.class, addressDescriptor.types().findFirst().orElse(
null ) );
+        assertTrue( TransientDescriptor.class.isAssignableFrom( addressDescriptor.getClass()
) );
+    }
+
+    @Test
+    public final void testTransientCompositeDescriptorWithComposite()
+        throws Throwable
+    {
+        // Test with Standard composite
+        AddressComposite address = transientBuilderFactory.newTransient( AddressComposite.class
);
         TransientDescriptor addressDescriptor = spi.transientDescriptorFor( address );
 
         assertNotNull( addressDescriptor );
@@ -63,12 +77,12 @@ public class CompositeDescriptorTest
         aModule.transients( AddressComposite.class );
     }
 
-    private static interface AddressComposite
+    private interface AddressComposite
         extends Address, TransientComposite
     {
     }
 
-    private static interface Address
+    private interface Address
     {
     }
 }
\ No newline at end of file


Mime
View raw message