juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ks...@apache.org
Subject svn commit: r726353 - in /webservices/juddi/branches/v3_trunk: ./ juddi-core/ juddi-core/src/main/java/org/apache/juddi/config/ juddi-core/src/main/java/org/apache/juddi/mapping/ juddi-core/src/main/java/org/apache/juddi/model/ juddi-core/src/main/java...
Date Sun, 14 Dec 2008 04:12:39 GMT
Author: kstam
Date: Sat Dec 13 20:12:38 2008
New Revision: 726353

URL: http://svn.apache.org/viewvc?rev=726353&view=rev
Log:
JUDDI-145. Going through the unittests.

Added:
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/juddi_install_data/   (props changed)
      - copied from r726246, webservices/juddi/branches/v3_trunk/juddi-cxf/src/main/webapp/WEB-INF/install/
Removed:
    webservices/juddi/branches/v3_trunk/juddi-cxf/src/main/webapp/WEB-INF/install/
Modified:
    webservices/juddi/branches/v3_trunk/.classpath
    webservices/juddi/branches/v3_trunk/juddi-core/pom.xml
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/AppConfig.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Address.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/AddressLine.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingDescr.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessDescr.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessIdentifier.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessName.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Contact.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ContactDescr.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/DiscoveryUrl.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Email.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDescr.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDocDescr.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReference.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReferenceGroup.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/PersonName.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Phone.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceDescr.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceName.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Tmodel.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelDescr.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelDocDescr.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelIdentifier.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelInstanceInfoDescr.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelOverview.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/util/Install.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/persistence/hibernate-persistence.xml
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/config/ApplicationConfigurationTest.java
    webservices/juddi/branches/v3_trunk/pom.xml
    webservices/juddi/branches/v3_trunk/uddi-ws/src/test/java/org/uddi/api_v3/AuthInfoTest.java

Modified: webservices/juddi/branches/v3_trunk/.classpath
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/.classpath?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/.classpath (original)
+++ webservices/juddi/branches/v3_trunk/.classpath Sat Dec 13 20:12:38 2008
@@ -1,12 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
+	
 	<classpathentry kind="src" path="juddi-core/src/main/java"/>
-	<classpathentry kind="src" path="juddi-core/src/main/resources"/>
 	<classpathentry kind="src" path="juddi-core/src/test/java"/>
+	<classpathentry kind="src" path="juddi-core/src/main/resources"/>
 	<classpathentry kind="src" path="juddi-core/src/test/resources"/>
 	<classpathentry kind="src" path="uddi-ws/src/main/java"/>
-	<classpathentry kind="src" path="uddi-ws/src/main/resources"/>
+	<classpathentry kind="src" path="uddi-ws/src/test/java"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
-	<classpathentry kind="output" path="target-eclipse/classes"/>
+	<classpathentry kind="output" path="target/classes"/>
 </classpath>

