juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfa...@apache.org
Subject svn commit: r713229 - in /webservices/juddi/branches/v3_trunk/juddi-core: install/ src/main/java/org/apache/juddi/api/impl/ src/main/java/org/apache/juddi/config/ src/main/java/org/apache/juddi/keygen/ src/main/java/org/apache/juddi/model/ src/main/jav...
Date Wed, 12 Nov 2008 00:47:04 GMT
Author: jfaath
Date: Tue Nov 11 16:47:03 2008
New Revision: 713229

URL: http://svn.apache.org/viewvc?rev=713229&view=rev
Log:
JUDDI-139:  implementation of key generation strategy.  Includes changes to testing code to account for new key generation rules.

Added:
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/DefaultKeyGenerator.java   (with props)
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/KeyGenerator.java   (with props)
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/KeyGeneratorFactory.java   (with props)
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyGeneratorKey.java   (with props)
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyGeneratorKeyId.java   (with props)
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidateUDDIKey.java   (with props)
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/TModelTest.java   (with props)
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_Publisher.xml   (props changed)
      - copied unchanged from r711730, webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/publisher1.xml
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_businessEntity1.xml   (contents, props changed)
      - copied, changed from r711730, webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/businessEntity1.xml
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_businessService1.xml   (contents, props changed)
      - copied, changed from r711730, webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/businessService1.xml
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_tModelKeyGen.xml   (with props)
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/root_Publisher.xml   (with props)
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/root_tModelKeyGen.xml   (with props)
Removed:
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/businessEntity1.xml
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/businessService1.xml
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/publisher1.xml
Modified:
    webservices/juddi/branches/v3_trunk/juddi-core/install/root_Publisher.xml
    webservices/juddi/branches/v3_trunk/juddi-core/install/root_tModelKeyGen.xml
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/AuthenticatedService.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/Property.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Publisher.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/UddiEntityPublisher.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/util/DynamicQuery.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/util/JPAUtil.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/juddi.properties
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/messages_en.properties
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/BusinessEntityTest.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/BusinessServiceTest.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/PublisherTest.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/UDDIApiTestHelper.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/resources/suite-one.xml

Modified: webservices/juddi/branches/v3_trunk/juddi-core/install/root_Publisher.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/install/root_Publisher.xml?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/install/root_Publisher.xml (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/install/root_Publisher.xml Tue Nov 11 16:47:03 2008
@@ -1,7 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<save_publisher xmlns="urn:apache-org:juddi_v3">
-  <publisher publisherId="root">
-    <publisherName>root publisher</publisherName>
-    <isAdmin>true</isAdmin>
-  </publisher>
-</save_publisher>
+<publisher xmlns="urn:apache-org:juddi_v3" publisherId="root">
+  <publisherName>root publisher</publisherName>
+  <isAdmin>true</isAdmin>
+</publisher>

Modified: webservices/juddi/branches/v3_trunk/juddi-core/install/root_tModelKeyGen.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/install/root_tModelKeyGen.xml?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/install/root_tModelKeyGen.xml (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/install/root_tModelKeyGen.xml Tue Nov 11 16:47:03 2008
@@ -1,15 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<save_tModel xmlns="urn:uddi-org:api_v3">
-  <tModel tModelKey="uddi:juddi.apache.org:keygenerator" xmlns="urn:uddi-org:api_v3">
-    <name>uddi-org:keyGenerator</name>
-    <description>UDDI domain key generator</description>
-    <overviewDoc>
-      <overviewURL useType="text">
-        http://uddi.org/pubs/uddi_v3.htm#keyGen</overviewURL>
-    </overviewDoc>
-    <categoryBag>
-      <keyedReference tModelKey="uddi:uddi.org:categorization:types" keyName="uddi-org:types:keyGenerator"
-        keyValue="keyGenerator" />
-    </categoryBag>
-  </tModel>
-</save_tModel>
\ No newline at end of file
+<tModel tModelKey="uddi:juddi.apache.org:keygenerator" xmlns="urn:uddi-org:api_v3">
+  <name>uddi-org:keyGenerator</name>
+  <description>UDDI domain key generator</description>
+  <overviewDoc>
+    <overviewURL useType="text">
+      http://uddi.org/pubs/uddi_v3.htm#keyGen</overviewURL>
+  </overviewDoc>
+  <categoryBag>
+    <keyedReference tModelKey="uddi:uddi.org:categorization:types" keyName="uddi-org:types:keyGenerator"
+      keyValue="keyGenerator" />
+  </categoryBag>
+</tModel>

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/AuthenticatedService.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/AuthenticatedService.java?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/AuthenticatedService.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/AuthenticatedService.java Tue Nov 11 16:47:03 2008
@@ -23,7 +23,6 @@
 
 import org.apache.juddi.error.AuthTokenRequiredException;
 import org.apache.juddi.error.ErrorMessage;
-import org.apache.juddi.model.Publisher;
 import org.apache.juddi.model.UddiEntityPublisher;
 import org.uddi.v3_service.DispositionReportFaultMessage;
 
@@ -46,7 +45,7 @@
 		if (modelAuthToken.getTokenState() == AUTHTOKEN_RETIRED)
 			throw new AuthTokenRequiredException(new ErrorMessage("errors.auth.AuthInvalid"));
 		
-		UddiEntityPublisher entityPublisher = em.find(Publisher.class, modelAuthToken.getPublisherId());
+		UddiEntityPublisher entityPublisher = em.find(UddiEntityPublisher.class, modelAuthToken.getPublisherId());
 		if (entityPublisher == null)
 			throw new AuthTokenRequiredException(new ErrorMessage("errors.auth.AuthInvalid"));
 		
@@ -55,7 +54,6 @@
 		modelAuthToken.setNumberOfUses(modelAuthToken.getNumberOfUses() + 1);
 		
 		return entityPublisher;
-			
 				   
 	}
 

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/Property.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/Property.java?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/Property.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/Property.java Tue Nov 11 16:47:03 2008
@@ -15,6 +15,7 @@
 	public final static String JUDDI_UUID_GENERATOR              ="juddi.uuidgen";
 	public final static String JUDDI_UUID_COMMAND                ="juddi.uuidgenCommand";
 	public final static String JUDDI_CRYPTOR                     ="juddi.cryptor";
+	public final static String JUDDI_KEYGENERATOR                ="juddi.keygenerator";
 	public final static String JUDDI_VALIDATOR                   ="juddi.validator";
 	public final static String JUDDI_USERSFILE                   ="juddi.usersfile";
 }

Added: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/DefaultKeyGenerator.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/DefaultKeyGenerator.java?rev=713229&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/DefaultKeyGenerator.java (added)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/DefaultKeyGenerator.java Tue Nov 11 16:47:03 2008
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2001-2008 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.keygen;
+
+import org.apache.juddi.uuidgen.UUIDGenFactory;
+import org.apache.juddi.uuidgen.UUIDGen;
+
+/**
+ * The default jUDDI key generator.  Generates a key like this:
+ * 
+ * uddiScheme : RootDomain : UUID
+ * 
+ * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
+ */
+public class DefaultKeyGenerator implements KeyGenerator {
+
+	public String generate() {
+		UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();
+		return UDDI_SCHEME + PARTITION_SEPARATOR + ROOT_DOMAIN + PARTITION_SEPARATOR + uuidgen.uuidgen();
+	}
+}
\ No newline at end of file

