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 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<!-- - ~ 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. - ~ - ~ - --> -<module xmlns="http://polygene.apache.org/schemas/2008/dev-status/1" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://polygene.apache.org/schemas/2008/dev-status/1 - http://polygene.apache.org/schemas/2008/dev-status/1/dev-status.xsd"> - <status> - <codebase>stable</codebase> - <!--none,early,beta,stable,mature--> - <documentation>good</documentation> - <!-- none, brief, good, complete --> - <unittests>complete</unittests> - <!-- none, some, good, complete --> - </status> - <licenses> - <license>ALv2</license> - </licenses> -</module> 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 <<core-api-value,API>> and <<core-spi-valueserialization,SPI>> 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<OrgJsonValueSerializationAssembler> -{ - @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 @@ -<!-- - ~ 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. - ~ - ~ - --> -<html> - <body> - <h2>org.json Value Serialization.</h2> - </body> -</html> 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 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<!-- - ~ 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. - ~ - ~ - --> -<module xmlns="http://polygene.apache.org/schemas/2008/dev-status/1" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://polygene.apache.org/schemas/2008/dev-status/1 - http://polygene.apache.org/schemas/2008/dev-status/1/dev-status.xsd"> - <status> - <codebase>beta</codebase> - <!--none,early,beta,stable,mature--> - <documentation>good</documentation> - <!-- none, brief, good, complete --> - <unittests>complete</unittests> - <!-- none, some, good, complete --> - </status> - <licenses> - <license>ALv2</license> - </licenses> -</module> \ 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 <<core-api-value,API>> and <<core-spi-valueserialization,SPI>> 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<XMLEventReader, Node> -{ - - 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 <T> Collection<T> readArrayInCollection( ModuleDescriptor module, - XMLEventReader input, - Function<XMLEventReader, T> deserializer, - Collection<T> 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 <array/> 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 <value/> but got: " + currentTag ); - } - T item = deserializer.apply( input ); - collection.add( item ); - } - return collection; - } - - @Override - protected <K, V> Map<K, V> readMapInMap( ModuleDescriptor module, - XMLEventReader input, - Function<XMLEventReader, K> keyDeserializer, - Function<XMLEventReader, V> valueDeserializer, - Map<K, V> 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 <array/> but got: " + nextTag ); - } - XMLEvent currentTag = input.nextTag(); // <object> - while( !currentTag.isEndElement() || !"array".equals( currentTag.asEndElement().getName().getLocalPart() ) ) - { - if( !currentTag.isStartElement() || !"object".equals( currentTag.asStartElement() - .getName() - .getLocalPart() ) ) - { - throw new ValueSerializationException( "Expected an <object/> but got: " + nextTag ); - } - currentTag = input.nextTag(); // <field> - K key = null; - V value = null; - while( !currentTag.isEndElement() || !"object".equals( currentTag.asEndElement() - .getName() - .getLocalPart() ) ) - { - input.nextTag(); // <name> - String keyOrValue = input.nextEvent().asCharacters().getData(); - input.nextTag(); // </name> - input.nextTag(); // <value> - switch( keyOrValue ) - { - case "key": - key = keyDeserializer.apply( input ); - break; - case "value": - value = valueDeserializer.apply( input ); - break; - default: - readObjectTree( module, input ); - break; - } - input.nextTag(); // </value> - input.nextTag(); // </field> - 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();// <null> - input.nextTag();// </null> - 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> T getObjectFieldValue( ModuleDescriptor module, - Node inputNode, - String key, - Function<Node, T> 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 <T> void putArrayNodeInCollection( ModuleDescriptor module, - Node inputNode, - Function<Node, T> deserializer, - Collection<T> 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 <K, V> void putArrayNodeInMap( ModuleDescriptor module, - Node inputNode, - Function<Node, K> keyDeserializer, - Function<Node, V> valueDeserializer, Map<K, V> map - ) - throws Exception - { - if( inputNode == null ) - { - return; - } - if( !"array".equals( inputNode.getLocalName() ) ) - { - throw new ValueSerializationException( "Expected an <array/> 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 <V> void putObjectNodeInMap( ModuleDescriptor module, - Node inputNode, - Function<Node, V> valueDeserializer, - Map<String, V> map - ) - throws Exception - { - if( inputNode == null ) - { - return; - } - if( !"object".equals( inputNode.getLocalName() ) ) - { - throw new ValueSerializationException( "Expected an <object/> 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<StaxValueSerializationAssembler> -{ - @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<XMLStreamWriter> -{ - - 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 @@ -<!-- - ~ 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. - ~ - ~ - --> -<html> - <body> - <h2>XML StAX Value Serializer.</h2> - </body> -</html> 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<ConfigSerializationConfig> 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<Host> 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 @@ -<?xml version="1.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. - ~ - ~ - --> - -<object> - <field> - <name>name</name> - <value>main</value> - </field> - <field> - <name>host</name> - <value> - <object> - <field> - <name>_type</name> - <value>org.apache.polygene.test.entity.AbstractConfigurationDeserializationTest$Host</value> - </field> - <field> - <name>port</name> - <value>1234</value> - </field> - <field> - <name>ip</name> - <value>12.23.34.45</value> - </field> - </object> - </value> - </field> - <field> - <name>identity</name> - <value>configtest</value> - </field> -</object> 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<TestCaseComposite> 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