Modified: webservices/juddi/branches/v3_trunk/juddi-core/pom.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/pom.xml?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/pom.xml (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/pom.xml Sat Dec 13 20:12:38 2008
@@ -65,11 +65,13 @@
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>2.4.2</version>
+        <!--  
         <configuration>
           <suiteXmlFiles>
             <suiteXmlFile>src/test/resources/suite-init.xml,src/test/resources/suite-subscribe.xml,src/test/resources/suite-clean.xml</suiteXmlFile>
           </suiteXmlFiles>
         </configuration>
+        -->
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
@@ -106,19 +108,12 @@
 			<artifactId>uddi-ws</artifactId>
 			<version>3.0.0.SNAPSHOT</version>
 		</dependency>
-		<dependency>
-			<groupId>org.testng</groupId>
-			<artifactId>testng</artifactId>
-			<version>5.8</version>
-			<scope>test</scope>
-			<classifier>jdk15</classifier>
-		</dependency>
-                <dependency>
-                        <groupId>org.apache.derby</groupId>
-                        <artifactId>derby</artifactId>
-                        <version>10.1.2.1</version>
-                        <scope>test</scope>
-                </dependency>
+        <dependency>
+           <groupId>org.apache.derby</groupId>
+           <artifactId>derby</artifactId>
+           <version>10.1.2.1</version>
+           <scope>test</scope>
+        </dependency>
 		<dependency>
 			<groupId>javax.persistence</groupId>
 			<artifactId>persistence-api</artifactId>

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/AppConfig.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/AppConfig.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/AppConfig.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/AppConfig.java Sat Dec 13 20:12:38 2008
@@ -21,6 +21,7 @@
 
 import javax.persistence.EntityManager;
 import javax.persistence.EntityTransaction;
+import javax.xml.bind.JAXBException;
 
 import org.apache.commons.configuration.CompositeConfiguration;
 import org.apache.commons.configuration.Configuration;
@@ -34,7 +35,9 @@
 import org.apache.juddi.model.UddiEntityPublisher;
 import org.apache.juddi.query.PersistenceManager;
 import org.apache.juddi.util.Constants;
+import org.apache.juddi.util.Install;
 import org.apache.log4j.Logger;
+import org.uddi.v3_service.DispositionReportFaultMessage;
 
 /**
  * Handles the application level configuration for jUDDI. By default it first
@@ -96,9 +99,18 @@
 		tx.begin();
 
 		UddiEntityPublisher rootPublisher = em.find(UddiEntityPublisher.class, Constants.ROOT_PUBLISHER);
-		if (rootPublisher == null)
-			throw new ConfigurationException("The 'root' publisher was not found.  Please make sure that the application is properly installed.");
-		
+		if (rootPublisher == null) {
+			log.info("The 'root' publisher was not found, loading...");
+			try {
+				Install.install();
+			} catch (JAXBException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			} catch (DispositionReportFaultMessage e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
 		Set<KeyGeneratorKey> rootKeyGenList = rootPublisher.getKeyGeneratorKeys();
 		if (rootKeyGenList == null || rootKeyGenList.size() == 0)
 			throw new ConfigurationException("The 'root' publisher key generator was not found.  Please make sure that the application is properly installed.");

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java Sat Dec 13 20:12:38 2008
@@ -28,6 +28,7 @@
 
 /**
  * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
+ * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
  */
 public class MappingApiToModel {
 
@@ -58,7 +59,10 @@
 		mapDiscoveryUrls(apiBusinessEntity.getDiscoveryURLs(), modelBusinessEntity.getDiscoveryUrls(), modelBusinessEntity);
 		mapContacts(apiBusinessEntity.getContacts(), modelBusinessEntity.getContacts(), modelBusinessEntity);
 		mapBusinessIdentifiers(apiBusinessEntity.getIdentifierBag(), modelBusinessEntity.getBusinessIdentifiers(), modelBusinessEntity);
-		mapCategoryBag(apiBusinessEntity.getCategoryBag(), modelBusinessEntity.getCategoryBag());
+		if (apiBusinessEntity.getCategoryBag()!=null) {
+			//TODO put the mapping back
+			//mapCategoryBag(apiBusinessEntity.getCategoryBag(), modelBusinessEntity.getCategoryBag());
+		}
 		
 		mapBusinessServices(apiBusinessEntity.getBusinessServices(), modelBusinessEntity.getBusinessServices(), modelBusinessEntity);
 	}
@@ -247,7 +251,9 @@
 		
 		mapServiceNames(apiBusinessService.getName(), modelBusinessService.getServiceNames(), modelBusinessService);
 		mapServiceDescriptions(apiBusinessService.getDescription(), modelBusinessService.getServiceDescrs(), modelBusinessService);
-		mapCategoryBag(apiBusinessService.getCategoryBag(), modelBusinessService.getCategoryBag());
+		if (apiBusinessService.getCategoryBag()!=null) {
+		//	mapCategoryBag(apiBusinessService.getCategoryBag(), modelBusinessService.getCategoryBag());
+		}
 		
 		mapBindingTemplates(apiBusinessService.getBindingTemplates(), modelBusinessService.getBindingTemplates(), modelBusinessService);
 
@@ -306,7 +312,7 @@
 		//modelBindingTemplate.setHostingRedirector(apiBindingTemplate.getHostingRedirector().getBindingKey());
 		
 		mapBindingDescriptions(apiBindingTemplate.getDescription(), modelBindingTemplate.getBindingDescrs(), modelBindingTemplate);
-		mapCategoryBag(apiBindingTemplate.getCategoryBag(), modelBindingTemplate.getBindingTemplateCategoryBag());
+		//mapCategoryBag(apiBindingTemplate.getCategoryBag(), modelBindingTemplate.getBindingTemplateCategoryBag());
 		mapTModelInstanceDetails(apiBindingTemplate.getTModelInstanceDetails(), modelBindingTemplate.getTmodelInstanceInfos(), modelBindingTemplate);
 	}
 	