Propchange: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/DefaultKeyGenerator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/KeyGenerator.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/KeyGenerator.java?rev=713229&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/KeyGenerator.java (added)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/KeyGenerator.java Tue Nov 11 16:47:03 2008
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2001-2008 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.keygen;
+
+
+/**
+ * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
+ */
+public interface KeyGenerator {
+	// TODO: This is temporary until JUDDI-155 is worked out.
+	public static String ROOT_DOMAIN = "juddi.apache.org";
+	
+	
+	public static String UDDI_SCHEME = "uddi";
+	public static String PARTITION_SEPARATOR = ":";
+	public static String KEYGENERATOR_SUFFIX = "keygenerator";
+
+	/*
+	 * Generates a key that is used to save a UDDI entity.
+	 */
+	public String generate();
+}
\ No newline at end of file

Propchange: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/KeyGenerator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/KeyGeneratorFactory.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/KeyGeneratorFactory.java?rev=713229&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/KeyGeneratorFactory.java (added)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/KeyGeneratorFactory.java Tue Nov 11 16:47:03 2008
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2001-2008 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.keygen;
+
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.juddi.config.AppConfig;
+import org.apache.juddi.config.Property;
+import org.apache.juddi.util.Loader;
+import org.apache.log4j.Logger;
+
+/**
+ * Used to create the org.apache.juddi.keygen.KeyGenerator implementation
+ * as specified by the 'juddi.keygenerator' property. Defaults to
+ * org.apache.juddi.cryptor.DefaultKeyGenerator if an implementation is not
+ * specified.
+ *
+ * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
+ */
+public abstract class KeyGeneratorFactory {
+	private static Logger log = Logger.getLogger(KeyGeneratorFactory.class);
+
+	// Key Generator default implementation
+	private static final String DEFAULT_IMPL = "org.apache.juddi.keygen.DefaultKeyGenerator";
+
+	// the shared Key Generator instance
+	private static KeyGenerator keyGenerator = null;
+
+	/*
+	 * Returns a new instance of a KeyGenerator.
+	 * 
+	 * @return KeyGenerator
+	 */
+	public static KeyGenerator getKeyGenerator() {
+		if (keyGenerator == null)
+			keyGenerator = createKeyGenerator();
+		return keyGenerator;
+	}
+
+	/*
+	 * Returns a new instance of a Cryptor.
+	 * 
+	 * @return Cryptor
+	 */
+	private static synchronized KeyGenerator createKeyGenerator() {
+		if (keyGenerator != null)
+			return keyGenerator;
+	
+		// grab class name of the Cryptor implementation to create
+		String className = DEFAULT_IMPL;
+		try {
+			// grab class name of the Authenticator implementation to create
+			className = AppConfig.getConfiguration().getString(Property.JUDDI_KEYGENERATOR, DEFAULT_IMPL);
+		}
+		catch(ConfigurationException ce) {
+			log.error("Configuration exception occurred retrieving: " + Property.JUDDI_KEYGENERATOR);
+		}
+		
+		// write the Cryptor implementation name to the log
+		log.debug("Key Generator Implementation = " + className);
+	
+		Class<?> keygenClass = null;
+		try {
+			// Use Loader to locate & load the Key Generator implementation
+			keygenClass = Loader.getClassForName(className);
+		}
+		catch(ClassNotFoundException e) {
+			log.error("The specified Key Generator class '" + className + "' was not found in classpath.");
+			log.error(e);
+		}
+	
+		try {
+			// try to instantiate the Key Generator implementation
+			keyGenerator = (KeyGenerator)keygenClass.newInstance();
+		}
+		catch(Exception e) {
+			log.error("Exception while attempting to instantiate the implementation of Key Generator: " + keygenClass.getName() + "\n" + e.getMessage());
+			log.error(e);
+		}
+	
+		return keyGenerator;
+	}
+}
\ No newline at end of file

Propchange: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/keygen/KeyGeneratorFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyGeneratorKey.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyGeneratorKey.java?rev=713229&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyGeneratorKey.java (added)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyGeneratorKey.java Tue Nov 11 16:47:03 2008
@@ -0,0 +1,81 @@
+package org.apache.juddi.model;
+/*
+ * Copyright 2001-2008 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.
+ */
+
+import javax.persistence.AttributeOverride;
+import javax.persistence.AttributeOverrides;
+import javax.persistence.Column;
+import javax.persistence.EmbeddedId;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+/**
+ * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
+ */
+@Entity
+@Table(name = "uddi_publisher_keygenerators")
+public class KeyGeneratorKey implements java.io.Serializable {
+
+	private static final long serialVersionUID = 1L;
+	private KeyGeneratorKeyId id;
+	private UddiEntityPublisher publisher;
+	private String keygenTModelKey;
+
+	public KeyGeneratorKey() {
+	}
+
+	public KeyGeneratorKey(KeyGeneratorKeyId id, UddiEntityPublisher publisher, String keygenTModelKey) {
+		this.id = id;
+		this.publisher = publisher;
+		this.keygenTModelKey = keygenTModelKey;
+	}
+
+	@EmbeddedId
+	@AttributeOverrides({
+			@AttributeOverride(name = "publisherId", column = @Column(name = "publisher_id", nullable = false, length = 255)),
+			@AttributeOverride(name = "keygeneratorId", column = @Column(name = "keygenerator_id", nullable = false))})
+	public KeyGeneratorKeyId getId() {
+		return this.id;
+	}
+
+	public void setId(KeyGeneratorKeyId id) {
+		this.id = id;
+	}
+
+	@ManyToOne(fetch = FetchType.LAZY)
+	@JoinColumn(name = "publisher_id", nullable = false, insertable = false, updatable = false)
+	public UddiEntityPublisher getPublisher() {
+		return this.publisher;
+	}
+
+	public void setPublisher(UddiEntityPublisher publisher) {
+		this.publisher = publisher;
+	}
+
+	@Column(name = "keygen_tmodel_key", length = 255)
+	public String getKeygenTModelKey() {
+		return this.keygenTModelKey;
+	}
+
+	public void setKeygenTModelKey(String keygenTModelKey) {
+		this.keygenTModelKey = keygenTModelKey;
+	}
+
+
+}

Propchange: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyGeneratorKey.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyGeneratorKeyId.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyGeneratorKeyId.java?rev=713229&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyGeneratorKeyId.java (added)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyGeneratorKeyId.java Tue Nov 11 16:47:03 2008
@@ -0,0 +1,83 @@
+package org.apache.juddi.model;
+/*
+ * Copyright 2001-2008 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.
+ */
+
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
+
+/**
+ * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
+ */
+@Embeddable
+public class KeyGeneratorKeyId implements java.io.Serializable {
+
+	private static final long serialVersionUID = 1L;
+	private String publisherId;
+	private int keygeneratorId;
+
+	public KeyGeneratorKeyId() {
+	}
+
+	public KeyGeneratorKeyId(String publisherId, int keygeneratorId) {
+		this.publisherId = publisherId;
+		this.keygeneratorId = keygeneratorId;
+	}
+
+	@Column(name = "publisher_id", nullable = false, length = 20)
+	public String getPublisherId() {
+		return this.publisherId;
+	}
+
+	public void setPublisherId(String publisherId) {
+		this.publisherId = publisherId;
+	}
+
+	@Column(name = "category_id", nullable = false)
+	public int getKeygeneratorId() {
+		return this.keygeneratorId;
+	}
+
+	public void setKeygeneratorId(int keygeneratorId) {
+		this.keygeneratorId = keygeneratorId;
+	}
+
+	public boolean equals(Object other) {
+		if ((this == other))
+			return true;
+		if ((other == null))
+			return false;
+		if (!(other instanceof KeyGeneratorKeyId))
+			return false;
+		KeyGeneratorKeyId castOther = (KeyGeneratorKeyId) other;
+
+		return ((this.getPublisherId() == castOther.getPublisherId()) || (this.getPublisherId() != null
+				&& castOther.getPublisherId() != null && this.getPublisherId()
+				.equals(castOther.getPublisherId())))
+				&& (this.getKeygeneratorId() == castOther.getKeygeneratorId());
+	}
+
+	public int hashCode() {
+		int result = 17;
+
+		result = 37
+				* result
+				+ (getPublisherId() == null ? 0 : this.getPublisherId()
+						.hashCode());
+		result = 37 * result + this.getKeygeneratorId();
+		return result;
+	}
+
+}

