Repository: juddi Updated Branches: refs/heads/master 432345b08 -> ac9b6da2c
JUDDI-872 initial cut vsv sample JUDDI-198 enabled vsv tests for the tck runner Project: http://git-wip-us.apache.org/repos/asf/juddi/repo Commit: http://git-wip-us.apache.org/repos/asf/juddi/commit/ac9b6da2 Tree: http://git-wip-us.apache.org/repos/asf/juddi/tree/ac9b6da2 Diff: http://git-wip-us.apache.org/repos/asf/juddi/diff/ac9b6da2 Branch: refs/heads/master Commit: ac9b6da2ca4c0e05805ea1bdc90fca7f157a5b7d Parents: 432345b Author: alexoree <[email protected]> Authored: Sat Mar 15 20:39:23 2014 -0400 Committer: alexoree <[email protected]> Committed: Sat Mar 15 20:39:23 2014 -0400 ---------------------------------------------------------------------- .../juddi/v3/client/config/UDDIClerk.java | 2 +- .../api/impl/UDDIValueSetValidationImpl.java | 2 +- juddi-examples/ValueSetValidator/pom.xml | 86 ++++++++++++++++++++ .../examples/vsv/valuesetvalidator/App.java | 46 +++++++++++ .../vsv/Uddiwwwbobcomverifiedtmodel.java | 35 ++++++++ .../src/main/resources/META-INF/uddi.xml | 38 +++++++++ .../examples/vsv/valuesetvalidator/AppTest.java | 38 +++++++++ juddi-examples/pom.xml | 1 + .../subscription-notification-amqp/pom.xml | 8 +- uddi-tck-runner/tck.properties | 2 +- 10 files changed, 251 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/juddi/blob/ac9b6da2/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java ---------------------------------------------------------------------- diff --git a/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java b/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java index d06dca2..ce6fc97 100644 --- a/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java +++ b/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java @@ -1528,7 +1528,7 @@ public class UDDIClerk implements Serializable { * * @param partitionName think of this as the domain, i.e. juddi.apache.org, but it can really be anything you want. This will become part of the * key associated with the tModel generator (uddi:juddi.apache.org:keygenerator). The colon ":" is the delimitor, so avoid using them unless you want to - * create nexted key domains. If you're missing the "uddi:" prefix or the ":keygenerator" suffix, it will be added automatically. + * create nested key domains. If you're missing the "uddi:" prefix or the ":keygenerator" suffix, it will be added automatically. * @param DescriptiveName required. max length is 255 char * @param DescriptiveNameLanguage optional, max length is 26 char * @return a populated tModel entity representing a tModel key http://git-wip-us.apache.org/repos/asf/juddi/blob/ac9b6da2/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIValueSetValidationImpl.java ---------------------------------------------------------------------- diff --git a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIValueSetValidationImpl.java b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIValueSetValidationImpl.java index cbfceae..5c31a85 100644 --- a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIValueSetValidationImpl.java +++ b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIValueSetValidationImpl.java @@ -336,7 +336,7 @@ public class UDDIValueSetValidationImpl extends AuthenticatedService implements } String key = new String(new char[]{tmodelkey.charAt(0)}).toUpperCase() + tmodelkey.substring(1).toLowerCase(); - key = key.replaceAll("[^a-zA-Z0-9 -]", ""); + key = key.replaceAll("[^a-zA-Z0-9]", ""); String clazz = "org.apache.juddi.validation.vsv." + key; http://git-wip-us.apache.org/repos/asf/juddi/blob/ac9b6da2/juddi-examples/ValueSetValidator/pom.xml ---------------------------------------------------------------------- diff --git a/juddi-examples/ValueSetValidator/pom.xml b/juddi-examples/ValueSetValidator/pom.xml new file mode 100644 index 0000000..6bca191 --- /dev/null +++ b/juddi-examples/ValueSetValidator/pom.xml @@ -0,0 +1,86 @@ +<?xml version="1.0"?> +<!-- * Copyright 2001-2009 The Apache Software Foundation. * Licensed 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. * */ --> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.juddi.example</groupId> + <artifactId>juddi-examples</artifactId> + <version>3.2.1-SNAPSHOT</version> + </parent> + + <artifactId>example-vsv-validator</artifactId> + <version>${project.parent.version}</version> + <name>jUDDI Example Value Set Validator</name> + <dependencies> + <dependency> + <groupId>org.apache.juddi</groupId> + <artifactId>uddi-ws</artifactId> + <version>${project.parent.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.juddi</groupId> + <artifactId>juddi-client</artifactId> + <version>${project.parent.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.juddi</groupId> + <artifactId>juddi-core</artifactId> + <version>${project.parent.version}</version> + <scope>provided</scope> + </dependency> + </dependencies> + + <profiles> + <profile> + <id>default</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>demo</id> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>1.1.1</version> + <executions> + <execution> + <phase>test</phase> + <goals> + <goal>java</goal> + </goals> + <configuration> + <mainClass>org.apache.juddi.examples.vsv.valuesetvalidator.App</mainClass> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> http://git-wip-us.apache.org/repos/asf/juddi/blob/ac9b6da2/juddi-examples/ValueSetValidator/src/main/java/org/apache/juddi/examples/vsv/valuesetvalidator/App.java ---------------------------------------------------------------------- diff --git a/juddi-examples/ValueSetValidator/src/main/java/org/apache/juddi/examples/vsv/valuesetvalidator/App.java b/juddi-examples/ValueSetValidator/src/main/java/org/apache/juddi/examples/vsv/valuesetvalidator/App.java new file mode 100644 index 0000000..97fb541 --- /dev/null +++ b/juddi-examples/ValueSetValidator/src/main/java/org/apache/juddi/examples/vsv/valuesetvalidator/App.java @@ -0,0 +1,46 @@ +package org.apache.juddi.examples.vsv.valuesetvalidator; + +import org.apache.commons.configuration.ConfigurationException; +import org.apache.juddi.api.impl.UDDIValueSetValidationImpl; +import org.apache.juddi.v3.client.UDDIConstants; +import org.apache.juddi.v3.client.config.UDDIClerk; +import org.apache.juddi.v3.client.config.UDDIClient; +import org.apache.juddi.validation.vsv.AbstractSimpleValidator; +import org.uddi.api_v3.CategoryBag; +import org.uddi.api_v3.KeyedReference; +import org.uddi.api_v3.Name; +import org.uddi.api_v3.TModel; + +/** + * Hello world! + * + */ +public class App { + + public static void main(String[] args) throws ConfigurationException { + System.out.println("Notice! before running this, build this project and copy the jar file into juddi-tomcat/target/tomcat/apache-tomcat.../juddiv3.war/WEB-INF/lib and restart!"); + + System.out.println(UDDIValueSetValidationImpl.ConvertKeyToClass("uddi:www.bob.com:verified-tmodel")); + + //register joe publisher key generator + //register tmodel that's validated + UDDIClient client = new UDDIClient("META-INF/uddi.xml"); + UDDIClerk clerk = client.getClerk("default"); + TModel keygen = UDDIClerk.createKeyGenator("www.bob.com", "Bob's Key Generator", "This key generator is used for the jUDDI example Value Set Validator example"); + + keygen = clerk.register(keygen).getTModel().get(0); + + TModel verifiedTmodel = new TModel(); + verifiedTmodel.setTModelKey(keygen.getTModelKey().replace("keygenerator", "verified-tmodel")); + verifiedTmodel.setCategoryBag(new CategoryBag()); + + verifiedTmodel.getCategoryBag().getKeyedReference().add(new KeyedReference(UDDIConstants.IS_VALIDATED_BY, UDDIConstants.IS_VALIDATED_BY_KEY_NAME, "uddi:juddi.apache.org:servicebindings-valueset-cp")); + verifiedTmodel.setName(new Name("Bob's tModel with validation", "en")); + verifiedTmodel = clerk.register(verifiedTmodel).getTModel().get(0); + + //now try to use it with a valid value + + //try to use it when an invalid value + + } +} http://git-wip-us.apache.org/repos/asf/juddi/blob/ac9b6da2/juddi-examples/ValueSetValidator/src/main/java/org/apache/juddi/validation/vsv/Uddiwwwbobcomverifiedtmodel.java ---------------------------------------------------------------------- diff --git a/juddi-examples/ValueSetValidator/src/main/java/org/apache/juddi/validation/vsv/Uddiwwwbobcomverifiedtmodel.java b/juddi-examples/ValueSetValidator/src/main/java/org/apache/juddi/validation/vsv/Uddiwwwbobcomverifiedtmodel.java new file mode 100644 index 0000000..cb79c0c --- /dev/null +++ b/juddi-examples/ValueSetValidator/src/main/java/org/apache/juddi/validation/vsv/Uddiwwwbobcomverifiedtmodel.java @@ -0,0 +1,35 @@ +/* + * Copyright 2014 The Apache Software Foundation. + * + * Licensed 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.juddi.validation.vsv; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Alex O'Ree + */ +public class Uddiwwwbobcomverifiedtmodel extends AbstractSimpleValidator{ + + @Override + public List<String> getValidValues() { + List<String> ret = new ArrayList<String>(); + ret.add("value1"); + return ret; + } + +} http://git-wip-us.apache.org/repos/asf/juddi/blob/ac9b6da2/juddi-examples/ValueSetValidator/src/main/resources/META-INF/uddi.xml ---------------------------------------------------------------------- diff --git a/juddi-examples/ValueSetValidator/src/main/resources/META-INF/uddi.xml b/juddi-examples/ValueSetValidator/src/main/resources/META-INF/uddi.xml new file mode 100644 index 0000000..83e103c --- /dev/null +++ b/juddi-examples/ValueSetValidator/src/main/resources/META-INF/uddi.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> + +<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd"> + <reloadDelay>5000</reloadDelay> + <client name="example-client"> + <nodes> + <node> + <!-- required 'default' node --> + <name>default</name> + <properties> + <property name="serverName" value="localhost"/> + <property name="serverPort" value="8080"/> + <!-- for UDDI nodes that use HTTP u/p, using the following + <property name="basicAuthUsername" value="root" /> + <property name="basicAuthPassword" value="password" /> + <property name="basicAuthPasswordIsEncrypted" value="false" /> + <property name="basicAuthPasswordCryptoProvider" value="org.apache.juddi.v3.client.crypto.AES128Cryptor (an example)" />--> + </properties> + <description>Main jUDDI node</description> + <!-- JAX-WS Transport --> + <proxyTransport>org.apache.juddi.v3.client.transport.JAXWSTransport</proxyTransport> + <custodyTransferUrl>http://${serverName}:${serverPort}/juddiv3/services/custody-transfer</custodyTransferUrl> + <inquiryUrl>http://${serverName}:${serverPort}/juddiv3/services/inquiry</inquiryUrl> + <inquiryRESTUrl>http://${serverName}:${serverPort}/juddiv3/services/inquiryRest</inquiryRESTUrl> + <publishUrl>http://${serverName}:${serverPort}/juddiv3/services/publish</publishUrl> + <securityUrl>http://${serverName}:${serverPort}/juddiv3/services/security</securityUrl> + <subscriptionUrl>http://${serverName}:${serverPort}/juddiv3/services/subscription</subscriptionUrl> + <subscriptionListenerUrl>http://${serverName}:${serverPort}/juddiv3/services/subscription-listener</subscriptionListenerUrl> + <juddiApiUrl>http://${serverName}:${serverPort}/juddiv3/services/juddi-api</juddiApiUrl> + </node> + </nodes> + <clerks registerOnStartup="false" > + <clerk name="default" node="default" publisher="bob" password="bob" + isPasswordEncrypted="false" cryptoProvider="org.apache.juddi.v3.client.cryptor.AES128Cryptor"/> + </clerks> + + </client> +</uddi> http://git-wip-us.apache.org/repos/asf/juddi/blob/ac9b6da2/juddi-examples/ValueSetValidator/src/test/java/org/apache/juddi/examples/vsv/valuesetvalidator/AppTest.java ---------------------------------------------------------------------- diff --git a/juddi-examples/ValueSetValidator/src/test/java/org/apache/juddi/examples/vsv/valuesetvalidator/AppTest.java b/juddi-examples/ValueSetValidator/src/test/java/org/apache/juddi/examples/vsv/valuesetvalidator/AppTest.java new file mode 100644 index 0000000..0719f4e --- /dev/null +++ b/juddi-examples/ValueSetValidator/src/test/java/org/apache/juddi/examples/vsv/valuesetvalidator/AppTest.java @@ -0,0 +1,38 @@ +package org.apache.juddi.examples.vsv.valuesetvalidator; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} http://git-wip-us.apache.org/repos/asf/juddi/blob/ac9b6da2/juddi-examples/pom.xml ---------------------------------------------------------------------- diff --git a/juddi-examples/pom.xml b/juddi-examples/pom.xml index 4afb0dd..87402da 100644 --- a/juddi-examples/pom.xml +++ b/juddi-examples/pom.xml @@ -39,5 +39,6 @@ <module>more-uddi-samples</module> <module>service-version</module> <module>uddiv2-api-bridge-example</module> + <module>ValueSetValidator</module> </modules> </project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/juddi/blob/ac9b6da2/juddi-examples/subscription-notification-amqp/pom.xml ---------------------------------------------------------------------- diff --git a/juddi-examples/subscription-notification-amqp/pom.xml b/juddi-examples/subscription-notification-amqp/pom.xml index c59f571..74682b0 100644 --- a/juddi-examples/subscription-notification-amqp/pom.xml +++ b/juddi-examples/subscription-notification-amqp/pom.xml @@ -16,20 +16,20 @@ </parent> <artifactId>subscription-notification-amqp</artifactId> - <version>3.2.1-SNAPSHOT</version> + <version>${project.parent.version}</version> <name>jUDDI Example AMQP Notifier for Subscription callbacks</name> <description>Demonstrates how to write a custom notifier for subscriptions</description> <dependencies> <dependency> <groupId>org.apache.juddi</groupId> <artifactId>uddi-ws</artifactId> - <version>3.2.1-SNAPSHOT</version> + <version>${project.parent.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.juddi</groupId> <artifactId>juddi-client</artifactId> - <version>3.2.1-SNAPSHOT</version> + <version>${project.parent.version}</version> <scope>provided</scope> </dependency> <dependency> @@ -50,7 +50,7 @@ <dependency> <groupId>org.apache.juddi</groupId> <artifactId>juddi-core</artifactId> - <version>3.2.1-SNAPSHOT</version> + <version>${project.parent.version}</version> <scope>provided</scope> </dependency> </dependencies> http://git-wip-us.apache.org/repos/asf/juddi/blob/ac9b6da2/uddi-tck-runner/tck.properties ---------------------------------------------------------------------- diff --git a/uddi-tck-runner/tck.properties b/uddi-tck-runner/tck.properties index 740d117..81a3189 100644 --- a/uddi-tck-runner/tck.properties +++ b/uddi-tck-runner/tck.properties @@ -29,7 +29,7 @@ auth_mode = uddi rest.enabled = true #does the UDDI server support the Value Set Validation APIs? -vsv.enabled = false +vsv.enabled = true #does the UDDI server support the Subscription API? sub.enabled=true --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
