polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject zest-qi4j git commit: Fix AbstractValueCompositeSerializationTest assembly
Date Sat, 11 Jul 2015 10:51:49 GMT
Repository: zest-qi4j
Updated Branches:
  refs/heads/develop b2a31e054 -> 69e84d920


Fix AbstractValueCompositeSerializationTest assembly

Assemble test EntityStore in a separate module so that it gets a JSON
value serialization always. Now StAX (XML) serialization test can work.


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

Branch: refs/heads/develop
Commit: 69e84d920f8d4e8c7a39b18ebe8796948d7a4289
Parents: b2a31e0
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Sat Jul 11 12:51:35 2015 +0200
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Sat Jul 11 12:51:35 2015 +0200

----------------------------------------------------------------------
 ...AbstractValueCompositeSerializationTest.java | 25 ++++----------------
 1 file changed, 5 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/69e84d92/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
index b3615af..c3ed57a 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
@@ -34,6 +34,7 @@ import org.qi4j.api.association.Association;
 import org.qi4j.api.association.ManyAssociation;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.common.UseDefaults;
+import org.qi4j.api.common.Visibility;
 import org.qi4j.api.entity.EntityBuilder;
 import org.qi4j.api.entity.EntityComposite;
 import org.qi4j.api.entity.EntityReference;
@@ -47,7 +48,6 @@ import org.qi4j.api.value.ValueComposite;
 import org.qi4j.api.value.ValueSerialization;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.bootstrap.ServiceDeclaration;
 import org.qi4j.entitystore.memory.MemoryEntityStoreService;
 import org.qi4j.spi.uuid.UuidIdentityGeneratorService;
 import org.qi4j.test.AbstractQi4jTest;
@@ -60,15 +60,13 @@ import static org.junit.Assert.assertThat;
 /**
  * Assert that ValueSerialization behaviour on ValueComposites is correct.
  */
-// TODO Assert Association and ManyAssociation serialization behaviour!
+// TODO Assert Association, ManyAssociation and NamedAssociation serialization behaviour!
 // TODO Assert Arrays behaviour!
 // TODO Assert Generics behaviour!
 public abstract class AbstractValueCompositeSerializationTest
     extends AbstractQi4jTest
 {
-
     @Rule
-    @SuppressWarnings( "PublicField" )
     public TestName testName = new TestName();
 
     @Override
@@ -77,8 +75,8 @@ public abstract class AbstractValueCompositeSerializationTest
     {
         module.values( SomeValue.class, AnotherValue.class, FooValue.class, CustomFooValue.class,
                        SpecificCollection.class /*, SpecificValue.class, GenericValue.class
*/ );
-        ServiceDeclaration service = module.services( MemoryEntityStoreService.class );
-        module.services( UuidIdentityGeneratorService.class );
+
+        new EntityTestAssembler().visibleIn( Visibility.layer ).assemble( module.layer().module(
"persistence" ) );
         module.entities( BarEntity.class );
     }
 
@@ -87,8 +85,8 @@ public abstract class AbstractValueCompositeSerializationTest
     {
         module.injectTo( this );
     }
+
     @Service
-    @SuppressWarnings( "ProtectedField" )
     protected ValueSerialization valueSerialization;
 
     @Test
@@ -215,14 +213,12 @@ public abstract class AbstractValueCompositeSerializationTest
 
     public enum TestEnum
     {
-
         somevalue, anothervalue
     }
 
     public interface SomeValue
         extends ValueComposite
     {
-
         Property<String> string();
 
         Property<String> string2();
@@ -320,7 +316,6 @@ public abstract class AbstractValueCompositeSerializationTest
     public interface GenericCollection<TYPE>
         extends ValueComposite
     {
-
         @UseDefaults
         Property<List<TYPE>> genericList();
     }
@@ -333,7 +328,6 @@ public abstract class AbstractValueCompositeSerializationTest
     public interface GenericValue<TYPE>
         extends ValueComposite
     {
-
         @Optional
         Property<TYPE> item();
     }
@@ -342,7 +336,6 @@ public abstract class AbstractValueCompositeSerializationTest
     public interface AnotherValue
         extends ValueComposite
     {
-
         @UseDefaults
         Property<String> val1();
 
@@ -351,7 +344,6 @@ public abstract class AbstractValueCompositeSerializationTest
 
     public interface AnotherValueInternalState
     {
-
         @UseDefaults
         Property<String> val2();
     }
@@ -359,7 +351,6 @@ public abstract class AbstractValueCompositeSerializationTest
     public static abstract class AnotherValueMixin
         implements AnotherValue
     {
-
         @This
         private AnotherValueInternalState internalState;
 
@@ -372,7 +363,6 @@ public abstract class AbstractValueCompositeSerializationTest
 
     public interface Foo
     {
-
         @UseDefaults
         Property<String> bar();
     }
@@ -385,14 +375,12 @@ public abstract class AbstractValueCompositeSerializationTest
     public interface CustomFooValue
         extends FooValue
     {
-
         @UseDefaults
         Property<String> custom();
     }
 
     public interface Bar
     {
-
         @UseDefaults
         Property<String> cathedral();
     }
@@ -405,13 +393,11 @@ public abstract class AbstractValueCompositeSerializationTest
     public static class SerializableObject
         implements Serializable
     {
-
         private static final long serialVersionUID = 1L;
         private final String foo = "Foo";
         private final int val = 35;
 
         @Override
-        @SuppressWarnings( "AccessingNonPublicFieldOfAnotherObject" )
         public boolean equals( Object o )
         {
             if( this == o )
@@ -434,5 +420,4 @@ public abstract class AbstractValueCompositeSerializationTest
             return result;
         }
     }
-
 }


Mime
View raw message