Propchange: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyGeneratorKeyId.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Publisher.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Publisher.java?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Publisher.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Publisher.java Tue Nov 11 16:47:03 2008
@@ -15,10 +15,12 @@
  * limitations under the License.
  */
 
+import java.util.Set;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.Table;
 import javax.persistence.Transient;
+import javax.persistence.PrimaryKeyJoinColumn;
 
 /**
  * @author <a href="mailto:kurt@apache.org">Kurt T Stam</a>
@@ -26,6 +28,7 @@
  */
 @Entity
 @Table(name = "publisher")
+@PrimaryKeyJoinColumn(name = "publisher_id")
 public class Publisher extends UddiEntityPublisher implements java.io.Serializable {
 
 	private static final long serialVersionUID = 1L;
@@ -48,7 +51,8 @@
 	public Publisher(String publisherId, String publisherName,
 			String emailAddress, String isAdmin, String isEnabled,
 			Integer maxBusinesses, Integer maxServicesPerBusiness,
-			Integer maxBindingsPerService, Integer maxTmodels) {
+			Integer maxBindingsPerService, Integer maxTmodels,
+			Set<KeyGeneratorKey> keyGenerators) {
 		this.publisherId = publisherId;
 		this.publisherName = publisherName;
 		this.emailAddress = emailAddress;
@@ -58,6 +62,7 @@
 		this.maxServicesPerBusiness = maxServicesPerBusiness;
 		this.maxBindingsPerService = maxBindingsPerService;
 		this.maxTmodels = maxTmodels;
+		this.keyGeneratorKeys = keyGenerators;
 	}
 
 

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/UddiEntityPublisher.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/UddiEntityPublisher.java?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/UddiEntityPublisher.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/UddiEntityPublisher.java Tue Nov 11 16:47:03 2008
@@ -17,17 +17,42 @@
 
 package org.apache.juddi.model;
 
+import java.util.HashSet;
+import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.Vector;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.persistence.CascadeType;
 import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
 import javax.persistence.Id;
-import javax.persistence.MappedSuperclass;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import javax.persistence.Table;
+
+import org.apache.juddi.query.util.DynamicQuery;
+import org.apache.juddi.validation.ValidateUDDIKey;
+import org.apache.juddi.keygen.KeyGenerator;
+import org.uddi.v3_service.DispositionReportFaultMessage;
 
 /**
  * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
  */
-@MappedSuperclass
+@Entity
+@Table(name = "uddi_publisher")
+@Inheritance(strategy = InheritanceType.JOINED)
 public abstract class UddiEntityPublisher {
+	
 
 	protected String publisherId;
+	protected Set<KeyGeneratorKey> keyGeneratorKeys = new HashSet<KeyGeneratorKey>(0);
 
 	@Id
 	@Column(name = "publisher_id", nullable = false, length = 20)
@@ -39,6 +64,28 @@
 		this.publisherId = publisherId;
 	}
 	
+	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "publisher")
+	@OrderBy
+	public Set<KeyGeneratorKey> getKeyGeneratorKeys() {
+		return this.keyGeneratorKeys;
+	}
+	public void setKeyGeneratorKeys(Set<KeyGeneratorKey> keyGeneratorKeys) {
+		this.keyGeneratorKeys = keyGeneratorKeys;
+	}
+	public void addKeyGeneratorKey(String keygenTModelKey) {
+		KeyGeneratorKeyId keyGenKeyId = new KeyGeneratorKeyId(this.publisherId, this.keyGeneratorKeys.size());
+		KeyGeneratorKey keyGenKey = new KeyGeneratorKey(keyGenKeyId, this, keygenTModelKey);
+		keyGeneratorKeys.add(keyGenKey);
+	}
+	public void removeKeyGeneratorKey(String keygenTModelKey) {
+		// Must use iterator to remove while iterating.
+		Iterator<KeyGeneratorKey> keyGenItr = keyGeneratorKeys.iterator();
+		while(keyGenItr.hasNext()) {
+			KeyGeneratorKey keyGen = keyGenItr.next();
+			if (keyGen.getKeygenTModelKey().equalsIgnoreCase(keygenTModelKey))
+				keyGeneratorKeys.remove(keyGen);
+		}
+	}
 	
 	public boolean isOwner(UddiEntity entity){
 		boolean ret = false;
@@ -48,4 +95,79 @@
 		}
 		return ret;
 	}
+
+	public boolean isValidPublisherKey(String key) {
+		if (key == null)
+			return false;
+
+		String keyPartition = key.substring(0, key.lastIndexOf(KeyGenerator.PARTITION_SEPARATOR) - 1);
+		
+		for (KeyGeneratorKey keyGenKey : keyGeneratorKeys) {
+			String keyGenPartition = keyGenKey.getKeygenTModelKey().substring(0, key.lastIndexOf(KeyGenerator.PARTITION_SEPARATOR) - 1);
+			if (keyGenPartition.equalsIgnoreCase(keyPartition))
+				return true;
+		}
+		return false;
+	}
+	
+	/*
+	 * This method will check if the given key generator key is available for this publisher.  The idea is to make sure that the key generator
+	 * and all its sub-partitions are not already taken by another publisher.
+	 */
+	public boolean isKeyGeneratorAvailable(EntityManager em, String keygenKey) throws DispositionReportFaultMessage {
+
+		// First make sure the key is a valid UDDIv3 key
+		ValidateUDDIKey.validateUDDIv3KeyGeneratorKey(keygenKey);
+		
+		String keyGenSuffix = (KeyGenerator.PARTITION_SEPARATOR + KeyGenerator.KEYGENERATOR_SUFFIX).toUpperCase();
+		if (!(keygenKey.toUpperCase().endsWith(keyGenSuffix)))
+			return false;
+		
+		String partition = keygenKey.toUpperCase().substring(0, keygenKey.length() - keyGenSuffix.length());
+		
+		StringTokenizer tokenizer = new StringTokenizer(partition, KeyGenerator.PARTITION_SEPARATOR);
+		// Must have 3 or more tokens as the first is the uddi scheme and the second is the domain key.
+		if (tokenizer.countTokens() < 3)
+			return false;
+		
+		Vector<DynamicQuery.Parameter> params = new Vector<DynamicQuery.Parameter>(0);
+		String subPartition = "";
+		for (int count = 0; tokenizer.hasMoreElements(); count++) {
+			String nextToken = (String)tokenizer.nextElement();
+			if (count == 0) {
+				subPartition = nextToken;
+			}
+			else {
+				subPartition = subPartition + KeyGenerator.PARTITION_SEPARATOR + nextToken;
+				if (count > 1) {
+					DynamicQuery.Parameter param = new DynamicQuery.Parameter("UPPER(k.keygenTModelKey)", 
+																			  subPartition + DynamicQuery.WILDCARD, 
+																			  DynamicQuery.PREDICATE_LIKE);
+					params.add(param);
+				}
+			}
+		}
+
+		if (params.size() == 0)
+			return false;
+
+		DynamicQuery checkTokensQry = new DynamicQuery();
+		checkTokensQry.append("select k.keygenTModelKey from KeyGeneratorKey k ");
+
+		DynamicQuery.Parameter pubParam = new DynamicQuery.Parameter("k.id.publisherId", 
+																	 this.publisherId, 
+																	 DynamicQuery.PREDICATE_NOTEQUALS);
+		checkTokensQry.WHERE().pad().appendGroupedAnd(pubParam).pad();
+		checkTokensQry.AND().pad();
+		checkTokensQry.appendGroupedOr(params.toArray(new DynamicQuery.Parameter[0])).pad();
+
+		Query qry = checkTokensQry.buildJPAQuery(em);
+		List<?> obj = qry.getResultList();
+		// If even one of the partitions are taken by another publisher, then the key generator is unavailable
+		if (obj != null && obj.size() > 0)
+			return false;
+		
+		return true;
+	}
+
 }

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/util/DynamicQuery.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/util/DynamicQuery.java?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/util/DynamicQuery.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/util/DynamicQuery.java Tue Nov 11 16:47:03 2008
@@ -34,6 +34,7 @@
 	public static String OPERATOR_OR = "or";
 	public static String OPERATOR_AND = "and";
 	public static String PREDICATE_EQUALS = "=";
