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 DAAE9200C10 for ; Fri, 3 Feb 2017 08:58:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D92DD160B75; Fri, 3 Feb 2017 07:58:05 +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 B8AD7160B62 for ; Fri, 3 Feb 2017 08:58:03 +0100 (CET) Received: (qmail 12706 invoked by uid 500); 3 Feb 2017 07:58:03 -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 12656 invoked by uid 99); 3 Feb 2017 07:58:02 -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; Fri, 03 Feb 2017 07:58:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C5DABDFF26; Fri, 3 Feb 2017 07:58:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: paulmerlin@apache.org To: commits@polygene.apache.org Date: Fri, 03 Feb 2017 07:58:04 -0000 Message-Id: <0b1cd6af79654d18ac0309408c58ac30@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [03/19] polygene-java git commit: Serialization 3 step 1 archived-at: Fri, 03 Feb 2017 07:58:06 -0000 http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonConfigurationDeserializationTest.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonConfigurationDeserializationTest.java b/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonConfigurationDeserializationTest.java deleted file mode 100644 index fb59e8e..0000000 --- a/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonConfigurationDeserializationTest.java +++ /dev/null @@ -1,38 +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.valueserialization.jackson; - -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.entity.AbstractConfigurationDeserializationTest; - -public class JacksonConfigurationDeserializationTest - extends AbstractConfigurationDeserializationTest -{ - @Override - public void assemble( final ModuleAssembly module ) - throws AssemblyException - { - super.assemble( module ); - new JacksonValueSerializationAssembler() - .assemble( module ); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonJsonDateFormatTest.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonJsonDateFormatTest.java b/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonJsonDateFormatTest.java deleted file mode 100644 index 78f27b0..0000000 --- a/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonJsonDateFormatTest.java +++ /dev/null @@ -1,37 +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.valueserialization.jackson; - -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.value.AbstractJsonDateFormatTest; - -public class JacksonJsonDateFormatTest - extends AbstractJsonDateFormatTest -{ - - @Override - public void assemble( ModuleAssembly module ) - throws AssemblyException - { - super.assemble( module ); - new JacksonValueSerializationAssembler().assemble( module ); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonPlainValueSerializationTest.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonPlainValueSerializationTest.java b/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonPlainValueSerializationTest.java deleted file mode 100644 index b4ad6a4..0000000 --- a/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonPlainValueSerializationTest.java +++ /dev/null @@ -1,35 +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.valueserialization.jackson; - -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.value.AbstractPlainValueSerializationTest; - -public class JacksonPlainValueSerializationTest - extends AbstractPlainValueSerializationTest -{ - // START SNIPPET: assembly - @Override - public void assemble( ModuleAssembly module ) - { - new JacksonValueSerializationAssembler().assemble( module ); - } - // END SNIPPET: assembly -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonValueCompositeSerializationTest.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonValueCompositeSerializationTest.java b/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonValueCompositeSerializationTest.java deleted file mode 100644 index 49f7eba..0000000 --- a/extensions/valueserialization-jackson/src/test/java/org/apache/polygene/valueserialization/jackson/JacksonValueCompositeSerializationTest.java +++ /dev/null @@ -1,37 +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.valueserialization.jackson; - -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.value.AbstractValueCompositeSerializationTest; - -public class JacksonValueCompositeSerializationTest - extends AbstractValueCompositeSerializationTest -{ - - @Override - public void assemble( ModuleAssembly module ) - throws AssemblyException - { - super.assemble( module ); - new JacksonValueSerializationAssembler().assemble( module ); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-jackson/src/test/resources/configtest.json ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-jackson/src/test/resources/configtest.json b/extensions/valueserialization-jackson/src/test/resources/configtest.json deleted file mode 100644 index d48a241..0000000 --- a/extensions/valueserialization-jackson/src/test/resources/configtest.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "identity" : "configtest", - "host": { - "ip": "12.23.34.45", - "port": 1234 - }, - "name": "main" -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-orgjson/build.gradle ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-orgjson/build.gradle b/extensions/valueserialization-orgjson/build.gradle deleted file mode 100644 index 5a2d61e..0000000 --- a/extensions/valueserialization-orgjson/build.gradle +++ /dev/null @@ -1,36 +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. - * - * - */ - -apply plugin: 'polygene-extension' - -description = "Apache Polygene™ org.json ValueSerialization Extension" - -jar { manifest { name = "Apache Polygene™ Extension - ValueSerialization - org.json" } } - -dependencies { - compile polygene.core.bootstrap - - runtime polygene.core.runtime - - testCompile polygene.core.testsupport - - testRuntime libraries.logback -} - http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-orgjson/dev-status.xml ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-orgjson/dev-status.xml b/extensions/valueserialization-orgjson/dev-status.xml deleted file mode 100644 index dbb4472..0000000 --- a/extensions/valueserialization-orgjson/dev-status.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - stable - - good - - complete - - - - ALv2 - - http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-orgjson/src/docs/vs-orgjson.txt ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-orgjson/src/docs/vs-orgjson.txt b/extensions/valueserialization-orgjson/src/docs/vs-orgjson.txt deleted file mode 100644 index bbf50f7..0000000 --- a/extensions/valueserialization-orgjson/src/docs/vs-orgjson.txt +++ /dev/null @@ -1,43 +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. -/////////////////////////////////////////////////////////////// - -[[extension-vs-orgjson, org.json ValueSerialization]] -= org.json ValueSerialization = - -[devstatus] --------------- -source=extensions/valueserialization-orgjson/dev-status.xml --------------- - -ValueSerialization Service backed by https://github.com/douglascrockford/JSON-java[org.json]. - -include::../../build/docs/buildinfo/artifact.txt[] - -== Assembly == - -Assembly is done as follows: - -[snippet,java] ----- -source=extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonPlainValueSerializationTest.java -tag=assembly ----- - -See the ValueSerialization <> and <> documentation for details and -usage. http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-orgjson/src/main/java/org/apache/polygene/valueserialization/orgjson/OrgJsonValueSerializationAssembler.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-orgjson/src/main/java/org/apache/polygene/valueserialization/orgjson/OrgJsonValueSerializationAssembler.java b/extensions/valueserialization-orgjson/src/main/java/org/apache/polygene/valueserialization/orgjson/OrgJsonValueSerializationAssembler.java deleted file mode 100644 index 07e5151..0000000 --- a/extensions/valueserialization-orgjson/src/main/java/org/apache/polygene/valueserialization/orgjson/OrgJsonValueSerializationAssembler.java +++ /dev/null @@ -1,41 +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.valueserialization.orgjson; - -import org.apache.polygene.api.value.ValueSerialization; -import org.apache.polygene.bootstrap.Assemblers; -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.ModuleAssembly; - -/** - * Assemble a ValueSerialization Service producing and consuming JSON documents. - */ -public class OrgJsonValueSerializationAssembler - extends Assemblers.Visibility -{ - @Override - public void assemble( ModuleAssembly module ) - throws AssemblyException - { - module.services( OrgJsonValueSerializationService.class ). - visibleIn( visibility() ). - taggedWith( ValueSerialization.Formats.JSON ); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-orgjson/src/main/java/org/apache/polygene/valueserialization/orgjson/package.html ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-orgjson/src/main/java/org/apache/polygene/valueserialization/orgjson/package.html b/extensions/valueserialization-orgjson/src/main/java/org/apache/polygene/valueserialization/orgjson/package.html deleted file mode 100644 index 4799b58..0000000 --- a/extensions/valueserialization-orgjson/src/main/java/org/apache/polygene/valueserialization/orgjson/package.html +++ /dev/null @@ -1,24 +0,0 @@ - - - -

org.json Value Serialization.

- - http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonCollectionSerializationTest.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonCollectionSerializationTest.java b/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonCollectionSerializationTest.java deleted file mode 100644 index a109c5f..0000000 --- a/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonCollectionSerializationTest.java +++ /dev/null @@ -1,37 +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.valueserialization.orgjson; - -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.value.AbstractCollectionSerializationTest; - -public class OrgJsonCollectionSerializationTest - extends AbstractCollectionSerializationTest -{ - - @Override - public void assemble( ModuleAssembly module ) - throws AssemblyException - { - super.assemble( module ); - new OrgJsonValueSerializationAssembler().assemble( module ); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonConfigurationDeserializationTest.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonConfigurationDeserializationTest.java b/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonConfigurationDeserializationTest.java deleted file mode 100644 index c22f58f..0000000 --- a/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonConfigurationDeserializationTest.java +++ /dev/null @@ -1,38 +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.valueserialization.orgjson; - -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.entity.AbstractConfigurationDeserializationTest; - -public class OrgJsonConfigurationDeserializationTest - extends AbstractConfigurationDeserializationTest -{ - @Override - public void assemble( final ModuleAssembly module ) - throws AssemblyException - { - super.assemble( module ); - new OrgJsonValueSerializationAssembler() - .assemble( module ); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonDateFormatTest.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonDateFormatTest.java b/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonDateFormatTest.java deleted file mode 100644 index 23695ff..0000000 --- a/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonDateFormatTest.java +++ /dev/null @@ -1,37 +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.valueserialization.orgjson; - -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.value.AbstractJsonDateFormatTest; - -public class OrgJsonDateFormatTest - extends AbstractJsonDateFormatTest -{ - - @Override - public void assemble( ModuleAssembly module ) - throws AssemblyException - { - super.assemble( module ); - new OrgJsonValueSerializationAssembler().assemble( module ); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonPlainValueSerializationTest.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonPlainValueSerializationTest.java b/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonPlainValueSerializationTest.java deleted file mode 100644 index ef1f928..0000000 --- a/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonPlainValueSerializationTest.java +++ /dev/null @@ -1,35 +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.valueserialization.orgjson; - -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.value.AbstractPlainValueSerializationTest; - -public class OrgJsonPlainValueSerializationTest - extends AbstractPlainValueSerializationTest -{ - // START SNIPPET: assembly - @Override - public void assemble( ModuleAssembly module ) - { - new OrgJsonValueSerializationAssembler().assemble( module ); - } - // END SNIPPET: assembly -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonValueCompositeSerializationTest.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonValueCompositeSerializationTest.java b/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonValueCompositeSerializationTest.java deleted file mode 100644 index ca791a4..0000000 --- a/extensions/valueserialization-orgjson/src/test/java/org/apache/polygene/valueserialization/orgjson/OrgJsonValueCompositeSerializationTest.java +++ /dev/null @@ -1,37 +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.valueserialization.orgjson; - -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.value.AbstractValueCompositeSerializationTest; - -public class OrgJsonValueCompositeSerializationTest - extends AbstractValueCompositeSerializationTest -{ - - @Override - public void assemble( ModuleAssembly module ) - throws AssemblyException - { - super.assemble( module ); - new OrgJsonValueSerializationAssembler().assemble( module ); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-orgjson/src/test/resources/configtest.json ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-orgjson/src/test/resources/configtest.json b/extensions/valueserialization-orgjson/src/test/resources/configtest.json deleted file mode 100644 index d48a241..0000000 --- a/extensions/valueserialization-orgjson/src/test/resources/configtest.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "identity" : "configtest", - "host": { - "ip": "12.23.34.45", - "port": 1234 - }, - "name": "main" -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-stax/build.gradle ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-stax/build.gradle b/extensions/valueserialization-stax/build.gradle deleted file mode 100644 index f60e6be..0000000 --- a/extensions/valueserialization-stax/build.gradle +++ /dev/null @@ -1,37 +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. - * - * - */ - -apply plugin: 'polygene-extension' - -description = "Apache Polygene™ StaX ValueSerialization Extension" - -jar { manifest { name = "Apache Polygene™ Extension - ValueSerialization - StaX" } } - -dependencies { - compile polygene.core.bootstrap - compile libraries.commons_lang - - runtime polygene.core.runtime - - testCompile polygene.core.testsupport - - testRuntime libraries.logback -} - http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-stax/dev-status.xml ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-stax/dev-status.xml b/extensions/valueserialization-stax/dev-status.xml deleted file mode 100644 index 7fa50ff..0000000 --- a/extensions/valueserialization-stax/dev-status.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - beta - - good - - complete - - - - ALv2 - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-stax/src/docs/vs-stax.txt ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-stax/src/docs/vs-stax.txt b/extensions/valueserialization-stax/src/docs/vs-stax.txt deleted file mode 100644 index 416caf4..0000000 --- a/extensions/valueserialization-stax/src/docs/vs-stax.txt +++ /dev/null @@ -1,43 +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. -/////////////////////////////////////////////////////////////// - -[[extension-vs-stax, StAX ValueSerialization]] -= StAX ValueSerialization = - -[devstatus] --------------- -source=extensions/valueserialization-stax/dev-status.xml --------------- - -ValueSerialization Service backed by http://jcp.org/en/jsr/detail?id=173[StAX]. - -include::../../build/docs/buildinfo/artifact.txt[] - -== Assembly == - -Assembly is done as follows: - -[snippet,java] ----- -source=extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxPlainValueSerializationTest.java -tag=assembly ----- - -See the ValueSerialization <> and <> documentation for details and -usage. http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueDeserializer.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueDeserializer.java b/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueDeserializer.java deleted file mode 100644 index 80d282b..0000000 --- a/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueDeserializer.java +++ /dev/null @@ -1,522 +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.valueserialization.stax; - -import java.io.InputStream; -import java.io.StringReader; -import java.io.StringWriter; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Collection; -import java.util.Map; -import java.util.function.Function; -import javax.xml.stream.XMLEventReader; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.events.XMLEvent; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMResult; -import javax.xml.transform.stream.StreamSource; -import org.apache.commons.lang3.StringEscapeUtils; -import org.apache.polygene.api.structure.ModuleDescriptor; -import org.apache.polygene.api.value.ValueSerializationException; -import org.apache.polygene.spi.value.ValueDeserializerAdapter; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * ValueDeserializer reading Values from XML documents. - */ -public class StaxValueDeserializer - extends ValueDeserializerAdapter -{ - - private final XMLInputFactory inputFactory = XMLInputFactory.newInstance(); - private final TransformerFactory transformerFactory = TransformerFactory.newInstance(); - - public StaxValueDeserializer() - { - // Input Factory setup - inputFactory.setProperty( "javax.xml.stream.isValidating", Boolean.FALSE ); - inputFactory.setProperty( "javax.xml.stream.isNamespaceAware", Boolean.FALSE ); - inputFactory.setProperty( "javax.xml.stream.supportDTD", Boolean.FALSE ); - inputFactory.setProperty( "javax.xml.stream.isCoalescing", Boolean.TRUE ); - inputFactory.setProperty( "javax.xml.stream.isReplacingEntityReferences", Boolean.FALSE ); - } - - @Override - protected XMLEventReader adaptInput( ModuleDescriptor module, InputStream input ) - throws Exception - { - return inputFactory.createXMLEventReader( input, "UTF-8" ); - } - - @Override - protected Object readPlainValue( ModuleDescriptor module, XMLEventReader input ) - throws Exception - { - if( !input.hasNext() ) - { - return null; - } - XMLEvent nextEvent = input.nextEvent(); - if( nextEvent.getEventType() == XMLEvent.START_ELEMENT - && "null".equals( nextEvent.asStartElement().getName().getLocalPart() ) ) - { - input.nextTag(); - return null; - } - if( nextEvent.getEventType() != XMLEvent.CHARACTERS ) - { - throw new ValueSerializationException( "Expected characters but got: " + nextEvent ); - } - String stringValue = nextEvent.asCharacters().getData(); - return detectAndConvertStringValue( stringValue ); - } - - @Override - protected Collection readArrayInCollection( ModuleDescriptor module, - XMLEventReader input, - Function deserializer, - Collection collection - ) - throws Exception - { - if( !input.hasNext() ) - { - return null; - } - XMLEvent nextTag = input.nextTag(); - if( nextTag.isStartElement() && "null".equals( nextTag.asStartElement().getName().getLocalPart() ) ) - { - input.nextTag(); - return null; - } - if( !nextTag.isStartElement() || !"array".equals( nextTag.asStartElement().getName().getLocalPart() ) ) - { - throw new ValueSerializationException( "Expected an but got: " + nextTag ); - } - WHILE: - while( input.hasNext() ) - { - XMLEvent currentTag = input.nextTag(); - if( currentTag.isEndElement() ) - { - String endElementName = currentTag.asEndElement().getName().getLocalPart(); - switch( endElementName ) - { - case "array": - break WHILE; - case "value": - continue; - } - } - if( !"value".equals( currentTag.asStartElement().getName().getLocalPart() ) ) - { - throw new ValueSerializationException( "Expected a but got: " + currentTag ); - } - T item = deserializer.apply( input ); - collection.add( item ); - } - return collection; - } - - @Override - protected Map readMapInMap( ModuleDescriptor module, - XMLEventReader input, - Function keyDeserializer, - Function valueDeserializer, - Map map - ) - throws Exception - { - if( !input.hasNext() ) - { - return null; - } - XMLEvent nextTag = input.nextTag(); - if( nextTag.isStartElement() && "null".equals( nextTag.asStartElement().getName().getLocalPart() ) ) - { - input.nextTag(); - return null; - } - if( !nextTag.isStartElement() || !"array".equals( nextTag.asStartElement().getName().getLocalPart() ) ) - { - throw new ValueSerializationException( "Expected an but got: " + nextTag ); - } - XMLEvent currentTag = input.nextTag(); // - while( !currentTag.isEndElement() || !"array".equals( currentTag.asEndElement().getName().getLocalPart() ) ) - { - if( !currentTag.isStartElement() || !"object".equals( currentTag.asStartElement() - .getName() - .getLocalPart() ) ) - { - throw new ValueSerializationException( "Expected an but got: " + nextTag ); - } - currentTag = input.nextTag(); // - K key = null; - V value = null; - while( !currentTag.isEndElement() || !"object".equals( currentTag.asEndElement() - .getName() - .getLocalPart() ) ) - { - input.nextTag(); // - String keyOrValue = input.nextEvent().asCharacters().getData(); - input.nextTag(); // - input.nextTag(); // - switch( keyOrValue ) - { - case "key": - key = keyDeserializer.apply( input ); - break; - case "value": - value = valueDeserializer.apply( input ); - break; - default: - readObjectTree( module, input ); - break; - } - input.nextTag(); // - input.nextTag(); // - currentTag = input.nextTag(); - } - if( key != null ) - { - map.put( key, value ); - } - currentTag = input.nextTag(); - } - return map; - } - - @Override - protected Node readObjectTree( ModuleDescriptor module, XMLEventReader input ) - throws Exception - { - XMLEvent peek = input.peek(); - if( peek.isStartElement() && "null".equals( peek.asStartElement().getName().getLocalPart() ) ) - { - input.nextTag();// - input.nextTag();// - return null; - } - String elementBody = readElementBody( input ); - Transformer transformer = transformerFactory.newTransformer(); - DOMResult domResult = new DOMResult(); - transformer.transform( new StreamSource( new StringReader( elementBody ) ), domResult ); - return ( (Document) domResult.getNode() ).getDocumentElement(); - } - - private static String readElementBody( XMLEventReader input ) - throws XMLStreamException - { - StringWriter buf = new StringWriter( 1024 ); - int depth = 0; - while( input.hasNext() ) - { - // peek event - XMLEvent xmlEvent = input.peek(); - if( xmlEvent.isStartElement() ) - { - ++depth; - } - else if( xmlEvent.isEndElement() ) - { - --depth; - // reached END_ELEMENT tag? - // break loop, leave event in stream - if( depth < 0 ) - { - break; - } - } - // consume event - xmlEvent = input.nextEvent(); - // print out event - xmlEvent.writeAsEncodedUnicode( buf ); - } - return buf.getBuffer().toString(); - } - - @Override - protected Object asSimpleValue( ModuleDescriptor module, Node inputNode ) - throws Exception - { - if( inputNode == null ) - { - return null; - } - if( inputNode.getNodeType() == Node.ELEMENT_NODE && "null".equals( inputNode.getLocalName() ) ) - { - return null; - } - if( inputNode.getNodeType() != Node.TEXT_NODE && inputNode.getNodeType() != Node.CDATA_SECTION_NODE ) - { - throw new ValueSerializationException( "Expected a TEXT or CDATA node but got " + inputNode ); - } - String stringValue = inputNode.getNodeValue(); - return detectAndConvertStringValue( stringValue ); - } - - @Override - @SuppressWarnings( "SimplifiableIfStatement" ) - protected boolean isObjectValue( ModuleDescriptor module, Node inputNode ) - throws Exception - { - if( inputNode == null ) - { - return false; - } - if( "object".equals( inputNode.getLocalName() ) ) - { - return true; - } - if( !"value".equals( inputNode.getLocalName() ) ) - { - return false; - } - return getDirectChildNode( inputNode, "object" ) != null; - } - - @Override - protected boolean objectHasField( ModuleDescriptor module, Node inputNode, String key ) - throws Exception - { - if( inputNode == null ) - { - return false; - } - Node objectNode; - if( "value".equals( inputNode.getLocalName() ) ) - { - objectNode = getDirectChildNode( inputNode, "object" ); - } - else - { - objectNode = inputNode; - } - if( objectNode == null ) - { - return false; - } - if( !"object".equals( objectNode.getLocalName() ) ) - { - throw new ValueSerializationException( "Expected an object value but got: " + objectNode ); - } - return getObjectFieldNode( objectNode, key ) != null; - } - - @Override - @SuppressWarnings( "unchecked" ) - protected T getObjectFieldValue( ModuleDescriptor module, - Node inputNode, - String key, - Function valueDeserializer - ) - throws Exception - { - if( inputNode == null ) - { - return null; - } - Node objectNode; - if( "value".equals( inputNode.getLocalName() ) ) - { - objectNode = getDirectChildNode( inputNode, "object" ); - } - else - { - objectNode = inputNode; - } - if( objectNode == null ) - { - return null; - } - if( !"object".equals( objectNode.getLocalName() ) ) - { - throw new ValueSerializationException( "Expected an object value but got: " + objectNode ); - } - Node fieldNode = getObjectFieldNode( objectNode, key ); - if( fieldNode == null ) - { - return null; - } - Node valueElement = getDirectChildNode( fieldNode, "value" ); - if( valueElement == null ) - { - return null; - } - Node valueNode = valueElement.getFirstChild(); - if( valueNode == null ) - { - return (T) ""; - } - if( valueNode.getNodeType() == Node.ELEMENT_NODE && "null".equals( valueNode.getLocalName() ) ) - { - return null; - } - return valueDeserializer.apply( valueNode ); - } - - @Override - protected void putArrayNodeInCollection( ModuleDescriptor module, - Node inputNode, - Function deserializer, - Collection collection - ) - throws Exception - { - if( inputNode == null ) - { - return; - } - if( !( inputNode instanceof Element ) ) - { - throw new ValueSerializationException( "Expected an Element but got " + inputNode ); - } - NodeList arrayValues = inputNode.getChildNodes(); - for( int arrayValuesIndex = 0; arrayValuesIndex < arrayValues.getLength(); arrayValuesIndex++ ) - { - Node arrayValue = arrayValues.item( arrayValuesIndex ); - T value = deserializer.apply( arrayValue.getFirstChild() ); - collection.add( value ); - } - } - - @Override - protected void putArrayNodeInMap( ModuleDescriptor module, - Node inputNode, - Function keyDeserializer, - Function valueDeserializer, Map map - ) - throws Exception - { - if( inputNode == null ) - { - return; - } - if( !"array".equals( inputNode.getLocalName() ) ) - { - throw new ValueSerializationException( "Expected an but got " + inputNode ); - } - NodeList entriesNodes = inputNode.getChildNodes(); - for( int idx = 0; idx < entriesNodes.getLength(); idx++ ) - { - Node entryNode = entriesNodes.item( idx ); - K key = getObjectFieldValue( module, entryNode, "key", keyDeserializer ); - V value = getObjectFieldValue( module, entryNode, "value", valueDeserializer ); - if( key != null ) - { - map.put( key, value ); - } - } - } - - @Override - protected void putObjectNodeInMap( ModuleDescriptor module, - Node inputNode, - Function valueDeserializer, - Map map - ) - throws Exception - { - if( inputNode == null ) - { - return; - } - if( !"object".equals( inputNode.getLocalName() ) ) - { - throw new ValueSerializationException( "Expected an but got " + inputNode ); - } - NodeList fieldsNodes = inputNode.getChildNodes(); - for( int idx = 0; idx < fieldsNodes.getLength(); idx++ ) - { - Node fieldNode = fieldsNodes.item( idx ); - Node node = getDirectChildNode( fieldNode, "name" ); - String key = node != null ? node.getTextContent() : null; - if( key != null && key.length() > 0 ) - { - V value = getObjectFieldValue( module, inputNode, key, valueDeserializer ); - map.put( key, value ); - } - } - } - - @SuppressWarnings( "AssignmentToMethodParameter" ) - private Object detectAndConvertStringValue( String stringValue ) - { - if( stringValue == null || stringValue.length() == 0 ) - { - return ""; - } - stringValue = StringEscapeUtils.unescapeXml( stringValue ); - if( stringValue.matches( "[+-]?\\d+(\\.\\d+)?([eE][+-]?\\d+(\\.\\d+)?)?" ) ) - { - if( stringValue.indexOf( '.' ) != -1 ) - { - return new BigDecimal( stringValue ); - } - return new BigInteger( stringValue ); - } - if( "true".equalsIgnoreCase( stringValue ) || "false".equalsIgnoreCase( stringValue ) ) - { - return Boolean.parseBoolean( stringValue ); - } - return stringValue; - } - - private static Node getObjectFieldNode( Node inputNode, String key ) - { - if( inputNode == null ) - { - return null; - } - if( !( inputNode instanceof Element ) ) - { - throw new ValueSerializationException( "Excpected an Element but got " + inputNode ); - } - NodeList fieldNodes = inputNode.getChildNodes(); - for( int idx = 0; idx < fieldNodes.getLength(); idx++ ) - { - Node fieldNode = fieldNodes.item( idx ); - Node nameNode = getDirectChildNode( fieldNode, "name" ); - if( nameNode != null && key.equals( nameNode.getTextContent() ) ) - { - return fieldNode; - } - } - return null; - } - - private static Node getDirectChildNode( Node parent, String name ) - { - for( Node child = parent.getFirstChild(); child != null; child = child.getNextSibling() ) - { - if( name.equals( child.getNodeName() ) ) - { - return child; - } - } - return null; - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializationAssembler.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializationAssembler.java b/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializationAssembler.java deleted file mode 100644 index e972acb..0000000 --- a/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializationAssembler.java +++ /dev/null @@ -1,41 +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.valueserialization.stax; - -import org.apache.polygene.api.value.ValueSerialization; -import org.apache.polygene.bootstrap.Assemblers; -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.ModuleAssembly; - -/** - * Assemble a ValueSerialization Service producing and consuming XML documents. - */ -public class StaxValueSerializationAssembler - extends Assemblers.Visibility -{ - @Override - public void assemble( ModuleAssembly module ) - throws AssemblyException - { - module.services( StaxValueSerializationService.class ). - visibleIn( visibility() ). - taggedWith( ValueSerialization.Formats.XML ); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializationService.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializationService.java b/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializationService.java deleted file mode 100644 index 11c752b..0000000 --- a/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializationService.java +++ /dev/null @@ -1,32 +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.valueserialization.stax; - -import org.apache.polygene.api.mixin.Mixins; -import org.apache.polygene.api.value.ValueSerialization; - -/** - * ValueSerialization Service producing and consuming XML documents. - */ -@Mixins( { StaxValueSerializer.class, StaxValueDeserializer.class } ) -public interface StaxValueSerializationService - extends ValueSerialization -{ -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializer.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializer.java b/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializer.java deleted file mode 100644 index ef292d1..0000000 --- a/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializer.java +++ /dev/null @@ -1,134 +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.valueserialization.stax; - -import java.io.OutputStream; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamWriter; -import org.apache.commons.lang3.StringEscapeUtils; -import org.apache.polygene.spi.value.ValueSerializerAdapter; - -/** - * ValueSerializer producing Values state as XML documents. - */ -public class StaxValueSerializer - extends ValueSerializerAdapter -{ - - private final XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); - - public StaxValueSerializer() - { - // Output Factory setup - outputFactory.setProperty( "javax.xml.stream.isRepairingNamespaces", Boolean.FALSE ); - } - - @Override - protected XMLStreamWriter adaptOutput( OutputStream output ) - throws Exception - { - XMLStreamWriter xmlStreamWriter = outputFactory.createXMLStreamWriter( output, "UTF-8" ); - xmlStreamWriter.writeStartDocument( "utf-8", "1.1" ); - return xmlStreamWriter; - } - - @Override - protected void onSerializationEnd( Object object, XMLStreamWriter output ) - throws Exception - { - output.writeEndDocument(); - output.flush(); - output.close(); - } - - @Override - protected void onArrayStart( XMLStreamWriter output ) - throws Exception - { - output.writeStartElement( "array" ); - } - - @Override - protected void onArrayEnd( XMLStreamWriter output ) - throws Exception - { - output.writeEndElement(); - } - - @Override - protected void onObjectStart( XMLStreamWriter output ) - throws Exception - { - output.writeStartElement( "object" ); - } - - @Override - protected void onObjectEnd( XMLStreamWriter output ) - throws Exception - { - output.writeEndElement(); - } - - @Override - protected void onFieldStart( XMLStreamWriter output, String key ) - throws Exception - { - output.writeStartElement( "field" ); - output.writeStartElement( "name" ); - output.writeCharacters( key ); - output.writeEndElement(); - } - - @Override - protected void onFieldEnd( XMLStreamWriter output ) - throws Exception - { - output.writeEndElement(); - } - - @Override - protected void onValueStart( XMLStreamWriter output ) - throws Exception - { - output.writeStartElement( "value" ); - } - - @Override - protected void onValue( XMLStreamWriter output, Object value ) - throws Exception - { - if( value == null ) - { - output.writeStartElement( "null" ); - output.writeEndElement(); - } - else - { - output.writeCharacters( StringEscapeUtils.escapeXml( value.toString() ) ); - } - } - - @Override - protected void onValueEnd( XMLStreamWriter output ) - throws Exception - { - output.writeEndElement(); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/package.html ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/package.html b/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/package.html deleted file mode 100644 index a79d1b0..0000000 --- a/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/package.html +++ /dev/null @@ -1,24 +0,0 @@ - - - -

XML StAX Value Serializer.

- - http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxCollectionSerializationTest.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxCollectionSerializationTest.java b/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxCollectionSerializationTest.java deleted file mode 100644 index ae1267b..0000000 --- a/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxCollectionSerializationTest.java +++ /dev/null @@ -1,46 +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.valueserialization.stax; - -import org.junit.BeforeClass; -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.value.AbstractCollectionSerializationTest; - -import static org.apache.polygene.test.util.Assume.assumeNoIbmJdk; - -public class StaxCollectionSerializationTest - extends AbstractCollectionSerializationTest -{ - - @BeforeClass - public static void beforeClass_IBMJDK() - { - assumeNoIbmJdk(); - } - - @Override - public void assemble( ModuleAssembly module ) - throws AssemblyException - { - super.assemble( module ); - new StaxValueSerializationAssembler().assemble( module ); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxConfigurationDeserializationTest.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxConfigurationDeserializationTest.java b/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxConfigurationDeserializationTest.java deleted file mode 100644 index 3c52f82..0000000 --- a/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxConfigurationDeserializationTest.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.valueserialization.stax; - -import org.apache.polygene.api.identity.StringIdentity; -import org.junit.Ignore; -import org.junit.Test; -import org.apache.polygene.api.injection.scope.Service; -import org.apache.polygene.api.value.ValueBuilder; -import org.apache.polygene.api.value.ValueSerialization; -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.entity.AbstractConfigurationDeserializationTest; - -@Ignore( "Complex configurations are not yet support in Stax ValueSerialization, due to handling arrays with Java serialization.") -public class StaxConfigurationDeserializationTest - extends AbstractConfigurationDeserializationTest -{ - @Service - private ValueSerialization valueSerialization; - - @Override - public void assemble( final ModuleAssembly module ) - throws AssemblyException - { - super.assemble( module ); - new StaxValueSerializationAssembler() - .assemble( module ); - } - - @Test - public void serializeTest() - { - ValueBuilder builder = valueBuilderFactory.newValueBuilder( ConfigSerializationConfig.class ); - builder.prototype().name().set( "main" ); - builder.prototype().host().set( createHost() ); - builder.prototype().identity().set( new StringIdentity( "configtest" ) ); - ConfigSerializationConfig value = builder.newInstance(); - - valueSerialization.serialize( value, System.out ); - } - - private Host createHost() - { - ValueBuilder builder = valueBuilderFactory.newValueBuilder( Host.class ); - builder.prototype().ip().set( "12.23.34.45" ); - builder.prototype().port().set( 1234 ); - return builder.newInstance(); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxPlainValueSerializationTest.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxPlainValueSerializationTest.java b/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxPlainValueSerializationTest.java deleted file mode 100644 index 1d1c456..0000000 --- a/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxPlainValueSerializationTest.java +++ /dev/null @@ -1,44 +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.valueserialization.stax; - -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.value.AbstractPlainValueSerializationTest; -import org.junit.BeforeClass; - -import static org.apache.polygene.test.util.Assume.assumeNoIbmJdk; - -public class StaxPlainValueSerializationTest - extends AbstractPlainValueSerializationTest -{ - @BeforeClass - public static void beforeClass_IBMJDK() - { - assumeNoIbmJdk(); - } - - // START SNIPPET: assembly - @Override - public void assemble( ModuleAssembly module ) - { - new StaxValueSerializationAssembler().assemble( module ); - } - // END SNIPPET: assembly -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxValueCompositeSerializationTest.java ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxValueCompositeSerializationTest.java b/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxValueCompositeSerializationTest.java deleted file mode 100644 index 57a7e9a..0000000 --- a/extensions/valueserialization-stax/src/test/java/org/apache/polygene/valueserialization/stax/StaxValueCompositeSerializationTest.java +++ /dev/null @@ -1,46 +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.valueserialization.stax; - -import org.junit.BeforeClass; -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.test.value.AbstractValueCompositeSerializationTest; - -import static org.apache.polygene.test.util.Assume.assumeNoIbmJdk; - -public class StaxValueCompositeSerializationTest - extends AbstractValueCompositeSerializationTest -{ - - @BeforeClass - public static void beforeClass_IBMJDK() - { - assumeNoIbmJdk(); - } - - @Override - public void assemble( ModuleAssembly module ) - throws AssemblyException - { - super.assemble( module ); - new StaxValueSerializationAssembler().assemble( module ); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/extensions/valueserialization-stax/src/test/resources/configtest.xml ---------------------------------------------------------------------- diff --git a/extensions/valueserialization-stax/src/test/resources/configtest.xml b/extensions/valueserialization-stax/src/test/resources/configtest.xml deleted file mode 100644 index e8100ad..0000000 --- a/extensions/valueserialization-stax/src/test/resources/configtest.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - name - main - - - host - - - - _type - org.apache.polygene.test.entity.AbstractConfigurationDeserializationTest$Host - - - port - 1234 - - - ip - 12.23.34.45 - - - - - - identity - configtest - - http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/internals/testsupport-internal/build.gradle ---------------------------------------------------------------------- diff --git a/internals/testsupport-internal/build.gradle b/internals/testsupport-internal/build.gradle index f946b94..aba2e08 100644 --- a/internals/testsupport-internal/build.gradle +++ b/internals/testsupport-internal/build.gradle @@ -19,9 +19,16 @@ apply plugin: 'polygene-internal' apply plugin: 'polygene-internal-docker' +description = "Apache Polygene™ Internal Test Support" + +jar { manifest { name = "Apache Polygene™ Internals - Test Support" } } + + dependencies { compile polygene.core.testsupport compile libraries.docker_junit runtime polygene.core.runtime + runtime libraries.johnzon } + http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/libraries/constraints/src/test/java/org/apache/polygene/library/constraints/ConstraintTest.java ---------------------------------------------------------------------- diff --git a/libraries/constraints/src/test/java/org/apache/polygene/library/constraints/ConstraintTest.java b/libraries/constraints/src/test/java/org/apache/polygene/library/constraints/ConstraintTest.java index a0d6346..2c526b5 100644 --- a/libraries/constraints/src/test/java/org/apache/polygene/library/constraints/ConstraintTest.java +++ b/libraries/constraints/src/test/java/org/apache/polygene/library/constraints/ConstraintTest.java @@ -20,14 +20,14 @@ package org.apache.polygene.library.constraints; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; import java.util.HashSet; -import org.apache.polygene.test.AbstractPolygeneTest; -import org.junit.Test; import org.apache.polygene.api.composite.TransientBuilder; import org.apache.polygene.api.constraint.ConstraintViolationException; import org.apache.polygene.bootstrap.AssemblyException; import org.apache.polygene.bootstrap.ModuleAssembly; +import org.apache.polygene.test.AbstractPolygeneTest; +import org.junit.Test; import static org.junit.Assert.fail; @@ -236,8 +236,8 @@ public class ConstraintTest { TransientBuilder cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class ); cb.prototype().notEmptyString().set( "X" ); - cb.prototype().notEmptyCollection().set( Arrays.asList( "X" ) ); - cb.prototype().notEmptyList().set( Arrays.asList( "X" ) ); + cb.prototype().notEmptyCollection().set( Collections.singletonList( "X" ) ); + cb.prototype().notEmptyList().set( Collections.singletonList( "X" ) ); } @Test( expected = ConstraintViolationException.class ) http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e4cca11e/libraries/rdf/build.gradle ---------------------------------------------------------------------- diff --git a/libraries/rdf/build.gradle b/libraries/rdf/build.gradle index 627d454..1ede7ed 100644 --- a/libraries/rdf/build.gradle +++ b/libraries/rdf/build.gradle @@ -33,7 +33,6 @@ dependencies { runtime polygene.core.runtime testCompile polygene.core.testsupport - testCompile polygene.extension( 'valueserialization-orgjson' ) testRuntime libraries.logback } \ No newline at end of file