@@ -422,7 +428,10 @@
 
 		mapTModelDescriptions(apiTModel.getDescription(), modelTModel.getTmodelDescrs(), modelTModel);
 		mapTModelIdentifiers(apiTModel.getIdentifierBag(), modelTModel.getTmodelIdentifiers(), modelTModel);
-		mapCategoryBag(apiTModel.getCategoryBag(), modelTModel.getCategoryBag());
+		if (apiTModel.getCategoryBag()!=null) {
+			//modelTModel.setCategoryBag(new org.apache.juddi.model.TmodelCategoryBag());
+			//mapCategoryBag(apiTModel.getCategoryBag(), modelTModel.getCategoryBag());
+		}
 		//TODO: OverviewDoc - model doesn't have logical mapping
 
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Address.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Address.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Address.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Address.java Sat Dec 13 20:12:38 2008
@@ -70,7 +70,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "address_id", nullable = false)
 	public Contact getContact() {
 		return this.contact;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/AddressLine.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/AddressLine.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/AddressLine.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/AddressLine.java Sat Dec 13 20:12:38 2008
@@ -65,7 +65,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "address_id", nullable = false)
 	public Address getAddress() {
 		return this.address;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingDescr.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingDescr.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingDescr.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingDescr.java Sat Dec 13 20:12:38 2008
@@ -64,7 +64,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "entity_key", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "entity_key", nullable = false)
 	public BindingTemplate getBindingTemplate() {
 		return this.bindingTemplate;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessDescr.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessDescr.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessDescr.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessDescr.java Sat Dec 13 20:12:38 2008
@@ -64,7 +64,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "entity_key", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "entity_key", nullable = false)
 	public BusinessEntity getBusinessEntity() {
 		return this.businessEntity;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java Sat Dec 13 20:12:38 2008
@@ -45,7 +45,7 @@
 	private Set<DiscoveryUrl> discoveryUrls = new HashSet<DiscoveryUrl>(0);
 	private Set<BusinessName> businessNames = new HashSet<BusinessName>(0);
 	private Set<PublisherAssertion> publisherAssertionsForToKey = new HashSet<PublisherAssertion>(0);
-	private BusinessCategoryBag categoryBag = new BusinessCategoryBag();
+	private BusinessCategoryBag categoryBag;
 	private Set<BusinessService> businessServices = new HashSet<BusinessService>(0);
 	private Set<BusinessDescr> businessDescrs = new HashSet<BusinessDescr>(0);
 

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessIdentifier.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessIdentifier.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessIdentifier.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessIdentifier.java Sat Dec 13 20:12:38 2008
@@ -65,7 +65,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "entity_key", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "entity_key", nullable = false)
 	public BusinessEntity getBusinessEntity() {
 		return this.businessEntity;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessName.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessName.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessName.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessName.java Sat Dec 13 20:12:38 2008
@@ -64,7 +64,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "entity_key", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "entity_key", nullable = false)
 	public BusinessEntity getBusinessEntity() {
 		return this.businessEntity;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java Sat Dec 13 20:12:38 2008
@@ -41,7 +41,7 @@
 	private Set<ServiceName> serviceNames = new HashSet<ServiceName>(0);
 	private Set<ServiceDescr> serviceDescrs = new HashSet<ServiceDescr>(0);
 	private Set<BindingTemplate> bindingTemplates = new HashSet<BindingTemplate>(0);
-	private ServiceCategoryBag categoryBag = new ServiceCategoryBag();
+	private ServiceCategoryBag categoryBag;
 
 	public BusinessService() {
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Contact.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Contact.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Contact.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Contact.java Sat Dec 13 20:12:38 2008
@@ -77,7 +77,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "entity_key", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "entity_key", nullable = false)
 	public BusinessEntity getBusinessEntity() {
 		return this.businessEntity;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ContactDescr.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ContactDescr.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ContactDescr.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ContactDescr.java Sat Dec 13 20:12:38 2008
@@ -63,7 +63,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "contact_id", nullable = false)
 	public Contact getContact() {
 		return this.contact;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/DiscoveryUrl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/DiscoveryUrl.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/DiscoveryUrl.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/DiscoveryUrl.java Sat Dec 13 20:12:38 2008
@@ -59,7 +59,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "entity_key", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "entity_key", nullable = false)
 	public BusinessEntity getBusinessEntity() {
 		return this.businessEntity;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Email.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Email.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Email.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Email.java Sat Dec 13 20:12:38 2008
@@ -63,7 +63,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "contact_id", nullable = false)
 	public Contact getContact() {
 		return this.contact;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDescr.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDescr.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDescr.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDescr.java Sat Dec 13 20:12:38 2008
@@ -63,7 +63,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "tmodel_instance_info_id", nullable = false)
 	public TmodelInstanceInfo getTmodelInstanceInfo() {
 		return this.tmodelInstanceInfo;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDocDescr.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDocDescr.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDocDescr.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/InstanceDetailsDocDescr.java Sat Dec 13 20:12:38 2008
@@ -67,7 +67,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "tmodel_instance_info_id", nullable = false)
 	public TmodelInstanceInfo getTmodelInstanceInfo() {
 		return this.tmodelInstanceInfo;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReference.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReference.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReference.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReference.java Sat Dec 13 20:12:38 2008
@@ -64,7 +64,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "category_bag_id", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "category_bag_id", nullable = false)
 	public CategoryBag getCategoryBag() {
 		return this.categoryBag;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReferenceGroup.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReferenceGroup.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReferenceGroup.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyedReferenceGroup.java Sat Dec 13 20:12:38 2008
@@ -70,7 +70,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "category_bag_id", nullable = false)
 	public CategoryBag getCategoryBag() {
 		return this.categoryBag;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/PersonName.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/PersonName.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/PersonName.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/PersonName.java Sat Dec 13 20:12:38 2008
@@ -62,7 +62,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "contact_id", nullable = false)
 	public Contact getContact() {
 		return this.contact;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Phone.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Phone.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Phone.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Phone.java Sat Dec 13 20:12:38 2008
@@ -62,7 +62,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "contact_id", nullable = false)
 	public Contact getContact() {
 		return this.contact;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceDescr.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceDescr.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceDescr.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceDescr.java Sat Dec 13 20:12:38 2008
@@ -62,7 +62,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "entity_key", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "entity_key", nullable = false)
 	public BusinessService getBusinessService() {
 		return this.businessService;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceName.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceName.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceName.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/ServiceName.java Sat Dec 13 20:12:38 2008
@@ -63,7 +63,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "entity_key", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "entity_key", nullable = false)
 	public BusinessService getBusinessService() {
 		return this.businessService;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Tmodel.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Tmodel.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Tmodel.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Tmodel.java Sat Dec 13 20:12:38 2008
@@ -30,8 +30,6 @@
 import javax.persistence.OrderBy;
 import javax.persistence.Table;
 
-import org.uddi.api_v3.OverviewDoc;
-
 /**
  * @author <a href="mailto:kurt@apache.org">Kurt T Stam</a>
  * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
@@ -50,7 +48,7 @@
 	private Set<TmodelDescr> tmodelDescrs = new HashSet<TmodelDescr>(0);
 	private Set<TmodelDocDescr> tmodelDocDescrs = new HashSet<TmodelDocDescr>(0);
 	private Set<TmodelIdentifier> tmodelIdentifiers = new HashSet<TmodelIdentifier>(0);
-	private TmodelCategoryBag categoryBag = new TmodelCategoryBag();
+	private TmodelCategoryBag categoryBag;
 
 	public Tmodel() {
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelDescr.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelDescr.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelDescr.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelDescr.java Sat Dec 13 20:12:38 2008
@@ -63,7 +63,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "entity_key", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "entity_key", nullable = false)
 	public Tmodel getTmodel() {
 		return this.tmodel;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelDocDescr.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelDocDescr.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelDocDescr.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelDocDescr.java Sat Dec 13 20:12:38 2008
@@ -68,7 +68,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "tmodel_key", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "tmodel_key", nullable = false)
 	public Tmodel getTmodel() {
 		return this.tmodel;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelIdentifier.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelIdentifier.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelIdentifier.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelIdentifier.java Sat Dec 13 20:12:38 2008
@@ -67,7 +67,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "entity_key", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "entity_key", nullable = false)
 	public Tmodel getTmodel() {
 		return this.tmodel;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelInstanceInfoDescr.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelInstanceInfoDescr.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelInstanceInfoDescr.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelInstanceInfoDescr.java Sat Dec 13 20:12:38 2008
@@ -62,7 +62,7 @@
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "id", nullable = false, insertable = false, updatable = false)
+	@JoinColumn(name = "tmodel_instance_info_id", nullable = false)
 	public TmodelInstanceInfo getTmodelInstanceInfo() {
 		return this.tmodelInstanceInfo;
 	}

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelOverview.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelOverview.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelOverview.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/TmodelOverview.java Sat Dec 13 20:12:38 2008
@@ -15,72 +15,70 @@
  * limitations under the License.
  */
 
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
-import javax.persistence.OneToOne;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
 import javax.persistence.Table;
 
 /**
  * @author <a href="mailto:kurt@apache.org">Kurt T Stam</a>
+ * @author <a href="mailto:tcunning@apache.org">Tom Cunningham</a>
  */
 @Entity
 @Table(name = "tmodel_overview")
 public class TmodelOverview implements java.io.Serializable {
 
 	private static final long serialVersionUID = 1L;
-	private int tmodelOverviewId;
-	private String tmodelKey;
+	private Long id;
 	private Tmodel tmodel;
 	private String overviewUrl;
+	private Set<TmodelDocDescr> docDescrs = new HashSet<TmodelDocDescr>(0);
 
 	public TmodelOverview() {
 	}
 
-	public TmodelOverview(int tmodelOverviewId, String tmodelKey, Tmodel tmodel) {
-		this.tmodelOverviewId = tmodelOverviewId;
-		this.tmodelKey = tmodelKey;
+	public TmodelOverview(Tmodel tmodel) {
 		this.tmodel = tmodel;
 	}
-	public TmodelOverview(int tmodelOverviewId, String tmodelKey, Tmodel tmodel,
-			String overviewUrl) {
-		this.tmodelOverviewId = tmodelOverviewId;
-		this.tmodelKey = tmodelKey;
-		this.overviewUrl = overviewUrl;
+	
+	public TmodelOverview(Tmodel tmodel,
+			String overviewUrl, Set<TmodelDocDescr> docDescrs) {
 		this.tmodel = tmodel;
+		this.overviewUrl = overviewUrl;
+		this.docDescrs = docDescrs;
 	}
 
 	@Id
-	@Column(name = "tmodel_overview_id", nullable = false)
-
-	public int getTmodelOverviewId() {
-		return this.tmodelOverviewId;
-	}
-
-	public void setTmodelOverviewId(int tmodelOverviewId) {
-		this.tmodelOverviewId = tmodelOverviewId;
+	@GeneratedValue(strategy=GenerationType.AUTO)
+	public Long getId() {
+		return this.id;
 	}
 
-	@Column(name = "tmodel_key", nullable = false, length = 255)
-	public String getTmodelKey() {
-		return this.tmodelKey;
+	public void setId(Long id) {
+		this.id = id;
 	}
 
-	public void setTmodelKey(String tmodelKey) {
-		this.tmodelKey = tmodelKey;
-	}
-	
-	@OneToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "tmodel_key", nullable = false, insertable = false, updatable = false)
+	@ManyToOne(fetch = FetchType.LAZY)
+	@JoinColumn(name = "entity_key", nullable = false)
 	public Tmodel getTmodel() {
 		return this.tmodel;
 	}
+
 	public void setTmodel(Tmodel tmodel) {
 		this.tmodel = tmodel;
 	}
-	
+
 	@Column(name = "overview_url")
 	public String getOverviewUrl() {
 		return this.overviewUrl;
@@ -90,4 +88,13 @@
 		this.overviewUrl = overviewUrl;
 	}
 
+	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tmodeloverview")
+	@OrderBy
+	public Set<TmodelDocDescr> getDocDescriptions() {
+		return this.docDescrs;
+	}
+	
+	public void setDocDescriptions(Set<TmodelDocDescr> docDescrs) {
+		this.docDescrs = docDescrs;
+	}	
 }

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/util/Install.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/util/Install.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/util/Install.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/util/Install.java Sat Dec 13 20:12:38 2008
@@ -17,7 +17,8 @@
 
 package org.apache.juddi.util;
 
-import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
 import java.util.List;
 import java.util.Set;
 
@@ -39,6 +40,7 @@
 import org.apache.juddi.model.KeyGeneratorKeyId;
 import org.apache.juddi.model.UddiEntityPublisher;
 import org.apache.juddi.query.PersistenceManager;
+import org.apache.log4j.Logger;
 import org.uddi.api_v3.SaveTModel;
 import org.uddi.api_v3.TModel;
 import org.uddi.v3_service.DispositionReportFaultMessage;
@@ -55,34 +57,40 @@
 	public static final String FILE_UDDI_TMODELS = "UDDI_tModels.xml";
 	
 	public static final String FILE_PERSISTENCE = "persistence.xml";
+	public static final String JUDDI_INSTALL_DATA_DIR = "juddi_install_data/";
+	public static Logger log = Logger.getLogger(Install.class);
 	
-	public static void install(String srcDir) throws JAXBException, DispositionReportFaultMessage {
-		if (srcDir != null) {
-			if (!srcDir.endsWith("\\"))
-				srcDir = srcDir + "\\";
-		}
-		else
-			srcDir = "";
-			
+	public static void install() throws JAXBException, DispositionReportFaultMessage {
 		
 		EntityManager em = PersistenceManager.getEntityManager();
 		EntityTransaction tx = em.getTransaction();
-		tx.begin();
+		try {
+			tx.begin();
+	
+			if (alreadyInstalled(em))
+				throw new FatalErrorException(new ErrorMessage("errors.install.AlreadyInstalled"));
+			
+			UddiEntityPublisher rootPublisher = installPublisher(em, JUDDI_INSTALL_DATA_DIR + FILE_ROOT_PUBLISHER);
+			UddiEntityPublisher uddiPublisher = installPublisher(em, JUDDI_INSTALL_DATA_DIR + FILE_UDDI_PUBLISHER);
+			
+			installPublisherKeyGen(em, JUDDI_INSTALL_DATA_DIR + FILE_ROOT_TMODELKEYGEN, rootPublisher);
+			
+			installUDDITModels(em, JUDDI_INSTALL_DATA_DIR + FILE_UDDI_TMODELS, uddiPublisher);
+			tx.commit();
+			//TODO why does this need it's own tx?
+			tx.begin();
+			installRootBusinessEntity(em, JUDDI_INSTALL_DATA_DIR + FILE_ROOT_BUSINESSENTITY, rootPublisher);
+			tx.commit();
+		} catch (Exception e) {
+			log .error(e.getMessage(),e);
+			tx.rollback();
+		} finally {
+			if (em.isOpen()) {
+				em.close();
+			}
+		}
 
-		if (alreadyInstalled(em))
-			throw new FatalErrorException(new ErrorMessage("errors.install.AlreadyInstalled"));
-		
-		UddiEntityPublisher rootPublisher = installPublisher(em, srcDir + FILE_ROOT_PUBLISHER);
-		UddiEntityPublisher uddiPublisher = installPublisher(em, srcDir + FILE_UDDI_PUBLISHER);
-		
-		installPublisherKeyGen(em, srcDir + FILE_ROOT_TMODELKEYGEN, rootPublisher);
-		
-		installUDDITModels(em, srcDir + FILE_UDDI_TMODELS, uddiPublisher);
 		
-		tx.commit();
-		em.close();
-
-		installRootBusinessEntity(em, srcDir + FILE_ROOT_BUSINESSENTITY, rootPublisher);
 		
 	}
 
@@ -138,7 +146,8 @@
 		return false;
 	}
 	
-	private static void installRootBusinessEntity(EntityManager em, String file, UddiEntityPublisher publisher) throws JAXBException, DispositionReportFaultMessage {
+	private static void installRootBusinessEntity(EntityManager em, String resource, UddiEntityPublisher publisher) 
+	throws JAXBException, DispositionReportFaultMessage, IOException {
 		UDDIPublicationImpl publish = new UDDIPublicationImpl();
 		UDDISecurityImpl security = new UDDISecurityImpl();
 
@@ -149,21 +158,23 @@
 		
 		org.uddi.api_v3.SaveBusiness sb = new org.uddi.api_v3.SaveBusiness();
 
-		org.uddi.api_v3.BusinessEntity apiBusinessEntity = (org.uddi.api_v3.BusinessEntity)buildEntityFromDoc(file, "org.uddi.api_v3");
+		org.uddi.api_v3.BusinessEntity apiBusinessEntity = (org.uddi.api_v3.BusinessEntity)buildEntityFromDoc(resource, "org.uddi.api_v3");
 		sb.getBusinessEntity().add(apiBusinessEntity);
 		sb.setAuthInfo(authToken.getAuthInfo());
 		
 		publish.saveBusiness(sb);
 	}
 	
-	private static void installUDDITModels(EntityManager em, String file, UddiEntityPublisher publisher) throws JAXBException, DispositionReportFaultMessage {
-		SaveTModel apiSaveTModel = (SaveTModel)buildEntityFromDoc(file, "org.uddi.api_v3");
+	private static void installUDDITModels(EntityManager em, String resource, UddiEntityPublisher publisher) 
+		throws JAXBException, DispositionReportFaultMessage, IOException {
+		SaveTModel apiSaveTModel = (SaveTModel)buildEntityFromDoc(resource, "org.uddi.api_v3");
 		installTModels(em, apiSaveTModel.getTModel(), publisher);
 		
 	}
 	
-	private static UddiEntityPublisher installPublisher(EntityManager em, String file) throws JAXBException, DispositionReportFaultMessage {
-		Publisher apiPub = (Publisher)buildEntityFromDoc(file, "org.apache.juddi.api.datatype");
+	private static UddiEntityPublisher installPublisher(EntityManager em, String resource) 
+		throws JAXBException, DispositionReportFaultMessage, IOException {
+		Publisher apiPub = (Publisher)buildEntityFromDoc(resource, "org.apache.juddi.api.datatype");
 		org.apache.juddi.model.Publisher modelPub = new org.apache.juddi.model.Publisher();
 		MappingApiToModel.mapPublisher(apiPub, modelPub);
 		em.persist(modelPub);
@@ -191,8 +202,9 @@
 		
 	}
 
-	private static void installPublisherKeyGen(EntityManager em, String file, UddiEntityPublisher publisher) throws JAXBException, DispositionReportFaultMessage {
-		TModel apiTModel = (TModel)buildEntityFromDoc(file, "org.uddi.api_v3");
+	private static void installPublisherKeyGen(EntityManager em, String resource, UddiEntityPublisher publisher) 
+		throws JAXBException, DispositionReportFaultMessage, IOException {
+		TModel apiTModel = (TModel)buildEntityFromDoc(resource, "org.uddi.api_v3");
 		installPublisherKeyGen(em, apiTModel, publisher);
 	}
 
@@ -217,10 +229,12 @@
 		
 	}
 	
-	private static Object buildEntityFromDoc(String fileName, String thePackage) throws JAXBException {
+	private static Object buildEntityFromDoc(String resource, String thePackage) throws JAXBException, IOException {
+		InputStream resourceStream =Thread.currentThread().getContextClassLoader().getResource(resource).openStream();
+
 		JAXBContext jc = JAXBContext.newInstance(thePackage);
 		Unmarshaller unmarshaller = jc.createUnmarshaller();
-		Object obj = ((JAXBElement)unmarshaller.unmarshal(new File(fileName))).getValue();
+		Object obj = ((JAXBElement)unmarshaller.unmarshal(resourceStream)).getValue();
 		return obj;
 	}
 

Propchange: webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/juddi_install_data/
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/persistence/hibernate-persistence.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/persistence/hibernate-persistence.xml?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/persistence/hibernate-persistence.xml (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/persistence/hibernate-persistence.xml Sat Dec 13 20:12:38 2008
@@ -15,12 +15,19 @@
       <property name="hibernate.hbm2ddl.auto" value="update"/>
       <property name="hibernate.show_sql" value="false"/>
 
-      <!-- connection properties -->
+      <!-- derby connection properties 
       <property name="hibernate.dialect" value="org.hibernate.dialect.DerbyDialect"/>
-       <property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/>
+      <property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/>
       <property name="hibernate.connection.url" value="jdbc:derby:juddi-derby-test-db;create=true"/>
       <property name="hibernate.connection.username" value=""/>
       <property name="hibernate.connection.password" value=""/>
+      -->
+      <!--  mysql connection properties -->
+      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
+      <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
+      <property name="hibernate.connection.username" value="kstam" />
+      <property name="hibernate.connection.password" value="" />
+      <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/juddiv3" />
 
       <!-- connection pool properties -->
       <property name="hibernate.dbcp.maxActive" value="100"/>
@@ -29,4 +36,6 @@
       
     </properties>
   </persistence-unit>
+
+  
 </persistence>

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/config/ApplicationConfigurationTest.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/config/ApplicationConfigurationTest.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/config/ApplicationConfigurationTest.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/config/ApplicationConfigurationTest.java Sat Dec 13 20:12:38 2008
@@ -1,7 +1,7 @@
 package org.apache.juddi.config;
 
 import org.apache.commons.configuration.ConfigurationException;
-import org.testng.annotations.*;
+import org.junit.Test;
 
 public class ApplicationConfigurationTest 
 {

Modified: webservices/juddi/branches/v3_trunk/pom.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/pom.xml?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/pom.xml (original)
+++ webservices/juddi/branches/v3_trunk/pom.xml Sat Dec 13 20:12:38 2008
@@ -150,6 +150,12 @@
 			<classifier>jdk15</classifier>
 		</dependency>
 		<dependency>
+	      <groupId>junit</groupId>
+	      <artifactId>junit</artifactId>
+	      <version>4.5</version>
+	      <scope>test</scope>
+	    </dependency>
+		<dependency>
 			<groupId>org.hibernate</groupId>
 			<artifactId>hibernate</artifactId>
 			<version>3.2.5.ga</version>

Modified: webservices/juddi/branches/v3_trunk/uddi-ws/src/test/java/org/uddi/api_v3/AuthInfoTest.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-ws/src/test/java/org/uddi/api_v3/AuthInfoTest.java?rev=726353&r1=726352&r2=726353&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-ws/src/test/java/org/uddi/api_v3/AuthInfoTest.java (original)
+++ webservices/juddi/branches/v3_trunk/uddi-ws/src/test/java/org/uddi/api_v3/AuthInfoTest.java Sat Dec 13 20:12:38 2008
@@ -47,7 +47,7 @@
 			JAXBElement<AuthToken> element = new JAXBElement<AuthToken>(new QName("","fragment"),AuthToken.class,authToken);
 			marshaller.marshal(element,writer);
 			String actualXml=writer.toString();
-			//assertEquals(EXPECTED_XML_FRAGMENT, actualXml);
+			assertEquals(EXPECTED_XML_FRAGMENT, actualXml);
 		} catch (JAXBException jaxbe) {
 			fail("No exception should be thrown");
 		}
@@ -64,7 +64,7 @@
 			StringReader reader = new StringReader(EXPECTED_XML_FRAGMENT);
 			JAXBElement<AuthToken> element = unMarshaller.unmarshal(new StreamSource(reader),AuthToken.class);
 			String infoString = element.getValue().getAuthInfo();
-			//assertEquals("AuthInfo String", infoString);
+			assertEquals("AuthInfo String", infoString);
 		} catch (JAXBException jaxbe) {
 			fail("No exception should be thrown");
 		}
@@ -88,7 +88,7 @@
 			JAXBElement<AuthToken> element = new JAXBElement<AuthToken>(new QName("","fragment"),AuthToken.class,authToken);
 			marshaller.marshal(element,writer);
 			String actualXml=writer.toString();
-			//assertEquals(EXPECTED_UTF8_XML_FRAGMENT, actualXml);
+			assertEquals(EXPECTED_UTF8_XML_FRAGMENT, actualXml);
 		} catch (JAXBException jaxbe) {
 			fail("No exception should be thrown");
 		}
@@ -106,7 +106,7 @@
 			StringReader reader = new StringReader(EXPECTED_UTF8_XML_FRAGMENT);
 			JAXBElement<AuthToken> utf8Element = unMarshaller.unmarshal(new StreamSource(reader),AuthToken.class);
 			String infoString = utf8Element.getValue().getAuthInfo();
-			//assertEquals(UTF8_WORD, infoString);
+			assertEquals(UTF8_WORD, infoString);
 		} catch (JAXBException jaxbe) {
 			fail("No exception should be thrown");
 		}



---------------------------------------------------------------------
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