+	public static String PREDICATE_NOTEQUALS = "!=";
 	public static String PREDICATE_LIKE = "like";
 	public static String PREDICATE_IN = "in";
 	public static String SORT_ASC = "asc";

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/util/JPAUtil.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/util/JPAUtil.java?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/util/JPAUtil.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/util/JPAUtil.java Tue Nov 11 16:47:03 2008
@@ -85,4 +85,19 @@
 		return ret;
 		
 	}
+	
+	public static void runUpdateQuery(String qry) {
+		EntityManager em = PersistenceManager.getEntityManager();
+		EntityTransaction tx = em.getTransaction();
+		tx.begin();
+		
+		Query q = em.createQuery(qry);
+		q.executeUpdate();
+
+		tx.commit();
+		em.close();
+		
+		
+	}
+
 }

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java Tue Nov 11 16:47:03 2008
@@ -36,6 +36,8 @@
 import org.apache.juddi.api.datatype.SavePublisher;
 import org.apache.juddi.api.datatype.DeletePublisher;
 
+import org.apache.juddi.keygen.KeyGeneratorFactory;
+import org.apache.juddi.keygen.KeyGenerator;
 import org.apache.juddi.model.UddiEntityPublisher;
 import org.apache.juddi.model.Publisher;
 import org.apache.juddi.model.UddiEntity;
@@ -159,6 +161,10 @@
 			
 			if (!publisher.isOwner((UddiEntity)obj))
 				throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
+			
+			// Must check if tModel is a Key Generator, and if so, removed from publisher collection
+			if (entityKey.toUpperCase().contains(KeyGenerator.KEYGENERATOR_SUFFIX.toUpperCase()))
+				publisher.removeKeyGeneratorKey(entityKey);
 		}
 	}
 
@@ -260,14 +266,11 @@
 		boolean entityExists = false;
 		String entityKey = businessEntity.getBusinessKey();
 		if (entityKey == null || entityKey.length() == 0) {
-			// TODO: apply key generation strategy
-			entityKey = "";
+			KeyGenerator keyGen = KeyGeneratorFactory.getKeyGenerator();
+			entityKey = keyGen.generate();
 			businessEntity.setBusinessKey(entityKey);
 		}
 		else {
-			// TODO: Test that key value is valid for publisher
-			//throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));
-
 			Object obj = em.find(org.apache.juddi.model.BusinessEntity.class, entityKey);
 			if (obj != null) {
 				entityExists = true;
@@ -276,6 +279,15 @@
 				if (!publisher.isOwner((UddiEntity)obj))
 					throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
 			}
+			else {
+				// Inside this block, we have a key proposed by the publisher on a new entity
+
+				// Validate key and then check to see that the proposed key is valid for this publisher
+				ValidateUDDIKey.validateUDDIv3Key(entityKey);
+				if (!publisher.isValidPublisherKey(entityKey))
+					throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));
+
+			}
 		}
 
 		if (!entityExists) {
@@ -358,14 +370,11 @@
 
 			boolean entityExists = false;
 			if (entityKey == null || entityKey.length() == 0) {
-				// TODO: apply key generation strategy
-				entityKey = "";
+				KeyGenerator keyGen = KeyGeneratorFactory.getKeyGenerator();
+				entityKey = keyGen.generate();
 				businessService.setServiceKey(entityKey);
 			}
 			else {
-				// TODO: Test that key value is valid for publisher
-				//throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));
-				
 				Object obj = em.find(org.apache.juddi.model.BusinessService.class, entityKey);
 				if (obj != null) {
 					entityExists = true;
@@ -380,6 +389,15 @@
 						throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
 					
 				}
+				else {
+					// Inside this block, we have a key proposed by the publisher on a new entity
+
+					// Validate key and then check to see that the proposed key is valid for this publisher
+					ValidateUDDIKey.validateUDDIv3Key(entityKey);
+					if (!publisher.isValidPublisherKey(entityKey))
+						throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));
+
+				}
 				
 			}
 			
@@ -459,13 +477,11 @@
 		
 		boolean entityExists = false;
 		if (entityKey == null || entityKey.length() == 0) {
-			// TODO: apply key generation strategy
-			entityKey = "";
+			KeyGenerator keyGen = KeyGeneratorFactory.getKeyGenerator();
+			entityKey = keyGen.generate();
+			bindingTemplate.setBindingKey(entityKey);
 		}
 		else {
-			// TODO: Test that key value is valid for publisher
-			//throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));
-			
 			Object obj = em.find(org.apache.juddi.model.BindingTemplate.class, entityKey);
 			if (obj != null) {
 				entityExists = true;
@@ -480,6 +496,15 @@
 					throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
 
 			}
+			else {
+				// Inside this block, we have a key proposed by the publisher on a new entity
+
+				// Validate key and then check to see that the proposed key is valid for this publisher
+				ValidateUDDIKey.validateUDDIv3Key(entityKey);
+				if (!publisher.isValidPublisherKey(entityKey))
+					throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));
+
+			}
 			
 		}
 		
