Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4295B200C45 for ; Mon, 13 Mar 2017 11:34:58 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4165E160B8B; Mon, 13 Mar 2017 10:34:58 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4014E160BB7 for ; Mon, 13 Mar 2017 11:34:56 +0100 (CET) Received: (qmail 86359 invoked by uid 500); 13 Mar 2017 10:34:55 -0000 Mailing-List: contact commits-help@polygene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@polygene.apache.org Delivered-To: mailing list commits@polygene.apache.org Received: (qmail 85946 invoked by uid 99); 13 Mar 2017 10:34:55 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Mar 2017 10:34:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1BFA4F2184; Mon, 13 Mar 2017 10:34:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: paulmerlin@apache.org To: commits@polygene.apache.org Date: Mon, 13 Mar 2017 10:35:41 -0000 Message-Id: <2bc2332dd15f420887ea25d20476f51e@git.apache.org> In-Reply-To: <750dbb6da232464ca42236ae6d962acf@git.apache.org> References: <750dbb6da232464ca42236ae6d962acf@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [49/50] [abbrv] polygene-java git commit: POLYGENE-191 Remove dead code, fix TODOs and other minor cleanups archived-at: Mon, 13 Mar 2017 10:34:58 -0000 POLYGENE-191 Remove dead code, fix TODOs and other minor cleanups Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/d7cd08da Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/d7cd08da Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/d7cd08da Branch: refs/heads/serialization-3.0 Commit: d7cd08da21240c9cd8ab65a121502a11d190deac Parents: e3f025e Author: Paul Merlin Authored: Mon Feb 27 15:00:06 2017 +0100 Committer: Paul Merlin Committed: Mon Mar 13 11:24:42 2017 +0100 ---------------------------------------------------------------------- .../polygene/api/serialization/Serializer.java | 1 - .../spi/serialization/JsonSerializer.java | 1 - .../AbstractDateFormatSerializationTest.java | 142 ------------------- ...AbstractValueCompositeSerializationTest.java | 3 + .../entitystore/sql/SQLMapEntityStoreMixin.java | 1 - .../JavaxJsonDateFormatSerializationTest.java | 24 ---- .../javaxxml/JavaxXmlDeserializer.java | 1 - .../javaxxml/JavaxXmlSettings.java | 2 +- .../javaxxml/JavaxXmlDateFormatTest.java | 33 ----- ...JavaxXmlValueCompositeSerializationTest.java | 73 ++++++++++ .../javaxxml/JavaxXmlValueCompositeTest.java | 68 --------- .../msgpack/MessagePackDeserializer.java | 1 - .../MessagePackDateFormatSerializationTest.java | 33 ----- 13 files changed, 77 insertions(+), 306 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d7cd08da/core/api/src/main/java/org/apache/polygene/api/serialization/Serializer.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/apache/polygene/api/serialization/Serializer.java b/core/api/src/main/java/org/apache/polygene/api/serialization/Serializer.java index 9f9f47d..bdbe482 100644 --- a/core/api/src/main/java/org/apache/polygene/api/serialization/Serializer.java +++ b/core/api/src/main/java/org/apache/polygene/api/serialization/Serializer.java @@ -26,7 +26,6 @@ import java.util.function.Function; import java.util.stream.Stream; import org.apache.polygene.api.common.Optional; -// TODO QUID Remove Optional? public interface Serializer { void serialize( Options options, Writer writer, @Optional Object object ); http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d7cd08da/core/spi/src/main/java/org/apache/polygene/spi/serialization/JsonSerializer.java ---------------------------------------------------------------------- diff --git a/core/spi/src/main/java/org/apache/polygene/spi/serialization/JsonSerializer.java b/core/spi/src/main/java/org/apache/polygene/spi/serialization/JsonSerializer.java index b64f240..54dd92b 100644 --- a/core/spi/src/main/java/org/apache/polygene/spi/serialization/JsonSerializer.java +++ b/core/spi/src/main/java/org/apache/polygene/spi/serialization/JsonSerializer.java @@ -86,7 +86,6 @@ public interface JsonSerializer extends Serializer } try { - // TODO FIX ThIS SHIT of "out of structure" value (de)serialization // We want plain Strings to be serialized without quotes which is non JSON compliant // See https://java.net/jira/browse/JSON_PROCESSING_SPEC-65 if( jsonValue.getValueType() == JsonValue.ValueType.STRING ) http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d7cd08da/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractDateFormatSerializationTest.java ---------------------------------------------------------------------- diff --git a/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractDateFormatSerializationTest.java b/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractDateFormatSerializationTest.java deleted file mode 100644 index 27b5289..0000000 --- a/core/testsupport/src/main/java/org/apache/polygene/test/serialization/AbstractDateFormatSerializationTest.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * - */ -package org.apache.polygene.test.serialization; - -import java.time.Duration; -import java.time.Instant; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.time.OffsetDateTime; -import java.time.Period; -import java.time.ZoneId; -import java.time.ZoneOffset; -import java.time.ZonedDateTime; -import java.util.List; -import org.apache.polygene.api.injection.scope.Service; -import org.apache.polygene.api.serialization.Serialization; -import org.apache.polygene.api.type.CollectionType; -import org.apache.polygene.api.type.ValueType; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.AbstractPolygeneTest; -import org.junit.Test; - -import static org.hamcrest.core.IsEqual.equalTo; -import static org.junit.Assert.assertThat; - -/** - * Assert that a serialization support various date formats. - */ -@SuppressWarnings( "ProtectedField" ) -public class AbstractDateFormatSerializationTest - extends AbstractPolygeneTest -{ - @Override - public void assemble( ModuleAssembly module ) - { - } - - @Service - protected Serialization stateSerialization; - - @Test - public void givenLocalDateTimeFormatWhenConvertingFromSerializedStateExpectValidDate() - throws Exception - { - CollectionType collectionType = CollectionType.listOf( ValueType.LOCAL_DATE_TIME ); - List value = stateSerialization.deserialize( module, collectionType, - "[\"2009-08-12T14:54:27\"]" ); - LocalDateTime expected = LocalDateTime.of( 2009, 8, 12, 14, 54, 27 ); - assertThat( value.get( 0 ), equalTo( expected ) ); - } - - @Test - public void givenLocalDateFormatWhenConvertingFromSerializedStateExpectValidDate() - throws Exception - { - CollectionType collectionType = CollectionType.listOf( ValueType.LOCAL_DATE ); - List value = stateSerialization.deserialize( module, collectionType, "[\"2009-08-12\"]" ); - LocalDate expected = LocalDate.of( 2009, 8, 12 ); - assertThat( value.get( 0 ), equalTo( expected ) ); - } - - @Test - public void givenLocalTimeFormatWhenConvertingFromSerializedStateExpectValidDate() - throws Exception - { - CollectionType collectionType = CollectionType.listOf( ValueType.LOCAL_TIME ); - List value = stateSerialization.deserialize( module, collectionType, "[\"14:54:27\"]" ); - LocalTime expected = LocalTime.of( 14, 54, 27 ); - assertThat( value.get( 0 ), equalTo( expected ) ); - } - - @Test - public void givenOffsetDateTimeFormatWhenConvertingFromSerializedStateExpectValidDate() - throws Exception - { - CollectionType collectionType = CollectionType.listOf( ValueType.OFFSET_DATE_TIME ); - List value = stateSerialization.deserialize( module, collectionType, - "[\"2009-08-12T14:54:27.895+08:00\"]" ); - OffsetDateTime expected = OffsetDateTime.of( 2009, 8, 12, 14, 54, 27, 895000000, ZoneOffset.ofHours( 8 ) ); - assertThat( value.get( 0 ), equalTo( expected ) ); - } - - @Test - public void givenZonedDateTimeFormatWhenConvertingFromSerializedStateExpectValidDate() - throws Exception - { - CollectionType collectionType = CollectionType.listOf( ValueType.ZONED_DATE_TIME ); - List value = stateSerialization.deserialize( module, collectionType, - "[\"2009-08-12T14:54:27.895+02:00[CET]\"]" ); - ZonedDateTime expected = ZonedDateTime.of( 2009, 8, 12, 14, 54, 27, 895000000, ZoneId.of( "CET" ) ); - assertThat( value.get( 0 ), equalTo( expected ) ); - } - - @Test - public void givenInstantFormatWhenConvertingFromSerializedStateExpectValidDate() - throws Exception - { - CollectionType collectionType = CollectionType.listOf( ValueType.INSTANT ); - List value = stateSerialization.deserialize( module, collectionType, - "[\"2016-06-11T08:47:12.620Z\"]" ); - Instant expected = Instant.parse( "2016-06-11T08:47:12.620Z" ); - assertThat( value.get( 0 ), equalTo( expected ) ); - } - - @Test - public void givenDurationFormatWhenConvertingFromSerializedStateExpectValidDate() - throws Exception - { - CollectionType collectionType = CollectionType.listOf( ValueType.DURATION ); - List value = stateSerialization.deserialize( module, collectionType, "[\"PT3.5S\"]" ); - Duration expected = Duration.ofMillis( 3500 ); - assertThat( value.get( 0 ), equalTo( expected ) ); - } - - @Test - public void givenPeriodFormatWhenConvertingFromSerializedStateExpectValidDate() - throws Exception - { - CollectionType collectionType = CollectionType.listOf( ValueType.PERIOD ); - List value = stateSerialization.deserialize( module, collectionType, "[\"P3Y5M13D\"]" ); - Period expected = Period.of( 3, 5, 13 ); - assertThat( value.get( 0 ), equalTo( expected ) ); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d7cd08da/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 121fe21..6c10776 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 @@ -71,6 +71,9 @@ import static org.junit.Assert.assertThat; */ // TODO Assert Arrays behaviour! // TODO Assert Generics behaviour! +// TODO Assert deserialization using a value super type that has less properties/associations (e.g. ignore spurious state) +// TODO Assert deserialization from state missing optional values (e.g. do not fail on missing optional values) +// TODO Assert deserialization from state with different properties/associations order (e.g. do not fail on unordered values) public abstract class AbstractValueCompositeSerializationTest extends AbstractPolygeneTest { http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d7cd08da/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SQLMapEntityStoreMixin.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SQLMapEntityStoreMixin.java b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SQLMapEntityStoreMixin.java index 77a7640..f1a852f 100644 --- a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SQLMapEntityStoreMixin.java +++ b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SQLMapEntityStoreMixin.java @@ -55,7 +55,6 @@ import org.jooq.Table; import org.jooq.conf.Settings; import org.jooq.impl.DSL; -// TODO Remove old SQL ES Code and spurious dependencies public class SQLMapEntityStoreMixin implements ServiceActivation, MapEntityStore { http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d7cd08da/extensions/serialization-javaxjson/src/test/java/org/apache/polygene/serialization/javaxjson/JavaxJsonDateFormatSerializationTest.java ---------------------------------------------------------------------- diff --git a/extensions/serialization-javaxjson/src/test/java/org/apache/polygene/serialization/javaxjson/JavaxJsonDateFormatSerializationTest.java b/extensions/serialization-javaxjson/src/test/java/org/apache/polygene/serialization/javaxjson/JavaxJsonDateFormatSerializationTest.java deleted file mode 100644 index 7c0f510..0000000 --- a/extensions/serialization-javaxjson/src/test/java/org/apache/polygene/serialization/javaxjson/JavaxJsonDateFormatSerializationTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.polygene.serialization.javaxjson; - -import org.apache.polygene.test.serialization.AbstractDateFormatSerializationTest; - -public class JavaxJsonDateFormatSerializationTest extends AbstractDateFormatSerializationTest -{ -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d7cd08da/extensions/serialization-javaxxml/src/main/java/org/apache/polygene/serialization/javaxxml/JavaxXmlDeserializer.java ---------------------------------------------------------------------- diff --git a/extensions/serialization-javaxxml/src/main/java/org/apache/polygene/serialization/javaxxml/JavaxXmlDeserializer.java b/extensions/serialization-javaxxml/src/main/java/org/apache/polygene/serialization/javaxxml/JavaxXmlDeserializer.java index 6488457..d556f09 100644 --- a/extensions/serialization-javaxxml/src/main/java/org/apache/polygene/serialization/javaxxml/JavaxXmlDeserializer.java +++ b/extensions/serialization-javaxxml/src/main/java/org/apache/polygene/serialization/javaxxml/JavaxXmlDeserializer.java @@ -62,7 +62,6 @@ import static java.util.Collections.unmodifiableMap; import static java.util.Collections.unmodifiableSet; import static org.apache.polygene.api.util.Collectors.toMapWithNullValues; -// TODO Support deserialization from formatted XML, whitespaces are a problem ATM public class JavaxXmlDeserializer extends AbstractTextDeserializer implements XmlDeserializer { private static final String NULL_ELEMENT_NAME = "null"; http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d7cd08da/extensions/serialization-javaxxml/src/main/java/org/apache/polygene/serialization/javaxxml/JavaxXmlSettings.java ---------------------------------------------------------------------- diff --git a/extensions/serialization-javaxxml/src/main/java/org/apache/polygene/serialization/javaxxml/JavaxXmlSettings.java b/extensions/serialization-javaxxml/src/main/java/org/apache/polygene/serialization/javaxxml/JavaxXmlSettings.java index b5c5702..775f941 100644 --- a/extensions/serialization-javaxxml/src/main/java/org/apache/polygene/serialization/javaxxml/JavaxXmlSettings.java +++ b/extensions/serialization-javaxxml/src/main/java/org/apache/polygene/serialization/javaxxml/JavaxXmlSettings.java @@ -26,7 +26,7 @@ import org.apache.polygene.api.type.ValueType; * * Must be registered as meta-info at assembly time. */ -// TODO javax.xml properties +// TODO javax.xml properties? public class JavaxXmlSettings { public static final JavaxXmlSettings DEFAULT = new JavaxXmlSettings(); http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d7cd08da/extensions/serialization-javaxxml/src/test/java/org/apache/polygene/serialization/javaxxml/JavaxXmlDateFormatTest.java ---------------------------------------------------------------------- diff --git a/extensions/serialization-javaxxml/src/test/java/org/apache/polygene/serialization/javaxxml/JavaxXmlDateFormatTest.java b/extensions/serialization-javaxxml/src/test/java/org/apache/polygene/serialization/javaxxml/JavaxXmlDateFormatTest.java deleted file mode 100644 index 6f69bbe..0000000 --- a/extensions/serialization-javaxxml/src/test/java/org/apache/polygene/serialization/javaxxml/JavaxXmlDateFormatTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.polygene.serialization.javaxxml; - -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.serialization.AbstractDateFormatSerializationTest; -import org.junit.Ignore; - -@Ignore( "Super test assume JSON" ) -public class JavaxXmlDateFormatTest extends AbstractDateFormatSerializationTest -{ - @Override - public void assemble( ModuleAssembly module ) - { - new JavaxXmlSerializationAssembler().assemble( module ); - super.assemble( module ); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d7cd08da/extensions/serialization-javaxxml/src/test/java/org/apache/polygene/serialization/javaxxml/JavaxXmlValueCompositeSerializationTest.java ---------------------------------------------------------------------- diff --git a/extensions/serialization-javaxxml/src/test/java/org/apache/polygene/serialization/javaxxml/JavaxXmlValueCompositeSerializationTest.java b/extensions/serialization-javaxxml/src/test/java/org/apache/polygene/serialization/javaxxml/JavaxXmlValueCompositeSerializationTest.java new file mode 100644 index 0000000..27bebc2 --- /dev/null +++ b/extensions/serialization-javaxxml/src/test/java/org/apache/polygene/serialization/javaxxml/JavaxXmlValueCompositeSerializationTest.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.polygene.serialization.javaxxml; + +import org.apache.polygene.api.injection.scope.Service; +import org.apache.polygene.api.unitofwork.UnitOfWork; +import org.apache.polygene.bootstrap.ModuleAssembly; +import org.apache.polygene.spi.serialization.XmlSerialization; +import org.apache.polygene.test.serialization.AbstractValueCompositeSerializationTest; +import org.junit.Test; +import org.xmlunit.diff.DefaultNodeMatcher; +import org.xmlunit.diff.ElementSelectors; + +import static org.hamcrest.Matchers.equalTo; +import static org.junit.Assert.assertThat; +import static org.xmlunit.matchers.CompareMatcher.isSimilarTo; + +// TODO Assert deserialization from formatted XML, whitespaces are a problem ATM +public class JavaxXmlValueCompositeSerializationTest extends AbstractValueCompositeSerializationTest +{ + @Override + public void assemble( ModuleAssembly module ) + { + new JavaxXmlSerializationAssembler().assemble( module ); + super.assemble( module ); + } + + // START SNIPPET: xml-serialization + @Service + XmlSerialization xmlSerialization; + // END SNIPPET: xml-serialization + + @Test + public void valueCompositeXmlEquality() + { + // START SNIPPET: xml-serialization + try( UnitOfWork uow = unitOfWorkFactory.newUnitOfWork() ) + { + Some some = buildSomeValue( moduleInstance, uow, "23" ); + + // Serialize using injected service + String stateString = serialization.serialize( some ); + System.out.println( stateString ); + + // Deserialize using Module API + Some some2 = moduleInstance.newValueFromSerializedState( Some.class, stateString ); + + assertThat( "Deserialized Value equality", some, equalTo( some2 ) ); + + // Need to loosely compare because of HashMaps not retaining order + assertThat( "value.toString() XML equality", + stateString, + isSimilarTo( some2.toString() ) + .withNodeMatcher( new DefaultNodeMatcher( ElementSelectors.byNameAndAllAttributes ) ) ); + } + // END SNIPPET: xml-serialization + } +} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d7cd08da/extensions/serialization-javaxxml/src/test/java/org/apache/polygene/serialization/javaxxml/JavaxXmlValueCompositeTest.java ---------------------------------------------------------------------- diff --git a/extensions/serialization-javaxxml/src/test/java/org/apache/polygene/serialization/javaxxml/JavaxXmlValueCompositeTest.java b/extensions/serialization-javaxxml/src/test/java/org/apache/polygene/serialization/javaxxml/JavaxXmlValueCompositeTest.java deleted file mode 100644 index 59d0e3e..0000000 --- a/extensions/serialization-javaxxml/src/test/java/org/apache/polygene/serialization/javaxxml/JavaxXmlValueCompositeTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.polygene.serialization.javaxxml; - -import org.apache.polygene.api.injection.scope.Service; -import org.apache.polygene.api.unitofwork.UnitOfWork; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.spi.serialization.XmlSerialization; -import org.apache.polygene.test.serialization.AbstractValueCompositeSerializationTest; -import org.junit.Test; -import org.xmlunit.diff.DefaultNodeMatcher; -import org.xmlunit.diff.ElementSelectors; - -import static org.hamcrest.Matchers.equalTo; -import static org.junit.Assert.assertThat; -import static org.xmlunit.matchers.CompareMatcher.isSimilarTo; - -public class JavaxXmlValueCompositeTest extends AbstractValueCompositeSerializationTest -{ - @Override - public void assemble( ModuleAssembly module ) - { - new JavaxXmlSerializationAssembler().assemble( module ); - super.assemble( module ); - } - - @Service - XmlSerialization xmlSerialization; - - @Test - public void valueCompositeXmlEquality() - { - try( UnitOfWork uow = unitOfWorkFactory.newUnitOfWork() ) - { - Some some = buildSomeValue( moduleInstance, uow, "23" ); - - // Serialize using injected service - String stateString = serialization.serialize( some ); - System.out.println( stateString ); - - // Deserialize using Module API - Some some2 = moduleInstance.newValueFromSerializedState( Some.class, stateString ); - - assertThat( "Value equality", some, equalTo( some2 ) ); - - // Need to loosely compare because of HashMaps not retaining order - assertThat( "XML equality", - stateString, - isSimilarTo( some2.toString() ) - .withNodeMatcher( new DefaultNodeMatcher( ElementSelectors.byNameAndAllAttributes ) ) ); - } - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d7cd08da/extensions/serialization-msgpack/src/main/java/org/apache/polygene/serialization/msgpack/MessagePackDeserializer.java ---------------------------------------------------------------------- diff --git a/extensions/serialization-msgpack/src/main/java/org/apache/polygene/serialization/msgpack/MessagePackDeserializer.java b/extensions/serialization-msgpack/src/main/java/org/apache/polygene/serialization/msgpack/MessagePackDeserializer.java index 84508a4..caba249 100644 --- a/extensions/serialization-msgpack/src/main/java/org/apache/polygene/serialization/msgpack/MessagePackDeserializer.java +++ b/extensions/serialization-msgpack/src/main/java/org/apache/polygene/serialization/msgpack/MessagePackDeserializer.java @@ -62,7 +62,6 @@ import static java.util.Collections.unmodifiableMap; import static java.util.Collections.unmodifiableSet; import static org.apache.polygene.api.util.Collectors.toMap; -// TODO Test all deserializations for: missing & spurious entries @Mixins( MessagePackDeserializer.Mixin.class ) public interface MessagePackDeserializer extends Deserializer { http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d7cd08da/extensions/serialization-msgpack/src/test/java/org/apache/polygene/serialization/msgpack/MessagePackDateFormatSerializationTest.java ---------------------------------------------------------------------- diff --git a/extensions/serialization-msgpack/src/test/java/org/apache/polygene/serialization/msgpack/MessagePackDateFormatSerializationTest.java b/extensions/serialization-msgpack/src/test/java/org/apache/polygene/serialization/msgpack/MessagePackDateFormatSerializationTest.java deleted file mode 100644 index 083d418..0000000 --- a/extensions/serialization-msgpack/src/test/java/org/apache/polygene/serialization/msgpack/MessagePackDateFormatSerializationTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.polygene.serialization.msgpack; - -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.serialization.AbstractDateFormatSerializationTest; -import org.junit.Ignore; - -@Ignore( "Super test assume text" ) -public class MessagePackDateFormatSerializationTest extends AbstractDateFormatSerializationTest -{ - @Override - public void assemble( ModuleAssembly module ) - { - new MessagePackSerializationAssembler().assemble( module ); - super.assemble( module ); - } -}