Minor documentation fixes POLYGENE-231
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/baba8c09 Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/baba8c09 Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/baba8c09 Branch: refs/heads/develop Commit: baba8c09c8c4c5596889c6ee01d02ee1c2b4ea77 Parents: b7f3035 Author: Paul Merlin <[email protected]> Authored: Mon Mar 13 15:48:29 2017 +0100 Committer: Paul Merlin <[email protected]> Committed: Sun Apr 2 19:16:24 2017 +0200 ---------------------------------------------------------------------- core/api/src/docs/configuration.txt | 7 +- .../apache/polygene/api/common/UseDefaults.java | 2 +- .../api/value/DocumentationSupport.java | 3 +- .../AbstractCollectionSerializationTest.java | 76 ++++++++++---------- .../AbstractPlainValueSerializationTest.java | 2 +- ...AbstractValueCompositeSerializationTest.java | 2 +- 6 files changed, 45 insertions(+), 47 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/polygene-java/blob/baba8c09/core/api/src/docs/configuration.txt ---------------------------------------------------------------------- diff --git a/core/api/src/docs/configuration.txt b/core/api/src/docs/configuration.txt index 2d9281e..9f14b62 100644 --- a/core/api/src/docs/configuration.txt +++ b/core/api/src/docs/configuration.txt @@ -49,11 +49,11 @@ identifiable configuration. That will trigger the reading attempts of the suppor configuration is parsed from the file system it is written to the Entity Store, and if the Entity Store is not ephemeral, then on the next start, any changes to the configuration will NOT be detected, and will simply be ignored. -To be able to read JSON, YAML and XML configuration, you must configure a ValueSerialization system that supports +To be able to read JSON, YAML and XML configuration, you must configure a Serialization system that supports the configuration format that you want to use. -* extension/valueserialization-jackson supports JSON -* extension/valueserialization-stax supports XML +* extension/serialization-javaxjson supports JSON +* extension/serialization-javaxxml supports XML == Support for Complex Types == Since the regular Value Serialization platform is used, for JSON, YAML and XML, the configuration can contain @@ -84,4 +84,3 @@ must be called. Example; source=core/api/src/test/java/org/apache/polygene/api/configuration/MailService.java tag=write -------------- - http://git-wip-us.apache.org/repos/asf/polygene-java/blob/baba8c09/core/api/src/main/java/org/apache/polygene/api/common/UseDefaults.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/apache/polygene/api/common/UseDefaults.java b/core/api/src/main/java/org/apache/polygene/api/common/UseDefaults.java index 8876ae7..bf8f5eb 100644 --- a/core/api/src/main/java/org/apache/polygene/api/common/UseDefaults.java +++ b/core/api/src/main/java/org/apache/polygene/api/common/UseDefaults.java @@ -53,7 +53,7 @@ import java.lang.annotation.Target; * <p> * The <code>@UseDefaults</code> annotation can also have a value in its declaration. This value is used, * unless it is overridden in the assembly (see below). Java does not support generic types of annotation values, - * so it accepts String values, which are deserialized from JSON using the ValueSerialization SPI. This allows + * so it accepts String values, which are deserialized from JSON using the Serialization SPI. This allows * for (albeit somewhat tedious) any object type to have a default value declared on it. If the property type is * String, then no value deserialization is done. * </p> http://git-wip-us.apache.org/repos/asf/polygene-java/blob/baba8c09/core/api/src/test/java/org/apache/polygene/api/value/DocumentationSupport.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/value/DocumentationSupport.java b/core/api/src/test/java/org/apache/polygene/api/value/DocumentationSupport.java index 2f55c83..245cc16 100644 --- a/core/api/src/test/java/org/apache/polygene/api/value/DocumentationSupport.java +++ b/core/api/src/test/java/org/apache/polygene/api/value/DocumentationSupport.java @@ -30,7 +30,6 @@ import org.apache.polygene.api.injection.scope.Service; import org.apache.polygene.api.property.Property; import org.apache.polygene.api.serialization.Deserializer; import org.apache.polygene.api.serialization.Serializer; -import org.apache.polygene.bootstrap.AssemblyException; import org.apache.polygene.bootstrap.ModuleAssembly; import org.apache.polygene.test.AbstractPolygeneTest; import org.junit.Test; @@ -64,7 +63,7 @@ public class DocumentationSupport extends AbstractPolygeneTest @Test // START SNIPPET: default - public void defaultValueSerialization() + public void defaultSerialization() { SomeValue someValue = someNewValueInstance(); // (3) String json = someValue.toString(); // (4) http://git-wip-us.apache.org/repos/asf/polygene-java/blob/baba8c09/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractCollectionSerializationTest.java ---------------------------------------------------------------------- diff --git a/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractCollectionSerializationTest.java b/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractCollectionSerializationTest.java index 474ed1a..a78c3fa 100644 --- a/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractCollectionSerializationTest.java +++ b/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractCollectionSerializationTest.java @@ -51,7 +51,7 @@ import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; /** - * Assert that ValueSerialization behaviour on Collections and Maps is correct. + * Assert that Serialization behaviour on Collections and Maps is correct. */ public class AbstractCollectionSerializationTest extends AbstractPolygeneTest @@ -65,7 +65,7 @@ public class AbstractCollectionSerializationTest @Service @SuppressWarnings( "ProtectedField" ) - protected Serialization stateSerialization; + protected Serialization serialization; @Test public void givenPrimitiveArrayWithIntsWhenSerializingAndDeserializingExpectEquals() @@ -75,9 +75,9 @@ public class AbstractCollectionSerializationTest { 23, 42, -23, -42 }; - String output = stateSerialization.serialize( primitiveArray ); + String output = serialization.serialize( primitiveArray ); System.out.println( output ); - int[] deserialized = stateSerialization.deserialize( module, int[].class, output ); + int[] deserialized = serialization.deserialize( module, int[].class, output ); assertArrayEquals( primitiveArray, deserialized ); } @@ -89,9 +89,9 @@ public class AbstractCollectionSerializationTest { 9, null, -12, -12, 127, -128, 73 }; - String output = stateSerialization.serialize( array ); + String output = serialization.serialize( array ); System.out.println( output ); - Byte[] deserialized = stateSerialization.deserialize( module, Byte[].class, output ); + Byte[] deserialized = serialization.deserialize( module, Byte[].class, output ); assertArrayEquals( array, deserialized ); } @@ -99,10 +99,10 @@ public class AbstractCollectionSerializationTest public void givenIterableTypeWithByteAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception { - String output = stateSerialization.serialize( new AdHocIterable<>( byteCollection() ) ); + String output = serialization.serialize( new AdHocIterable<>( byteCollection() ) ); System.out.println( output ); CollectionType collectionType = CollectionType.listOf( ValueType.BYTE ); - List<Byte> list = stateSerialization.deserialize( module, collectionType, output ); + List<Byte> list = serialization.deserialize( module, collectionType, output ); assertEquals( byteCollection(), list ); } @@ -110,10 +110,10 @@ public class AbstractCollectionSerializationTest public void givenCollectionTypeWithByteAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception { - String output = stateSerialization.serialize( byteCollection() ); + String output = serialization.serialize( byteCollection() ); System.out.println( output ); CollectionType collectionType = CollectionType.setOf( ValueType.BYTE ); - Set<Byte> list = stateSerialization.deserialize( module, collectionType, output ); + Set<Byte> list = serialization.deserialize( module, collectionType, output ); assertEquals( new LinkedHashSet<>( byteCollection() ), list ); } @@ -121,10 +121,10 @@ public class AbstractCollectionSerializationTest public void givenCollectionTypeWithCharacterAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception { - String output = stateSerialization.serialize( characterCollection() ); + String output = serialization.serialize( characterCollection() ); System.out.println( output ); CollectionType collectionType = CollectionType.listOf( ValueType.CHARACTER ); - List<Character> list = stateSerialization.deserialize( module, collectionType, output ); + List<Character> list = serialization.deserialize( module, collectionType, output ); assertEquals( characterCollection(), list ); } @@ -132,10 +132,10 @@ public class AbstractCollectionSerializationTest public void givenCollectionTypeWithShortAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception { - String output = stateSerialization.serialize( shortCollection() ); + String output = serialization.serialize( shortCollection() ); System.out.println( output ); CollectionType collectionType = CollectionType.listOf( ValueType.SHORT ); - List<Short> list = stateSerialization.deserialize( module, collectionType, output ); + List<Short> list = serialization.deserialize( module, collectionType, output ); assertEquals( shortCollection(), list ); } @@ -143,10 +143,10 @@ public class AbstractCollectionSerializationTest public void givenCollectionTypeWithIntegerAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception { - String output = stateSerialization.serialize( integerCollection() ); + String output = serialization.serialize( integerCollection() ); System.out.println( output ); CollectionType collectionType = CollectionType.listOf( ValueType.INTEGER ); - List<Integer> list = stateSerialization.deserialize( module, collectionType, output ); + List<Integer> list = serialization.deserialize( module, collectionType, output ); assertEquals( integerCollection(), list ); } @@ -154,10 +154,10 @@ public class AbstractCollectionSerializationTest public void givenCollectionTypeWithLongAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception { - String output = stateSerialization.serialize( longCollection() ); + String output = serialization.serialize( longCollection() ); System.out.println( output ); CollectionType collectionType = CollectionType.listOf( ValueType.LONG ); - List<Long> list = stateSerialization.deserialize( module, collectionType, output ); + List<Long> list = serialization.deserialize( module, collectionType, output ); assertEquals( longCollection(), list ); } @@ -165,10 +165,10 @@ public class AbstractCollectionSerializationTest public void givenCollectionTypeWithFloatAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception { - String output = stateSerialization.serialize( floatCollection() ); + String output = serialization.serialize( floatCollection() ); System.out.println( output ); CollectionType collectionType = CollectionType.listOf( ValueType.FLOAT ); - List<Float> list = stateSerialization.deserialize( module, collectionType, output ); + List<Float> list = serialization.deserialize( module, collectionType, output ); assertEquals( floatCollection(), list ); } @@ -176,10 +176,10 @@ public class AbstractCollectionSerializationTest public void givenCollectionTypeWithDoubleAndNullElementWhenSerializingExpectCorrectJsonOutput() throws Exception { - String output = stateSerialization.serialize( doubleCollection() ); + String output = serialization.serialize( doubleCollection() ); System.out.println( output ); CollectionType collectionType = CollectionType.listOf( ValueType.DOUBLE ); - List<Double> list = stateSerialization.deserialize( module, collectionType, output ); + List<Double> list = serialization.deserialize( module, collectionType, output ); assertEquals( doubleCollection(), list ); } @@ -187,10 +187,10 @@ public class AbstractCollectionSerializationTest public void givenCollectionTypeWithBigIntegerAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception { - String output = stateSerialization.serialize( bigIntegerCollection() ); + String output = serialization.serialize( bigIntegerCollection() ); System.out.println( output ); CollectionType collectionType = CollectionType.listOf( ValueType.BIG_INTEGER ); - List<BigInteger> list = stateSerialization.deserialize( module, collectionType, output ); + List<BigInteger> list = serialization.deserialize( module, collectionType, output ); assertEquals( bigIntegerCollection(), list ); } @@ -198,10 +198,10 @@ public class AbstractCollectionSerializationTest public void givenCollectionTypeWithBigDecimalAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception { - String output = stateSerialization.serialize( bigDecimalCollection() ); + String output = serialization.serialize( bigDecimalCollection() ); System.out.println( output ); CollectionType collectionType = CollectionType.collectionOf( ValueType.BIG_DECIMAL ); - Collection<BigDecimal> collection = stateSerialization.deserialize( module, collectionType, output ); + Collection<BigDecimal> collection = serialization.deserialize( module, collectionType, output ); assertEquals( bigDecimalCollection(), collection ); } @@ -209,10 +209,10 @@ public class AbstractCollectionSerializationTest public void givenMapOfStringByteAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception { - String output = stateSerialization.serialize( stringByteMap() ); + String output = serialization.serialize( stringByteMap() ); System.out.println( output ); MapType mapType = MapType.of( ValueType.STRING, ValueType.BYTE ); - Map<String, Byte> value = stateSerialization.deserialize( module, mapType, output ); + Map<String, Byte> value = serialization.deserialize( module, mapType, output ); assertEquals( stringByteMap(), value ); } @@ -220,11 +220,11 @@ public class AbstractCollectionSerializationTest public void givenMapOfStringListStringAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception { - String output = stateSerialization.serialize( stringMultiMap() ); + String output = serialization.serialize( stringMultiMap() ); System.out.println( output ); CollectionType collectionType = CollectionType.listOf( ValueType.STRING ); MapType mapType = MapType.of( ValueType.STRING, collectionType ); - Map<String, List<String>> value = stateSerialization.deserialize( module, mapType, output ); + Map<String, List<String>> value = serialization.deserialize( module, mapType, output ); assertEquals( stringMultiMap(), value ); } @@ -232,10 +232,10 @@ public class AbstractCollectionSerializationTest public void givenListOfMapStringStringAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception { - String output = stateSerialization.serialize( stringListOfMaps() ); + String output = serialization.serialize( stringListOfMaps() ); System.out.println( output ); CollectionType collectionType = CollectionType.listOf( MapType.of( ValueType.STRING, ValueType.STRING ) ); - List<Map<String, String>> value = stateSerialization.deserialize( module, collectionType, output ); + List<Map<String, String>> value = serialization.deserialize( module, collectionType, output ); assertEquals( stringListOfMaps(), value ); } @@ -243,11 +243,11 @@ public class AbstractCollectionSerializationTest public void givenListOfValueCompositesAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception { - String output = stateSerialization.serialize( valueCompositesList() ); + String output = serialization.serialize( valueCompositesList() ); System.out.println( output ); ValueCompositeType valueType = module.valueDescriptor( SomeValue.class.getName() ).valueType(); CollectionType collectionType = CollectionType.listOf( valueType ); - List<SomeValue> value = stateSerialization.deserialize( module, collectionType, output ); + List<SomeValue> value = serialization.deserialize( module, collectionType, output ); assertEquals( valueCompositesList(), value ); } @@ -255,10 +255,10 @@ public class AbstractCollectionSerializationTest public void givenEnumSetWhenSerializingAndDeserializingExpectEquals() { Set<SomeEnum> enumSet = EnumSet.allOf( SomeEnum.class ); - String output = stateSerialization.serialize( enumSet ); + String output = serialization.serialize( enumSet ); System.out.println( output ); CollectionType valueType = CollectionType.setOf( EnumType.of( SomeEnum.class ) ); - Set<SomeEnum> value = stateSerialization.deserialize( module, valueType, output ); + Set<SomeEnum> value = serialization.deserialize( module, valueType, output ); assertEquals( enumSet, value ); } @@ -270,10 +270,10 @@ public class AbstractCollectionSerializationTest { enumMap.put( value, 23 ); } - String output = stateSerialization.serialize( enumMap ); + String output = serialization.serialize( enumMap ); System.out.println( output ); MapType valueType = MapType.of( EnumType.of( SomeEnum.class ), ValueType.of( Integer.class ) ); - Map<SomeEnum, Number> value = stateSerialization.deserialize( module, valueType, output ); + Map<SomeEnum, Number> value = serialization.deserialize( module, valueType, output ); assertEquals( enumMap, value ); } http://git-wip-us.apache.org/repos/asf/polygene-java/blob/baba8c09/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractPlainValueSerializationTest.java ---------------------------------------------------------------------- diff --git a/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractPlainValueSerializationTest.java b/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractPlainValueSerializationTest.java index 8822a82..cd4bc37 100644 --- a/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractPlainValueSerializationTest.java +++ b/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractPlainValueSerializationTest.java @@ -50,7 +50,7 @@ import static org.hamcrest.core.IsNot.not; import static org.junit.Assert.assertThat; /** - * Assert that ValueSerialization behaviour on plain values is correct. + * Assert that Serialization behaviour on plain values is correct. * * Implementations must: * <ul> http://git-wip-us.apache.org/repos/asf/polygene-java/blob/baba8c09/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractValueCompositeSerializationTest.java ---------------------------------------------------------------------- diff --git a/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractValueCompositeSerializationTest.java b/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractValueCompositeSerializationTest.java index 2642198..221a788 100644 --- a/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractValueCompositeSerializationTest.java +++ b/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractValueCompositeSerializationTest.java @@ -67,7 +67,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; /** - * Assert that ValueSerialization behaviour on ValueComposites is correct. + * Assert that Serialization behaviour on ValueComposites is correct. */ // TODO Assert Generics behaviour! public abstract class AbstractValueCompositeSerializationTest