@@ -530,14 +555,11 @@
 		boolean entityExists = false;
 		String entityKey = tModel.getTModelKey();
 		if (entityKey == null || entityKey.length() == 0) {
-			// TODO: apply key generation strategy
-			entityKey = "";
+			KeyGenerator keyGen = KeyGeneratorFactory.getKeyGenerator();
+			entityKey = keyGen.generate();
 			tModel.setTModelKey(entityKey);
 		}
 		else {
-			// TODO: Test that key value is valid for publisher
-			//throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));
-
 			Object obj = em.find(org.apache.juddi.model.BusinessEntity.class, entityKey);
 			if (obj != null) {
 				entityExists = true;
@@ -546,6 +568,30 @@
 				if (!publisher.isOwner((UddiEntity)obj))
 					throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
 			}
+			else {
+				// Inside this block, we have a key proposed by the publisher on a new entity
+				
+				// First test to see if this is a Key Generator tModel. The keyGenerator suffix appearing in the key is the indicator, since this is not
+				// allowed *unless* it's a key generator.
+				if (entityKey.toUpperCase().contains(KeyGenerator.KEYGENERATOR_SUFFIX.toUpperCase())) {
+					ValidateUDDIKey.validateUDDIv3KeyGeneratorTModel(tModel);
+					
+					// It's a valid Key Generator, but is it available for this publisher?
+					if (!publisher.isKeyGeneratorAvailable(em, entityKey))
+						throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));
+					else {
+						// The key generator is available, must now add it to the publisher's key generators.
+						publisher.addKeyGeneratorKey(entityKey);
+					}
+				
+				}
+				else {
+					// If not a key generator, then simply validate key and then check to see that the proposed key is valid for this publisher
+					ValidateUDDIKey.validateUDDIv3Key(entityKey);
+					if (!publisher.isValidPublisherKey(entityKey))
+						throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));
+				}
+			}
 		}
 
 		if (!entityExists) {

Added: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidateUDDIKey.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidateUDDIKey.java?rev=713229&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidateUDDIKey.java (added)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidateUDDIKey.java Tue Nov 11 16:47:03 2008
@@ -0,0 +1,166 @@
+/*
+ * Copyright 2001-2008 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;
+
+import java.util.List;
+import java.util.StringTokenizer;
+
+import javax.xml.bind.JAXBElement;
+
+import org.uddi.v3_service.DispositionReportFaultMessage;
+import org.apache.juddi.keygen.KeyGenerator;
+import org.apache.juddi.error.ErrorMessage;
+import org.apache.juddi.error.InvalidKeyPassedException;
+import org.apache.juddi.error.ValueNotAllowedException;
+
+/**
+ * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
+ */
+public class ValidateUDDIKey {
+
+	public static void validateUDDIv3Key(String key) throws DispositionReportFaultMessage {
+		if (key == null)
+			throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NullKeys"));
+		
+		key = key.trim();
+		if (key.endsWith(KeyGenerator.PARTITION_SEPARATOR))
+			throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));
+		
+		StringTokenizer tokenizer = new StringTokenizer(key.toLowerCase(), KeyGenerator.PARTITION_SEPARATOR);
+		int tokensCount = tokenizer.countTokens();
+		if(tokensCount <= 1)
+			throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));
+		for(int count = 0; tokenizer.hasMoreTokens(); count++) {
+			String nextToken = tokenizer.nextToken();
+
+
+			if (count == 0) {
+				if (!ValidateUDDIKey.isValidUDDIScheme(nextToken))
+					throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));
+			}
+			else if (count == 1) {
+				if(!ValidateUDDIKey.isValidDomainKey(nextToken))
+					throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));
+				
+				// TODO: This is temporary until JUDDI-155 is worked out.
+				if (!org.apache.juddi.keygen.KeyGenerator.ROOT_DOMAIN.equalsIgnoreCase(nextToken))
+					throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));
+
+			}
+			else {
+				if (!isValidKSS(nextToken))
+					throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));
+			}
+		}
+	}
+
+	public static void validateUDDIv3KeyGeneratorKey(String key) throws DispositionReportFaultMessage {
+		if (key == null)
+			throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NullKeys"));
+		
+		if ( !(key.toUpperCase().endsWith(KeyGenerator.KEYGENERATOR_SUFFIX.toUpperCase())) )
+			throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.KeyGenSuffix", key));
+		
+		validateUDDIv3Key(key.substring(0, key.lastIndexOf(KeyGenerator.PARTITION_SEPARATOR)- 1));
+	}
+	
+	public static void validateUDDIv3KeyGeneratorTModel(org.uddi.api_v3.TModel tModel) throws DispositionReportFaultMessage {
+		if (tModel == null)
+			throw new ValueNotAllowedException(new ErrorMessage("errors.tmodel.NullInput"));
+		
+		validateUDDIv3KeyGeneratorKey(tModel.getTModelKey());
+
+		// A key generator key should have exactly one category and it's key value should be 'keyGenerator'
+		org.uddi.api_v3.CategoryBag categories = tModel.getCategoryBag();
+		if (categories != null) {
+			List<JAXBElement<?>> elems = categories.getContent();
+			if (elems != null && elems.size() == 1) {
+				JAXBElement<?> elem = elems.get(0);
+				if (elem != null) {
+					Object obj = elem.getValue();
+					if (obj != null && obj instanceof org.uddi.api_v3.KeyedReference) {
+						String keyedValue = ((org.uddi.api_v3.KeyedReference)obj).getKeyValue();
+						if (keyedValue != null) {
+							if (keyedValue.equalsIgnoreCase(KeyGenerator.KEYGENERATOR_SUFFIX))
+								return;
+						}
+					}
+				}
+			}
+		}
+
+		throw new ValueNotAllowedException(new ErrorMessage("errors.tmodel.keygenerator.BadCategory"));
+	}
+
+	private static boolean isValidUDDIScheme(String token) {
+		if (token == null)
+			return false;
+		
+		if (!KeyGenerator.UDDI_SCHEME.equalsIgnoreCase(token))
+			return false;
+
+		return true;
+
+	}
+	
+	private static boolean isValidDomainKey(String token) {
+		if(token.indexOf("..") != -1)
+			return false;
+
+		StringTokenizer tokenizer = new StringTokenizer(token, ".");
+		int tokensCount = tokenizer.countTokens();
+		for(int i = 0; tokenizer.hasMoreTokens(); i++) {
+			String domainPart = tokenizer.nextToken();
+			if(i == tokensCount - 1) {
+				if(!isValidTopLabel(domainPart)) {
+					return false;
+				}
+			} else if(!isValidDomainLabel(domainPart)) {
+				return false;
+			}
+		}
+		return true;
+	}
+	
+
+	private static boolean isValidDomainLabel(String token) {
+		char[] chars = token.toCharArray();
+		for(int i = 0; i < chars.length; i++) {
+			char c = chars[i];
+			if(c != '-' && !Character.isLetterOrDigit(c)) {
+				return false;
+			}
+		}
+		return true;
+	}
+
+	private static boolean isValidTopLabel(String token) {
+		return Character.isLetter(token.charAt(0)) && (token.length() == 1 || isValidDomainLabel(token.substring(1)));
+	}
+	
+	private static boolean isValidKSS(String token) {
+		if (token.length() == 0)
+			return false;
+
+		// The key generator suffix is a reserved word and cannot be found in any part of the KSS 
+		if (token.equalsIgnoreCase(KeyGenerator.KEYGENERATOR_SUFFIX))
+			return false;
+
+		return true;
+	}
+}

Propchange: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidateUDDIKey.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/juddi.properties
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/juddi.properties?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/juddi.properties (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/juddi.properties Tue Nov 11 16:47:03 2008
@@ -41,6 +41,9 @@
 #
 # jUDDI Validator to use
 juddi.validator=org.apache.juddi.validator.DefaultValidator
+#
+# jUDDI Key Generator to use
+juddi.keygeneratorr=org.apache.juddi.keygen.KeyGenerator
 
 
 

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/messages_en.properties
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/messages_en.properties?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/messages_en.properties (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/messages_en.properties Tue Nov 11 16:47:03 2008
@@ -51,12 +51,16 @@
 E_unvalidatable=
 E_userMismatch=
 E_valueNotAllowed=
+E_keyUnavailable=Key is unavailable
 
 #-- General error messages
 errors.Unspecified=An unspecified error occurred
 errors.NullInput=No input was provided for this API call
 errors.keyunavailable.BadPartition=The proposed key is not within the partition defined by owning publisher
 errors.keyunavailable.KeyExists=The key used for the save operation already exists.  Another key must be chosen
+errors.invalidkey.NullKey=The key cannot be null
+errors.invalidkey.MalformedKey=The passed key does not conform to UDDI v3 rules
+errors.invalidkey.KeyGenSuffix=The passed key generator key does not end with the appropriate suffix
 errors.invalidkey.NoKeys=No keys passed.  At least one key must be passed
 errors.invalidkey.DuplicateKey=A duplicate key was passed.  No duplicates are allowed
 errors.invalidkey.PublisherNotFound=The publisher was not found for the given id
@@ -87,6 +91,7 @@
 errors.bindingtemplate.NoAccessPoint=A binding template must contain an access point
 errors.tmodel.NullInput=The tModel structure cannot be blank
 errors.tmodel.NoAccessPoint=A tModel must contain a name
+errors.tmodel.keygenerator.BadCategory=A Key Generator tModel must have exactly one 'types' category whose value is 'keyGenerator'
 errors.businessservices.NoInput=A businessServices collection must contain at least one businessService
 errors.bindingtemplates.NoInput=A bindingTemplates collection must contain at least one bindingTemplate
 errors.names.NoInput=At least one name is required

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/BusinessEntityTest.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/BusinessEntityTest.java?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/BusinessEntityTest.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/BusinessEntityTest.java Tue Nov 11 16:47:03 2008
@@ -16,16 +16,16 @@
 	private UDDIPublicationImpl publish = new UDDIPublicationImpl();
 	private UDDIInquiryImpl inquiry = new UDDIInquiryImpl();
 	
-	@Parameters({ "businessFile", "businessKey", "publisherId" })
+	@Parameters({ "sourceDir", "businessFile", "businessKey", "publisherId" })
 	@Test
-	public void saveBusiness(String businessFile, String businessKey, String publisherId) {
+	public void saveBusiness(String sourceDir, String businessFile, String businessKey, String publisherId) {
 		try {
 			String authInfo = UDDIApiTestHelper.getAuthToken(publisherId);
 			
 			SaveBusiness sb = new SaveBusiness();
 			sb.setAuthInfo(authInfo);
 
-			BusinessEntity beIn = (BusinessEntity)UDDIApiTestHelper.buildEntityFromDoc(businessFile, "org.uddi.api_v3");
+			BusinessEntity beIn = (BusinessEntity)UDDIApiTestHelper.buildEntityFromDoc(sourceDir + businessFile, "org.uddi.api_v3");
 			sb.getBusinessEntity().add(beIn);
 			publish.saveBusiness(sb);
 	

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/BusinessServiceTest.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/BusinessServiceTest.java?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/BusinessServiceTest.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/BusinessServiceTest.java Tue Nov 11 16:47:03 2008
@@ -20,9 +20,9 @@
 	private UDDIPublicationImpl publish = new UDDIPublicationImpl();
 	private UDDIInquiryImpl inquiry = new UDDIInquiryImpl();
 
-	@Parameters({ "serviceFile", "serviceKey", "publisherId" })
+	@Parameters({ "sourceDir", "serviceFile", "serviceKey", "publisherId" })
 	@Test
-	public void saveService(String serviceFile, String serviceKey, String publisherId) {
+	public void saveService(String sourceDir, String serviceFile, String serviceKey, String publisherId) {
 		try {
 			String authInfo = UDDIApiTestHelper.getAuthToken(publisherId);
 
@@ -30,7 +30,7 @@
 			SaveService ss = new SaveService();
 			ss.setAuthInfo(authInfo);
 			
-			org.uddi.api_v3.BusinessService bsIn = (org.uddi.api_v3.BusinessService)UDDIApiTestHelper.buildEntityFromDoc(serviceFile, "org.uddi.api_v3");
+			org.uddi.api_v3.BusinessService bsIn = (org.uddi.api_v3.BusinessService)UDDIApiTestHelper.buildEntityFromDoc(sourceDir + serviceFile, "org.uddi.api_v3");
 			ss.getBusinessService().add(bsIn);
 			publish.saveService(ss);
 			

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/PublisherTest.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/PublisherTest.java?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/PublisherTest.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/PublisherTest.java Tue Nov 11 16:47:03 2008
@@ -14,23 +14,24 @@
 import org.uddi.v3_service.DispositionReportFaultMessage;
 
 public class PublisherTest {
-	private static final String ADMIN_PUBID = "admin";
 	
 	private UDDIPublicationImpl publish = new UDDIPublicationImpl();
 	private UDDIInquiryImpl inquiry = new UDDIInquiryImpl();
 	
-	@Parameters({ "publisherFile", "publisherId" })
+	@Parameters({ "sourceDir", "publisherFile", "publisherId" })
 	@Test
-	public void savePublisher(String publisherFile, String publisherId) {
+	public void savePublisher(String sourceDir, String publisherFile, String publisherId) {
 		try {
-			// An admin publisher must exist to add publisher accounts
-			UDDIApiTestHelper.addAdminPublisher(ADMIN_PUBID);
+			// The root publisher with admin rights must exist to publish another publisher.
+			UDDIApiTestHelper.installRootPublisher(sourceDir);
+			// Install the root Key Generator
+			UDDIApiTestHelper.installRootPublisherKeyGen(sourceDir);
 
-			String authInfo = UDDIApiTestHelper.getAuthToken(ADMIN_PUBID);
+			String authInfo = UDDIApiTestHelper.getAuthToken(UDDIApiTestHelper.ROOT_PUBLISHER);
 			
 			SavePublisher sp = new SavePublisher();
 			sp.setAuthInfo(authInfo);
-			Publisher pubIn = (Publisher)UDDIApiTestHelper.buildEntityFromDoc(publisherFile, "org.apache.juddi.api.datatype");
+			Publisher pubIn = (Publisher)UDDIApiTestHelper.buildEntityFromDoc(sourceDir + publisherFile, "org.apache.juddi.api.datatype");
 			sp.getPublisher().add(pubIn);
 			publish.savePublisher(sp);
 	
@@ -65,7 +66,7 @@
 	@Test
 	public void deletePublisher(String publisherId) {
 		try {
-			String authInfo = UDDIApiTestHelper.getAuthToken(ADMIN_PUBID);
+			String authInfo = UDDIApiTestHelper.getAuthToken(UDDIApiTestHelper.ROOT_PUBLISHER);
 			
 			// Delete the entity and make sure it is removed
 			DeletePublisher dp = new DeletePublisher();
@@ -74,7 +75,8 @@
 			dp.getPublisherId().add(publisherId);
 			publish.deletePublisher(dp);
 			
-			UDDIApiTestHelper.removeAdminPublisher(ADMIN_PUBID);
+			UDDIApiTestHelper.removeRootPublisherKeyGen();
+			UDDIApiTestHelper.removeRootPublisher();
 			UDDIApiTestHelper.removeAuthTokens();
 		}
 		catch(DispositionReportFaultMessage dr) {

Added: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/TModelTest.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/TModelTest.java?rev=713229&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/TModelTest.java (added)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/TModelTest.java Tue Nov 11 16:47:03 2008
@@ -0,0 +1,74 @@
+package org.apache.juddi.test;
+
+import java.util.List;
+import javax.xml.bind.JAXBException;
+
+import org.apache.juddi.api.impl.UDDIPublicationImpl;
+import org.apache.juddi.api.impl.UDDIInquiryImpl;
+import org.testng.Assert;
+import org.testng.annotations.*;
+import static junit.framework.Assert.assertEquals;
+
+import org.uddi.api_v3.*;
+import org.uddi.v3_service.DispositionReportFaultMessage;
+
+public class TModelTest {
+	private UDDIPublicationImpl publish = new UDDIPublicationImpl();
+	private UDDIInquiryImpl inquiry = new UDDIInquiryImpl();
+	
+	@Parameters({ "sourceDir", "tmodelFile", "tmodelKey", "publisherId" })
+	@Test
+	public void saveTModel(String sourceDir, String tmodelFile, String tmodelKey, String publisherId) {
+		try {
+			String authInfo = UDDIApiTestHelper.getAuthToken(publisherId);
+			
+			SaveTModel st = new SaveTModel();
+			st.setAuthInfo(authInfo);
+
+			TModel tmIn = (TModel)UDDIApiTestHelper.buildEntityFromDoc(sourceDir + tmodelFile, "org.uddi.api_v3");
+			st.getTModel().add(tmIn);
+			publish.saveTModel(st);
+	
+			// Now get the entity and check the values
+			GetTModelDetail gt = new GetTModelDetail();
+			gt.getTModelKey().add(tmodelKey);
+			TModelDetail td = inquiry.getTModelDetail(gt);
+			List<TModel> tmOutList = td.getTModel();
+			TModel tmOut = tmOutList.get(0);
+
+			assertEquals(tmIn.getTModelKey(), tmOut.getTModelKey());
+
+			assertEquals(tmIn.getName().getLang(), tmOut.getName().getLang());
+			assertEquals(tmIn.getName().getValue(), tmOut.getName().getValue());
+			UDDIApiTestHelper.checkDescriptions(tmIn.getDescription(), tmOut.getDescription());
+			UDDIApiTestHelper.checkCategories(tmIn.getCategoryBag(), tmOut.getCategoryBag());
+		}
+		catch(DispositionReportFaultMessage dr) {
+			Assert.fail("No exception should be thrown", dr);
+		}
+		catch(JAXBException je) {
+			Assert.fail("No exception should be thrown", je);
+		}
+
+	}
+
+	@Parameters({ "tmodelKey", "publisherId" })
+	@Test
+	public void deleteTModel(String tmodelKey, String publisherId) {
+		try {
+			String authInfo = UDDIApiTestHelper.getAuthToken(publisherId);
+			
+			// Delete the entity and make sure it is removed
+			DeleteTModel dt = new DeleteTModel();
+			dt.setAuthInfo(authInfo);
+			
+			dt.getTModelKey().add(tmodelKey);
+			publish.deleteTModel(dt);
+		}
+		catch(DispositionReportFaultMessage dr) {
+			Assert.fail("No exception should be thrown", dr);
+		}
+		
+	}
+
+}

Propchange: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/TModelTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/UDDIApiTestHelper.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/UDDIApiTestHelper.java?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/UDDIApiTestHelper.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/UDDIApiTestHelper.java Tue Nov 11 16:47:03 2008
@@ -15,13 +15,17 @@
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.Marshaller;
 
+import org.apache.juddi.api.datatype.Publisher;
 import org.apache.juddi.api.impl.UDDISecurityImpl;
 import org.apache.juddi.query.PersistenceManager;
+import org.apache.juddi.mapping.MappingApiToModel;
 import org.uddi.api_v3.*;
 import org.uddi.v3_service.DispositionReportFaultMessage;
 
 public class UDDIApiTestHelper {
 
+	public static final String ROOT_PUBLISHER = "root";
+	public static final String ROOT_PUBLISHER_KEYGEN = "uddi:juddi.apache.org:keygenerator";
 
 	public static Object buildEntityFromDoc(String fileName, String thePackage) throws JAXBException {
 		JAXBContext jc = JAXBContext.newInstance(thePackage);
@@ -37,37 +41,74 @@
 		
 	}
 
-	public static void addAdminPublisher(String pubId) {
-		org.apache.juddi.model.Publisher pub = new org.apache.juddi.model.Publisher();
-		pub.setPublisherId(pubId);
-		pub.setPublisherName("Administrator");
-		pub.setIsAdmin("true");
+	public static void installRootPublisher(String sourceDir) throws JAXBException, DispositionReportFaultMessage {
+		Publisher apiPub = (Publisher)buildEntityFromDoc(sourceDir + "root_Publisher.xml", "org.apache.juddi.api.datatype");
+		
+		org.apache.juddi.model.Publisher modelPub = new org.apache.juddi.model.Publisher();
+		
+		MappingApiToModel.mapPublisher(apiPub, modelPub);
 		
 		EntityManager em = PersistenceManager.getEntityManager();
 		EntityTransaction tx = em.getTransaction();
 		tx.begin();
 
-		em.persist(pub);
+		em.persist(modelPub);
 		
 		tx.commit();
 		em.close();
 
 	}
-	
-	public static void removeAdminPublisher(String pubId) {
+
+	public static void installRootPublisherKeyGen(String sourceDir) throws JAXBException, DispositionReportFaultMessage {
+
+		TModel apiTModel = (TModel)buildEntityFromDoc(sourceDir + "root_tModelKeyGen.xml", "org.uddi.api_v3");
+		
+		org.apache.juddi.model.Tmodel modelTModel = new org.apache.juddi.model.Tmodel();
+
+		MappingApiToModel.mapTModel(apiTModel, modelTModel);
 		
 		EntityManager em = PersistenceManager.getEntityManager();
 		EntityTransaction tx = em.getTransaction();
 		tx.begin();
 
-		Object obj = em.find(org.apache.juddi.model.Publisher.class, pubId);
-		em.remove(obj);
+		em.persist(modelTModel);
 		
 		tx.commit();
 		em.close();
 
 	}
+
 	
+	public static void removeRootPublisher() {
+		
+		EntityManager em = PersistenceManager.getEntityManager();
+		EntityTransaction tx = em.getTransaction();
+		tx.begin();
+
+		Object obj = em.find(org.apache.juddi.model.UddiEntityPublisher.class, ROOT_PUBLISHER);
+		if (obj != null)
+			em.remove(obj);
+		
+		tx.commit();
+		em.close();
+
+	}
+
+	public static void removeRootPublisherKeyGen() {
+		
+		EntityManager em = PersistenceManager.getEntityManager();
+		EntityTransaction tx = em.getTransaction();
+		tx.begin();
+
+		Object obj = em.find(org.apache.juddi.model.Tmodel.class, ROOT_PUBLISHER_KEYGEN);
+		if (obj != null)
+			em.remove(obj);
+		
+		tx.commit();
+		em.close();
+
+	}
+
 	public static void removeAuthTokens() {
 		
 		EntityManager em = PersistenceManager.getEntityManager();

Propchange: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_Publisher.xml
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_businessEntity1.xml (from r711730, webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/businessEntity1.xml)
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_businessEntity1.xml?p2=webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_businessEntity1.xml&p1=webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/businessEntity1.xml&r1=711730&r2=713229&rev=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/businessEntity1.xml (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_businessEntity1.xml Tue Nov 11 16:47:03 2008
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<businessEntity xmlns="urn:uddi-org:api_v3" xmlns:xml="http://www.w3.org/XML/1998/namespace" businessKey="uddi:businessone.com">
+<businessEntity xmlns="urn:uddi-org:api_v3" xmlns:xml="http://www.w3.org/XML/1998/namespace" businessKey="uddi:juddi.apache.org:joepublisher:businessone">
   <discoveryURLs>
     <discoveryURL useType="home">http://www.businessone.com</discoveryURL>
     <discoveryURL useType="serviceList">http://www.businessone.com/services</discoveryURL>

Propchange: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_businessEntity1.xml
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_businessService1.xml (from r711730, webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/businessService1.xml)
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_businessService1.xml?p2=webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_businessService1.xml&p1=webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/businessService1.xml&r1=711730&r2=713229&rev=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/businessService1.xml (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_businessService1.xml Tue Nov 11 16:47:03 2008
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<businessService xmlns="urn:uddi-org:api_v3" xmlns:xml="http://www.w3.org/XML/1998/namespace" businessKey="uddi:businessone.com" serviceKey="uddi:businessone.com:services:serviceone">
+<businessService xmlns="urn:uddi-org:api_v3" xmlns:xml="http://www.w3.org/XML/1998/namespace" 
+     businessKey="uddi:juddi.apache.org:joepublisher:businessone" serviceKey="uddi:juddi.apache.org:joepublisher:serviceone">
   <name xml:lang="en">Service One</name>
   <name xml:lang="es">Servicio Uno</name>
   <description xml:lang="en">This is the description of service one.</description>
   <description xml:lang="es">Ésta es la descripción del servicio uno.</description>
   <bindingTemplates>
-    <bindingTemplate bindingKey="uddi:businessone.com:services:serviceone:accesspoint">
+    <bindingTemplate bindingKey="uddi:juddi.apache.org:joepublisher:bindingone">
       <description xml:lang="en">This is the access point for service one.</description>
       <accessPoint useType="endPoint">http://businessone.com/services/serviceone</accessPoint>
       <tModelInstanceDetails>

Propchange: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_businessService1.xml
------------------------------------------------------------------------------
    svn:mergeinfo = 

Added: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_tModelKeyGen.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_tModelKeyGen.xml?rev=713229&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_tModelKeyGen.xml (added)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_tModelKeyGen.xml Tue Nov 11 16:47:03 2008
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<tModel tModelKey="uddi:juddi.apache.org:joepublisher:KEYGENERATOR" xmlns="urn:uddi-org:api_v3">
+  <name>Joe Publisher's Key Generator</name>
+  <description>This is the key generator for Joe Publisher's UDDI entities!</description>
+  <overviewDoc>
+    <overviewURL useType="text">
+      http://uddi.org/pubs/uddi_v3.htm#keyGen</overviewURL>
+  </overviewDoc>
+  <categoryBag>
+    <keyedReference tModelKey="uddi:uddi.org:categorization:types" keyName="uddi-org:types:keyGenerator"
+      keyValue="keyGenerator" />
+  </categoryBag>
+</tModel>

Propchange: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/jpublisher_tModelKeyGen.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/root_Publisher.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/root_Publisher.xml?rev=713229&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/root_Publisher.xml (added)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/root_Publisher.xml Tue Nov 11 16:47:03 2008
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<publisher xmlns="urn:apache-org:juddi_v3" publisherId="root">
+  <publisherName>root publisher</publisherName>
+  <isAdmin>true</isAdmin>
+</publisher>
+

Propchange: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/root_Publisher.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/root_tModelKeyGen.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/root_tModelKeyGen.xml?rev=713229&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/root_tModelKeyGen.xml (added)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/root_tModelKeyGen.xml Tue Nov 11 16:47:03 2008
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<tModel tModelKey="uddi:juddi.apache.org:keygenerator" xmlns="urn:uddi-org:api_v3">
+  <name>uddi-org:keyGenerator</name>
+  <description>UDDI domain key generator</description>
+  <overviewDoc>
+    <overviewURL useType="text">
+      http://uddi.org/pubs/uddi_v3.htm#keyGen</overviewURL>
+  </overviewDoc>
+  <categoryBag>
+    <keyedReference tModelKey="uddi:uddi.org:categorization:types" keyName="uddi-org:types:keyGenerator"
+      keyValue="keyGenerator" />
+  </categoryBag>
+</tModel>

Propchange: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/test/root_tModelKeyGen.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/test/resources/suite-one.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/test/resources/suite-one.xml?rev=713229&r1=713228&r2=713229&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/test/resources/suite-one.xml (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/test/resources/suite-one.xml Tue Nov 11 16:47:03 2008
@@ -1,11 +1,19 @@
 <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
 <suite name="suite-one" verbose="1">
-  <parameter name="publisherFile" value="./src/test/java/org/apache/juddi/test/publisher1.xml" />
-  <parameter name="businessFile" value="./src/test/java/org/apache/juddi/test/businessEntity1.xml" />
-  <parameter name="serviceFile" value="./src/test/java/org/apache/juddi/test/businessService1.xml" />
+  <parameter name="sourceDir" value="./src/test/java/org/apache/juddi/test/" />
+
+  <parameter name="publisherFile" value="jpublisher_publisher.xml" />
   <parameter name="publisherId" value="jpublisher" />
-  <parameter name="businessKey" value="uddi:businessone.com" />
-  <parameter name="serviceKey" value="uddi:businessone.com:services:serviceone" />
+
+  <parameter name="businessFile" value="jpublisher_businessEntity1.xml" />
+  <parameter name="businessKey" value="uddi:juddi.apache.org:joepublisher:businessone" />
+
+  <parameter name="serviceFile" value="jpublisher_businessService1.xml" />
+  <parameter name="serviceKey" value="uddi:juddi.apache.org:joepublisher:serviceone" />
+
+  <parameter name="tmodelFile" value="jpublisher_tModelKeyGen.xml" />
+  <parameter name="tmodelKey" value="uddi:juddi.apache.org:joepublisher:KEYGENERATOR" />
+
   <test name="savePublisher">
     <classes>
       <class name="org.apache.juddi.test.PublisherTest">
@@ -15,6 +23,15 @@
       </class>
     </classes>
   </test>
+  <test name="saveTModel">
+    <classes>
+      <class name="org.apache.juddi.test.TModelTest">
+        <methods>
+          <include name="saveTModel" />
+        </methods>
+      </class>
+    </classes>
+  </test>
   <test name="saveBusiness">
     <classes>
       <class name="org.apache.juddi.test.BusinessEntityTest">
@@ -51,6 +68,15 @@
       </class>
     </classes>
   </test>
+  <test name="deleteTModel">
+    <classes>
+      <class name="org.apache.juddi.test.TModelTest">
+        <methods>
+          <include name="deleteTModel" />
+        </methods>
+      </class>
+    </classes>
+  </test>
   <test name="deletePublisher">
     <classes>
       <class name="org.apache.juddi.test.PublisherTest">
@@ -60,4 +86,5 @@
       </class>
     </classes>
   </test>
+  
 </suite>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: juddi-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: juddi-cvs-help@ws.apache.org


Mime
View raw message