juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ks...@apache.org
Subject svn commit: r1234533 - in /juddi/scout/trunk: ./ src/main/java/org/apache/ws/scout/registry/ src/main/java/org/apache/ws/scout/transport/ src/test/java/org/apache/ws/scout/ src/test/java/org/apache/ws/scout/registry/ src/test/resources/ src/test/resour...
Date Sun, 22 Jan 2012 15:58:14 GMT
Author: kstam
Date: Sun Jan 22 15:58:13 2012
New Revision: 1234533

URL: http://svn.apache.org/viewvc?rev=1234533&view=rev
Log:
SCOUT-123 switching to using the juddi-client when running the tests. Also the manager and
node name can now be set as properties, and can be passed down into the juddi-client wrapper
classes. 

Added:
    juddi/scout/trunk/src/test/resources/META-INF/jaxr-uddi.xml
Modified:
    juddi/scout/trunk/pom.xml
    juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerV3Impl.java
    juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/ConnectionFactoryImpl.java
    juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/ConnectionImpl.java
    juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java
    juddi/scout/trunk/src/main/java/org/apache/ws/scout/transport/LocalTransport.java
    juddi/scout/trunk/src/test/java/org/apache/ws/scout/BaseTestCase.java
    juddi/scout/trunk/src/test/java/org/apache/ws/scout/registry/BusinessLifeCyleManagerlTest.java
    juddi/scout/trunk/src/test/java/org/apache/ws/scout/registry/ConnectionFactoryTest.java
    juddi/scout/trunk/src/test/resources/log4j.properties
    juddi/scout/trunk/src/test/resources/scoutv2.properties
    juddi/scout/trunk/src/test/resources/scoutv3.properties

Modified: juddi/scout/trunk/pom.xml
URL: http://svn.apache.org/viewvc/juddi/scout/trunk/pom.xml?rev=1234533&r1=1234532&r2=1234533&view=diff
==============================================================================
--- juddi/scout/trunk/pom.xml (original)
+++ juddi/scout/trunk/pom.xml Sun Jan 22 15:58:13 2012
@@ -12,7 +12,7 @@
 	<packaging>bundle</packaging>
 
 	<properties>
-		<juddi.registry.version>3.1.1-SNAPSHOT</juddi.registry.version>
+		<juddi.registry.version>3.1.3-SNAPSHOT</juddi.registry.version>
 	</properties>
 
 	<prerequisites>
@@ -230,18 +230,11 @@
 				</exclusion>
 			</exclusions>
 		</dependency>
-
-		<dependency>
-			<groupId>com.sun.xml.bind</groupId>
-			<artifactId>jaxb-impl</artifactId>
-			<version>2.1.9</version>
-			<exclusions>
-				<exclusion>
-					<groupId>javax.xml.bind</groupId>
-					<artifactId>jaxb-api</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
+    <dependency>
+      <groupId>org.apache.juddi</groupId>
+      <artifactId>juddi-client</artifactId>
+      <version>${juddi.registry.version}</version>
+    </dependency>
 
 		<dependency>
 			<groupId>junit</groupId>
@@ -442,14 +435,14 @@
 				<dependency>
 					<groupId>org.apache.juddi</groupId>
 					<artifactId>juddi-tomcat</artifactId>
-					<version>3.1.1-SNAPSHOT</version>
+					<version>${juddi.registry.version}</version>
 					<scope>test</scope>
 					<type>zip</type>
 				</dependency>
 					<dependency>
 						<groupId>org.apache.juddi</groupId>
 						<artifactId>uddi-ws</artifactId>
-						<version>3.1.0</version>
+						<version>${juddi.registry.version}</version>
 					</dependency>
 			</dependencies>
 			<build>

Modified: juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerV3Impl.java
URL: http://svn.apache.org/viewvc/juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerV3Impl.java?rev=1234533&r1=1234532&r2=1234533&view=diff
==============================================================================
--- juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerV3Impl.java
(original)
+++ juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerV3Impl.java
Sun Jan 22 15:58:13 2012
@@ -823,7 +823,7 @@ public class BusinessLifeCycleManagerV3I
                 keyarr[currLoc] = key.getId();
                 currLoc++;
             }
-            // Save business
+            // Delete operation
             DispositionReport bd = (DispositionReport) executeOperation(keyarr, op);
             List<Result> resultList = bd.getResult();
             keyResultArr = new Result[resultList.size()];

Modified: juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/ConnectionFactoryImpl.java
URL: http://svn.apache.org/viewvc/juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/ConnectionFactoryImpl.java?rev=1234533&r1=1234532&r2=1234533&view=diff
==============================================================================
--- juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/ConnectionFactoryImpl.java
(original)
+++ juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/ConnectionFactoryImpl.java
Sun Jan 22 15:58:13 2012
@@ -41,13 +41,17 @@ import javax.xml.registry.UnsupportedCap
 public class ConnectionFactoryImpl extends ConnectionFactory implements Serializable
 {
 	private static final long serialVersionUID = -6902106826496922256L;
-	public static final String QUERYMANAGER_PROPERTY = "javax.xml.registry.queryManagerURL";
-	public static final String LIFECYCLEMANAGER_PROPERTY = "javax.xml.registry.lifeCycleManagerURL";
-	public static final String SECURITYMANAGER_PROPERTY = "javax.xml.registry.securityManagerURL";
+	public static final String QUERYMANAGER_PROPERTY         = "javax.xml.registry.queryManagerURL";
+	public static final String LIFECYCLEMANAGER_PROPERTY     = "javax.xml.registry.lifeCycleManagerURL";
+	public static final String SECURITYMANAGER_PROPERTY      = "javax.xml.registry.securityManagerURL";
 	public static final String SEMANTICEQUIVALENCES_PROPERTY = "javax.xml.registry.semanticEquivalences";
-	public static final String POSTALADDRESSSCHEME_PROPERTY = "javax.xml.registry.postalAddressScheme";
+	public static final String POSTALADDRESSSCHEME_PROPERTY  = "javax.xml.registry.postalAddressScheme";
 	public static final String AUTHENTICATIONMETHOD_PROPERTY = "javax.xml.registry.security.authenticationMethod";
-	public static final String MAXROWS_PROPERTY = "javax.xml.registry.uddi.maxRows";
+	public static final String MAXROWS_PROPERTY              = "javax.xml.registry.uddi.maxRows";
+	
+	public static final String JUDDI_CLIENT_CONFIG_FILE      = "scout.juddi.client.config.file";
+	
+	public static final String DEFAULT_JUDDI_CLIENT_CONFIG_FILE = "META-INF/jaxr-uddi.xml";
 
     private String queryManagerURL;
     private String lifeCycleManagerURL;
@@ -59,6 +63,10 @@ public class ConnectionFactoryImpl exten
     private String postalAddressScheme;
 	private String uddiNamespace;
 	private String uddiVersion;
+	
+	private Properties properties = new Properties();
+	
+	private String uddiConfigFile;
 
     /**
      * Public no-arg constructor so that this ConnectionFactory can be
@@ -100,7 +108,7 @@ public class ConnectionFactoryImpl exten
         	securityManager = null;
         }
         	return new ConnectionImpl(queryManager, lifeCycleManager, securityManager, transportClass,
null, maxRows == null ? -1 : maxRows.intValue(),
-                               uddiNamespace, uddiVersion);
+                               uddiNamespace, uddiVersion, uddiConfigFile, properties);
     }
 
     public FederatedConnection createFederatedConnection(Collection collection) throws JAXRException
@@ -117,43 +125,7 @@ public class ConnectionFactoryImpl exten
      */
     public Properties getProperties()
     {
-        Properties props = new Properties();
-        if (queryManagerURL != null)
-        {
-            props.put(QUERYMANAGER_PROPERTY, queryManagerURL);
-        }
-        if (lifeCycleManagerURL != null)
-        {
-            props.put(LIFECYCLEMANAGER_PROPERTY, lifeCycleManagerURL);
-        }
-        if (securityManagerURL != null)
-        {
-        	props.put(SECURITYMANAGER_PROPERTY, securityManagerURL);
-        }
-        if (semanticEquivalences != null)
-        {
-            props.put(SEMANTICEQUIVALENCES_PROPERTY, semanticEquivalences);
-        }
-        if (postalAddressScheme != null)
-        {
-            props.put(POSTALADDRESSSCHEME_PROPERTY, postalAddressScheme);
-        }
-        if (authenticationMethod != null)
-        {
-            props.put(AUTHENTICATIONMETHOD_PROPERTY, authenticationMethod);
-        }
-        if (maxRows != null)
-        {
-            props.put(MAXROWS_PROPERTY, maxRows.toString());
-        }
-        if (uddiNamespace != null) {
-        	props.put(RegistryImpl.UDDI_NAMESPACE_PROPERTY_NAME, uddiNamespace);
-        }
-        if (uddiVersion != null) {
-        	props.put(RegistryImpl.UDDI_VERSION_PROPERTY_NAME, uddiVersion);
-        }
-
-        return props;
+        return properties;
     }
 
     /**
@@ -163,9 +135,19 @@ public class ConnectionFactoryImpl exten
      */
     public void setProperties(Properties properties)
     {
-        queryManagerURL = properties.getProperty(QUERYMANAGER_PROPERTY);
-        lifeCycleManagerURL = properties.getProperty(LIFECYCLEMANAGER_PROPERTY);
-        securityManagerURL = properties.getProperty(SECURITYMANAGER_PROPERTY);
+        if (properties==null) properties = new Properties();
+        this.properties = properties;
+        if (isUDDIv3(properties)) {
+            // UDDI v3 uses the juddi client
+            queryManagerURL     = "org.apache.juddi.v3.client.transport.wrapper.UDDIInquiryService#inquire";
+            lifeCycleManagerURL = "org.apache.juddi.v3.client.transport.wrapper.UDDIPublicationService#publish";
+            securityManagerURL  = "org.apache.juddi.v3.client.transport.wrapper.UDDISecurityService#secure";
+            uddiConfigFile      = properties.getProperty(JUDDI_CLIENT_CONFIG_FILE, DEFAULT_JUDDI_CLIENT_CONFIG_FILE);
+        } else {
+            queryManagerURL = properties.getProperty(QUERYMANAGER_PROPERTY);
+            lifeCycleManagerURL = properties.getProperty(LIFECYCLEMANAGER_PROPERTY);
+            securityManagerURL = properties.getProperty(SECURITYMANAGER_PROPERTY);
+        }
 
         transportClass = properties.getProperty(RegistryImpl.TRANSPORT_CLASS_PROPERTY_NAME);
         semanticEquivalences = properties.getProperty(SEMANTICEQUIVALENCES_PROPERTY);
@@ -177,6 +159,14 @@ public class ConnectionFactoryImpl exten
         String val = properties.getProperty(MAXROWS_PROPERTY);
         maxRows = (val == null) ? null : Integer.valueOf(val);
     }
+    
+    private boolean isUDDIv3(Properties properties) {
+        if (properties.containsKey(RegistryImpl.UDDI_VERSION_PROPERTY_NAME)) {
+            String version = properties.getProperty(RegistryImpl.UDDI_VERSION_PROPERTY_NAME);
+            if (version.equals("3") || version.equals("3.0")) return true;
+        }
+        return false;
+    }
 
     public static ConnectionFactory newInstance()
     {
@@ -188,66 +178,32 @@ public class ConnectionFactoryImpl exten
         return authenticationMethod;
     }
 
-    public void setAuthenticationMethod(String authenticationMethod)
-    {
-        this.authenticationMethod = authenticationMethod;
-    }
-
     public String getLifeCycleManagerURL()
     {
         return lifeCycleManagerURL;
     }
 
-    public void setLifeCycleManagerURL(String lifeCycleManagerURL)
-    {
-        this.lifeCycleManagerURL = lifeCycleManagerURL;
-    }
-
     public Integer getMaxRows()
     {
         return maxRows;
     }
 
-    public void setMaxRows(Integer maxRows)
-    {
-        this.maxRows = maxRows;
-    }
-
     public String getPostalAddressScheme()
     {
         return postalAddressScheme;
     }
 
-    public void setPostalAddressScheme(String postalAddressScheme)
-    {
-        this.postalAddressScheme = postalAddressScheme;
-    }
-
     public String getQueryManagerURL()
     {
         return queryManagerURL;
     }
 
-    public void setQueryManagerURL(String queryManagerURL)
-    {
-        this.queryManagerURL = queryManagerURL;
-    }
-
     public String getSemanticEquivalences()
     {
         return semanticEquivalences;
     }
 
-    public void setSemanticEquivalences(String semanticEquivalences)
-    {
-        this.semanticEquivalences = semanticEquivalences;
-    }
-
 	public String getTransportClass() {
 		return transportClass;
 	}
-
-	public void setTransportClass(String transportClass) {
-		this.transportClass = transportClass;
-	}
 }

Modified: juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/ConnectionImpl.java
URL: http://svn.apache.org/viewvc/juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/ConnectionImpl.java?rev=1234533&r1=1234532&r2=1234533&view=diff
==============================================================================
--- juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/ConnectionImpl.java (original)
+++ juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/ConnectionImpl.java Sun Jan
22 15:58:13 2012
@@ -25,6 +25,11 @@ import javax.xml.registry.Connection;
 import javax.xml.registry.JAXRException;
 import javax.xml.registry.RegistryService;
 
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.juddi.v3.client.config.UDDIClerkManager;
+
 /**
  * Apache Scout Implementation of a JAXR Connection.
  * For futher details, look into the JAXR API Javadoc.
@@ -35,6 +40,7 @@ import javax.xml.registry.RegistryServic
 public class ConnectionImpl implements Connection, Serializable
 {
 	private static final long serialVersionUID = 3542404895814764176L;
+	private static Log log = LogFactory.getLog(ConnectionImpl.class);
 	private boolean closed = false;
     private boolean synchronous = true;
     private Set credentials;
@@ -42,11 +48,11 @@ public class ConnectionImpl implements C
     private final String postalScheme;
     private final int maxRows;
     private String uddiVersion;
+    UDDIClerkManager manager = null;
 
     public ConnectionImpl(URI queryManagerURI, URI lifeCycleManagerURI, URI securityManagerURI,
String transportClass, String postalScheme, int maxRows,
-    	String uddiNamespace, String uddiVersion)
+    	String uddiNamespace, String uddiVersion, String uddiConfig, Properties properties)
     {
-        Properties prop = new Properties();
         /**
          * If you want to override any of the properties
          * juddi RegistryProxy uses, set the System property
@@ -54,23 +60,23 @@ public class ConnectionImpl implements C
          */
 		this.uddiVersion = uddiVersion;
 		if (uddiVersion != null) {
-			prop.setProperty(RegistryImpl.UDDI_VERSION_PROPERTY_NAME, uddiVersion);
+		    properties.setProperty(RegistryImpl.UDDI_VERSION_PROPERTY_NAME, uddiVersion);
 		} else {
-    		prop.setProperty(RegistryImpl.UDDI_VERSION_PROPERTY_NAME, RegistryImpl.DEFAULT_UDDI_VERSION);
+		    properties.setProperty(RegistryImpl.UDDI_VERSION_PROPERTY_NAME, RegistryImpl.DEFAULT_UDDI_VERSION);
 		}
 			
 		if (uddiNamespace!=null) {
-    		prop.setProperty(RegistryImpl.UDDI_NAMESPACE_PROPERTY_NAME, uddiNamespace);
+		    properties.setProperty(RegistryImpl.UDDI_NAMESPACE_PROPERTY_NAME, uddiNamespace);
 		} else {
-			prop.setProperty(RegistryImpl.UDDI_NAMESPACE_PROPERTY_NAME, RegistryImpl.DEFAULT_UDDI_NAMESPACE);
+		    properties.setProperty(RegistryImpl.UDDI_NAMESPACE_PROPERTY_NAME, RegistryImpl.DEFAULT_UDDI_NAMESPACE);
 		}
 		
         if (transportClass!=null) {
-    		prop.setProperty(RegistryImpl.TRANSPORT_CLASS_PROPERTY_NAME, transportClass);
+            properties.setProperty(RegistryImpl.TRANSPORT_CLASS_PROPERTY_NAME, transportClass);
         } else {
     		String transport = SecurityActions.getProperty(RegistryImpl.TRANSPORT_CLASS_PROPERTY_NAME);
     		if (transport != null) {
-    			prop.setProperty(RegistryImpl.TRANSPORT_CLASS_PROPERTY_NAME, transport);
+    		    properties.setProperty(RegistryImpl.TRANSPORT_CLASS_PROPERTY_NAME, transport);
     		}
         }
         /**
@@ -78,9 +84,21 @@ public class ConnectionImpl implements C
          * juddi takes default values
          */
         if ("3.0".equals(uddiVersion)) {
-        	registry = new RegistryV3Impl(prop);
+            String nodeName = null;
+            String managerName = null;
+            if (manager==null) {
+                try {
+                    manager = new UDDIClerkManager("META-INF/jaxr-uddi.xml", properties);
+                    manager.start();
+                    nodeName = manager.getClientConfig().getHomeNode().getName();
+                    managerName = manager.getName();
+                } catch (ConfigurationException e) {
+                    log.error(e.getMessage(),e);
+                }
+            }
+        	registry = new RegistryV3Impl(properties, nodeName, managerName);
         } else {
-            registry = new RegistryImpl(prop);           	
+            registry = new RegistryImpl(properties);           	
         }
         registry.setInquiryURI(queryManagerURI);
         registry.setPublishURI(lifeCycleManagerURI);

Modified: juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java
URL: http://svn.apache.org/viewvc/juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java?rev=1234533&r1=1234532&r2=1234533&view=diff
==============================================================================
--- juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java (original)
+++ juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java Sun Jan
22 15:58:13 2012
@@ -39,6 +39,7 @@ import javax.xml.transform.stream.Stream
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.ws.scout.transport.LocalTransport;
 import org.apache.ws.scout.transport.Transport;
 import org.apache.ws.scout.transport.TransportException;
 import org.apache.ws.scout.util.XMLUtils;
@@ -141,6 +142,9 @@ public class RegistryV3Impl implements I
 	private String uddiVersion;
 	private String uddiNamespace;
 	
+	private String nodeName;
+	private String managerName;
+	
 	private ObjectFactory objectFactory = new ObjectFactory();
 	
 	private Marshaller marshaller = null;
@@ -151,21 +155,23 @@ public class RegistryV3Impl implements I
 	/**
 	 * Creates a new instance of RegistryImpl.
 	 */
-	public RegistryV3Impl(Properties props) {
+	public RegistryV3Impl(Properties props, String nodeName, String managerName) {
 		super();
 
-		this.init(props);
+		this.init(props, nodeName, managerName);
 	}
 
 	/**
 	 * 
 	 */
-	private void init(Properties props) {
+	private void init(Properties props, String nodeName, String managerName) {
 		// We need to have a non-null Properties
 		// instance so initialization takes place.
 		if (props == null)
 			props = new Properties();
 
+		this.nodeName = nodeName;
+		this.managerName = managerName;
 		// Override defaults with specific specific values
 		try {
 			String iURL = props.getProperty(INQUIRY_ENDPOINT_PROPERTY_NAME);
@@ -1075,10 +1081,10 @@ public class RegistryV3Impl implements I
 			request.getPublisherAssertion().addAll(Arrays.asList(assertionArray));
 		}
 
-        PublisherAssertions pa;
+        PublisherAssertions pa = null;
         JAXBElement<?> o = execute(this.objectFactory.createSetPublisherAssertions(request),

         		this.getPublishURI());
-        pa = (PublisherAssertions) o.getValue();
+        if (o!=null) pa = (PublisherAssertions) o.getValue();
 
         return pa;
 	}
@@ -1220,7 +1226,13 @@ public class RegistryV3Impl implements I
 
 		try {
 			// try to instantiate the TransportFactory
-			transport = (Transport) transportClass.newInstance();
+		    if (LocalTransport.class.getName().equals(className) && managerName!=null)
{
+		        transport = (Transport) transportClass.getConstructor(
+		                new Class[]{String.class,String.class})
+		                .newInstance(nodeName,managerName);
+		    } else {
+		        transport = (Transport) transportClass.newInstance();
+		    }
 		} catch (Exception ex) {
 			throw new RuntimeException(ex);
 		}

Modified: juddi/scout/trunk/src/main/java/org/apache/ws/scout/transport/LocalTransport.java
URL: http://svn.apache.org/viewvc/juddi/scout/trunk/src/main/java/org/apache/ws/scout/transport/LocalTransport.java?rev=1234533&r1=1234532&r2=1234533&view=diff
==============================================================================
--- juddi/scout/trunk/src/main/java/org/apache/ws/scout/transport/LocalTransport.java (original)
+++ juddi/scout/trunk/src/main/java/org/apache/ws/scout/transport/LocalTransport.java Sun
Jan 22 15:58:13 2012
@@ -15,7 +15,6 @@
  */
 package org.apache.ws.scout.transport;
 
-import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.net.URI;
 
@@ -39,8 +38,18 @@ import org.w3c.dom.Node;
 public class LocalTransport implements Transport
 {
   private static Log log = LogFactory.getLog(LocalTransport.class);
+  private String nodeName;
+  private String managerName;
 
-  /** 
+  public LocalTransport(){};
+  
+  public LocalTransport(String nodeName, String managerName) {
+    super();
+    this.nodeName = nodeName;
+    this.managerName = managerName;
+}
+
+/** 
    * Sends an element and returns an element.
    */
   public Element send(Element request,URI endpointURI)
@@ -59,8 +68,14 @@ public class LocalTransport implements T
     	log.debug("Method=" + methodName);
     	Class<?> c = Class.forName(className);
     	Object requestHandler = c.newInstance();
-    	Method method = c.getMethod(methodName, Element.class);
-    	Node node = (Node) method.invoke(requestHandler, request);
+    	Node node = null;
+    	if (managerName!=null) {
+    	    Method method = c.getMethod(methodName, Element.class, String.class, String.class);
+    	    node = (Node) method.invoke(requestHandler, request, nodeName, managerName);
+    	} else {
+    	    Method method = c.getMethod(methodName, Element.class);
+    	    node = (Node) method.invoke(requestHandler, request);
+    	}
     	if (node!=null && node.getFirstChild()!=null) {
     		response = (Element) node.getFirstChild();
     	}

Modified: juddi/scout/trunk/src/test/java/org/apache/ws/scout/BaseTestCase.java
URL: http://svn.apache.org/viewvc/juddi/scout/trunk/src/test/java/org/apache/ws/scout/BaseTestCase.java?rev=1234533&r1=1234532&r2=1234533&view=diff
==============================================================================
--- juddi/scout/trunk/src/test/java/org/apache/ws/scout/BaseTestCase.java (original)
+++ juddi/scout/trunk/src/test/java/org/apache/ws/scout/BaseTestCase.java Sun Jan 22 15:58:13
2012
@@ -65,22 +65,14 @@ public class BaseTestCase
         try
         {
         	String envUDDIVersion =  System.getenv("uddi.version");
-        	if (envUDDIVersion==null) envUDDIVersion = "2";
+        	if (envUDDIVersion==null) envUDDIVersion = "3";
         	String propertiesFile = "/scoutv" + envUDDIVersion + ".properties";
         	
         	System.out.println("Reading Scout Properties from: " + propertiesFile);
         	
             Properties scoutProperties = new Properties();
             scoutProperties.load(getClass().getResourceAsStream(propertiesFile));
-            
-            Properties juddiProperties = new Properties();
-            juddiProperties.load(getClass().getResourceAsStream("/juddi.properties"));
-            
-            final String INQUERY_URI      = scoutProperties.getProperty("inquery.uri");
-            final String PUBLISH_URI      = scoutProperties.getProperty("publish.uri");
-            final String SECURITY_URI    = scoutProperties.getProperty("security.uri");
-            final String TRANSPORT_CLASS  = scoutProperties.getProperty("transport.class");
-             
+          
             if (scoutProperties.getProperty("userid")!=null) {
                 userid = scoutProperties.getProperty("userid");
             }
@@ -88,12 +80,12 @@ public class BaseTestCase
                 passwd = scoutProperties.getProperty("password");
             }
             
-            if (scoutProperties.getProperty("userid2")!=null) {
-                userid = scoutProperties.getProperty("userid2");
-            }
-            if (scoutProperties.getProperty("password2")!=null) {
-                passwd = scoutProperties.getProperty("password2");
-            }
+//            if (scoutProperties.getProperty("userid2")!=null) {
+//                userid = scoutProperties.getProperty("userid2");
+//            }
+//            if (scoutProperties.getProperty("password2")!=null) {
+//                passwd = scoutProperties.getProperty("password2");
+//            }
             
             if (scoutProperties.getProperty("scout.proxy.uddiVersion") != null)
             {
@@ -104,35 +96,9 @@ public class BaseTestCase
             	uddinamespace = scoutProperties.getProperty("scout.proxy.uddiNamespace");
             }            
             
-            // Define connection configuration properties
-            // To query, you need only the query URL
-            Properties props = new Properties();
-            
-            props.setProperty("javax.xml.registry.queryManagerURL",
-            				System.getProperty("javax.xml.registry.queryManagerURL") == null ? 
-            				INQUERY_URI :
-            				System.getProperty("javax.xml.registry.queryManagerURL"));
-            props.setProperty("javax.xml.registry.lifeCycleManagerURL",
-            				System.getProperty("javax.xml.registry.lifeCycleManagerURL") == null ? 
-            				PUBLISH_URI :
-            				System.getProperty("javax.xml.registry.lifeCycleManagerURL"));
-            if ("3.0".equals(uddiversion)) {
-            	props.setProperty("javax.xml.registry.securityManagerURL",
-    				System.getProperty("javax.xml.registry.securityManagerURL") == null ? 
-    				SECURITY_URI :
-    				System.getProperty("javax.xml.registry.securityManagerURL"));
-            }
-            props.setProperty("javax.xml.registry.ConnectionFactoryClass",
-                    "org.apache.ws.scout.registry.ConnectionFactoryImpl");
-            props.setProperty("scout.proxy.transportClass", TRANSPORT_CLASS);
-            props.setProperty("javax.xml.registry.uddi.maxRows", String.valueOf(maxRows));
-       
-            props.setProperty("scout.proxy.uddiVersion", uddiversion);
-            props.setProperty("scout.proxy.uddiNamespace", uddinamespace);
-
             // Create the connection, passing it the configuration properties
             ConnectionFactory factory = ConnectionFactory.newInstance();
-            factory.setProperties(props);
+            factory.setProperties(scoutProperties);
             connection = factory.createConnection();
             connection2 = factory.createConnection();
         } catch (Exception e)

Modified: juddi/scout/trunk/src/test/java/org/apache/ws/scout/registry/BusinessLifeCyleManagerlTest.java
URL: http://svn.apache.org/viewvc/juddi/scout/trunk/src/test/java/org/apache/ws/scout/registry/BusinessLifeCyleManagerlTest.java?rev=1234533&r1=1234532&r2=1234533&view=diff
==============================================================================
--- juddi/scout/trunk/src/test/java/org/apache/ws/scout/registry/BusinessLifeCyleManagerlTest.java
(original)
+++ juddi/scout/trunk/src/test/java/org/apache/ws/scout/registry/BusinessLifeCyleManagerlTest.java
Sun Jan 22 15:58:13 2012
@@ -26,6 +26,7 @@ import org.apache.ws.scout.BaseTestCase;
 import org.apache.ws.scout.Creator;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 
@@ -251,7 +252,7 @@ public class BusinessLifeCyleManagerlTes
             assertEquals(BulkResponse.STATUS_SUCCESS, br2.getStatus());
             
             //delete association
-            BulkResponse br3 = blm.deleteAssociations((Collection<Key>)br2.getCollection());
+            BulkResponse br3 = blm.deleteAssociations(br2.getCollection());
             assertEquals(BulkResponse.STATUS_SUCCESS, br3.getStatus());
             
             //delete organizations

Modified: juddi/scout/trunk/src/test/java/org/apache/ws/scout/registry/ConnectionFactoryTest.java
URL: http://svn.apache.org/viewvc/juddi/scout/trunk/src/test/java/org/apache/ws/scout/registry/ConnectionFactoryTest.java?rev=1234533&r1=1234532&r2=1234533&view=diff
==============================================================================
--- juddi/scout/trunk/src/test/java/org/apache/ws/scout/registry/ConnectionFactoryTest.java
(original)
+++ juddi/scout/trunk/src/test/java/org/apache/ws/scout/registry/ConnectionFactoryTest.java
Sun Jan 22 15:58:13 2012
@@ -47,14 +47,18 @@ public class ConnectionFactoryTest exten
 
     public void testSetQueryManagerURL() {
         String url = "http://localhost";
-        factory.setQueryManagerURL(url);
+        Properties properties = new Properties();
+        properties.setProperty(ConnectionFactoryImpl.QUERYMANAGER_PROPERTY, url);
+        factory.setProperties(properties);
         assertEquals(url, factory.getQueryManagerURL());
         assertEquals(url, factory.getProperties().getProperty("javax.xml.registry.queryManagerURL"));
     }
 
     public void testSetLifeCycleURL() {
         String url = "http://localhost";
-        factory.setLifeCycleManagerURL(url);
+        Properties properties = new Properties();
+        properties.setProperty(ConnectionFactoryImpl.LIFECYCLEMANAGER_PROPERTY, url);
+        factory.setProperties(properties);
         assertEquals(url, factory.getLifeCycleManagerURL());
         assertEquals(url, factory.getProperties().getProperty("javax.xml.registry.lifeCycleManagerURL"));
     }
@@ -63,65 +67,75 @@ public class ConnectionFactoryTest exten
         String urns =
                 "urn:uuid:0a1324f7-6d4a-4d73-a088-9ab1d00c9a91,urn:uuid:23a5feac-26b9-4525-82fc-997885a0e6a2"
+ '|' +
                 "urn:uuid:1acf6ed2-cd6e-4797-aad8-8937a3cff88b,urn:uuid:152d6f28-cb56-4e5d-9f55-96b132def0e4";
-        factory.setSemanticEquivalences(urns);
+        Properties properties = new Properties();
+        properties.setProperty(ConnectionFactoryImpl.SEMANTICEQUIVALENCES_PROPERTY, urns);
+        factory.setProperties(properties);
         assertEquals(urns, factory.getSemanticEquivalences());
         assertEquals(urns, factory.getProperties().getProperty("javax.xml.registry.semanticEquivalences"));
     }
 
     public void testSetAuthenticationMethod() {
         String method = "HTTP_BASIC";
-        factory.setAuthenticationMethod(method);
+        Properties properties = new Properties();
+        properties.setProperty(ConnectionFactoryImpl.AUTHENTICATIONMETHOD_PROPERTY, method);
+        factory.setProperties(properties);
         assertEquals(method, factory.getAuthenticationMethod());
         assertEquals(method, factory.getProperties().getProperty("javax.xml.registry.security.authenticationMethod"));
     }
 
     public void testSetPostalAddressScheme() {
         String scheme = "User Defined";
-        factory.setPostalAddressScheme(scheme);
+        Properties properties = new Properties();
+        properties.setProperty(ConnectionFactoryImpl.POSTALADDRESSSCHEME_PROPERTY, scheme);
+        factory.setProperties(properties);
         assertEquals(scheme, factory.getPostalAddressScheme());
         assertEquals(scheme, factory.getProperties().getProperty("javax.xml.registry.postalAddressScheme"));
     }
 
     public void testMaxRows() {
-        Integer maxRows = new Integer(1234);
-        factory.setMaxRows(maxRows);
+        Integer maxRows = 1234;
+        Properties properties = new Properties();
+        properties.setProperty(ConnectionFactoryImpl.MAXROWS_PROPERTY, String.valueOf(maxRows));
+        factory.setProperties(properties);
         assertEquals(maxRows, factory.getMaxRows());
         assertEquals(maxRows.toString(), factory.getProperties().getProperty("javax.xml.registry.uddi.maxRows"));
     }
 
     public void testNullQueryManagerURL() {
-        factory.setQueryManagerURL(null);
+        factory.setProperties(null);
         assertFalse(factory.getProperties().containsKey("javax.xml.registry.queryManagerURL"));
     }
 
     public void testNullLifeCycleManagerURL() {
-        factory.setLifeCycleManagerURL(null);
+        factory.setProperties(null);
         assertFalse(factory.getProperties().containsKey("javax.xml.registry.lifeCycleManagerURL"));
     }
 
     public void testNullSemanticEquivalences() {
-        factory.setSemanticEquivalences(null);
+        factory.setProperties(null);
         assertFalse(factory.getProperties().containsKey("javax.xml.registry.semanticEquivalences"));
     }
 
     public void testNullAuthenticationMethod() {
-        factory.setAuthenticationMethod(null);
+        factory.setProperties(null);
         assertFalse(factory.getProperties().containsKey("javax.xml.registry.security.authenticationMethod"));
     }
 
     public void testNullMaxRows() {
-        factory.setMaxRows(null);
+        factory.setProperties(null);
         assertFalse(factory.getProperties().containsKey("javax.xml.registry.uddi.maxRows"));
     }
 
     public void testNullPostalAddressScheme() {
-        factory.setPostalAddressScheme(null);
+        factory.setProperties(null);
         assertFalse(factory.getProperties().containsKey("javax.xml.registry.postalAddressScheme"));
     }
 
     public void testCreateConnection() throws JAXRException {
-        factory.setQueryManagerURL("http://localhost");
-        factory.setLifeCycleManagerURL("http://localhost");
+        Properties properties = new Properties();
+        properties.setProperty(ConnectionFactoryImpl.QUERYMANAGER_PROPERTY, "http://localhost");
+        properties.setProperty(ConnectionFactoryImpl.LIFECYCLEMANAGER_PROPERTY , "http://localhost");
+        factory.setProperties(properties);
         Connection c = factory.createConnection();
         try {
             assertEquals(ConnectionImpl.class, c.getClass());
@@ -131,8 +145,9 @@ public class ConnectionFactoryTest exten
     }
 
     public void testCreateConnectionWithNullLifeCycleURL() throws JAXRException {
-        factory.setQueryManagerURL("http://localhost");
-        factory.setLifeCycleManagerURL(null);
+        Properties properties = new Properties();
+        properties.setProperty(ConnectionFactoryImpl.QUERYMANAGER_PROPERTY, "http://localhost");
+        factory.setProperties(properties);
         Connection c = factory.createConnection();
         try {
             assertEquals(ConnectionImpl.class, c.getClass());
@@ -141,33 +156,6 @@ public class ConnectionFactoryTest exten
         }
     }
 
-// KS: This is no longer invalid..
-//    
-//    public void testCreateConnectionWithInvalidQueryURL() {
-//        factory.setQueryManagerURL("foo:bar");
-//        try {
-//            factory.createConnection();
-//            fail("did not reject invalid URL");
-//        } catch (InvalidRequestException e) {
-//            // OK
-//        } catch (JAXRException e) {
-//            fail("threw JAXRException");
-//        }
-//    }
-//
-//    public void testCreateConnectionWithInvalidLifeCycleURL() {
-//        factory.setQueryManagerURL("http://localhost");
-//        factory.setLifeCycleManagerURL("foo:bar");
-//        try {
-//            factory.createConnection();
-//            fail("did not reject invalid URL");
-//        } catch (InvalidRequestException e) {
-//            // OK
-//        } catch (JAXRException e) {
-//            fail("threw JAXRException");
-//        }
-//    }
-
     public void testCreateConnectionWithNullQueryURL() {
         try {
             factory.createConnection();

Added: juddi/scout/trunk/src/test/resources/META-INF/jaxr-uddi.xml
URL: http://svn.apache.org/viewvc/juddi/scout/trunk/src/test/resources/META-INF/jaxr-uddi.xml?rev=1234533&view=auto
==============================================================================
--- juddi/scout/trunk/src/test/resources/META-INF/jaxr-uddi.xml (added)
+++ juddi/scout/trunk/src/test/resources/META-INF/jaxr-uddi.xml Sun Jan 22 15:58:13 2012
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<uddi>
+  <reloadDelay>5000</reloadDelay>
+  <manager name="jaxr">
+    <nodes>
+      <node isHomeJUDDI="false">
+      <name>jaxr-client</name>
+      <description>JUDDI Client configuration using by JAXR for UDDI v3 UDDI-Servers</description>
+      <proxyTransport>org.apache.juddi.v3.client.transport.JAXWSTransport</proxyTransport>
+      <inquiryUrl>${javax.xml.registry.queryManagerURL}</inquiryUrl>
+      <publishUrl>${javax.xml.registry.lifeCycleManagerURL}</publishUrl>
+      <securityUrl>${javax.xml.registry.securityManagerURL}</securityUrl>
+    </node>
+    </nodes>
+  </manager>
+</uddi>
\ No newline at end of file

Modified: juddi/scout/trunk/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/juddi/scout/trunk/src/test/resources/log4j.properties?rev=1234533&r1=1234532&r2=1234533&view=diff
==============================================================================
--- juddi/scout/trunk/src/test/resources/log4j.properties (original)
+++ juddi/scout/trunk/src/test/resources/log4j.properties Sun Jan 22 15:58:13 2012
@@ -5,7 +5,7 @@ log4j.debug
 log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
 log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
 log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
-log4j.appender.CONSOLE.Threshold=INFO
+log4j.appender.CONSOLE.Threshold=DEBUG
 
 # LOGFILE is set to be a RollingFileAppender appender using a TTCCLayout.
 log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender

Modified: juddi/scout/trunk/src/test/resources/scoutv2.properties
URL: http://svn.apache.org/viewvc/juddi/scout/trunk/src/test/resources/scoutv2.properties?rev=1234533&r1=1234532&r2=1234533&view=diff
==============================================================================
--- juddi/scout/trunk/src/test/resources/scoutv2.properties (original)
+++ juddi/scout/trunk/src/test/resources/scoutv2.properties Sun Jan 22 15:58:13 2012
@@ -2,40 +2,28 @@
 # TRANSPORT
 ########################################################################################################
 #local transport
-inquery.uri     =org.apache.juddi.registry.local.InquiryService#inquire
-publish.uri     =org.apache.juddi.registry.local.PublishService#publish
-transport.class =org.apache.ws.scout.transport.LocalTransport
+javax.xml.registry.queryManagerURL     =org.apache.juddi.registry.local.InquiryService#inquire
+javax.xml.registry.lifeCycleManagerURL =org.apache.juddi.registry.local.PublishService#publish
+scout.proxy.transportClass             =org.apache.ws.scout.transport.LocalTransport
 #rmi transport        
-#inquery.uri     =jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire
-#publish.uri     =jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish
-#transport.class =org.apache.ws.scout.transport.RMITransport
+#javax.xml.registry.queryManagerURL     =jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire
+#javax.xml.registry.lifeCycleManagerURL =jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish
+#transport.class                        =org.apache.ws.scout.transport.RMITransport
 #axis transport
-#inquery.uri     =http://localhost:8080/juddi/inquiry
-#publish.uri     =http://localhost:8080/juddi/publish
-#transport.class =org.apache.ws.scout.transport.AxisTransport
+#javax.xml.registry.queryManagerURL     =http://localhost:8080/juddi/inquiry
+#javax.xml.registry.lifeCycleManagerURL =http://localhost:8080/juddi/publish
+#transport.class                        =org.apache.ws.scout.transport.AxisTransport
 #axis2 transport
-#inquery.uri     =http://localhost:8080/juddi/inquiry
-#publish.uri     =http://localhost:8080/juddi/publish
-#transport.class =org.apache.ws.scout.transport.Axis2Transport
+#javax.xml.registry.queryManagerURL     =http://localhost:8080/juddi/inquiry
+#javax.xml.registry.lifeCycleManagerURL =http://localhost:8080/juddi/publish
+#transport.class                        =org.apache.ws.scout.transport.Axis2Transport
 #soap transport
-#inquery.uri     =http://kstam.int.atl.jboss.com:9901/uddi/inquiry_v2
-#publish.uri     =http://kstam.int.atl.jboss.com:9901/uddi/publish_v2
-#transport.class =org.apache.ws.scout.transport.AxisTransport
+#javax.xml.registry.queryManagerURL     =http://kstam.int.atl.jboss.com:9901/uddi/inquiry_v2
+#javax.xml.registry.lifeCycleManagerURL =http://kstam.int.atl.jboss.com:9901/uddi/publish_v2
+#transport.class                        =org.apache.ws.scout.transport.AxisTransport
 #userid          =Administrator
 #password        =password
 
-
-####
-#### Settings for testing w/juddi v3+
-#axis transport->v3 juddi
-#inquery.uri     =http://localhost:8080/juddi/services/inquiry
-#publish.uri     =http://localhost:8080/juddi/services/publish
-#security.uri   =http://localhost:8080/juddi/services/security
-#transport.class =org.apache.ws.scout.transport.AxisTransport
-#scout.proxy.uddiVersion=3.0
-#scout.proxy.uddiNamespace=urn:uddi-org:api_v3
-
-
 ########################################################################################################
 # SECURITY
 ########################################################################################################

Modified: juddi/scout/trunk/src/test/resources/scoutv3.properties
URL: http://svn.apache.org/viewvc/juddi/scout/trunk/src/test/resources/scoutv3.properties?rev=1234533&r1=1234532&r2=1234533&view=diff
==============================================================================
--- juddi/scout/trunk/src/test/resources/scoutv3.properties (original)
+++ juddi/scout/trunk/src/test/resources/scoutv3.properties Sun Jan 22 15:58:13 2012
@@ -2,10 +2,10 @@
 # TRANSPORT
 ########################################################################################################
 #axis transport
-inquery.uri     =http://localhost:8880/juddiv3/services/inquiry
-publish.uri     =http://localhost:8880/juddiv3/services/publish
-security.uri	=http://localhost:8880/juddiv3/services/security
-transport.class =org.apache.ws.scout.transport.AxisTransport
+javax.xml.registry.queryManagerURL     =http://localhost:8880/juddiv3/services/inquiry
+javax.xml.registry.lifeCycleManagerURL =http://localhost:8880/juddiv3/services/publish
+javax.xml.registry.securityManagerURL	 =http://localhost:8880/juddiv3/services/security
+scout.proxy.transportClass             =org.apache.ws.scout.transport.LocalTransport
 scout.proxy.uddiVersion=3.0
 scout.proxy.uddiNamespace=urn:uddi-org:api_v3
 #
@@ -15,4 +15,4 @@ scout.proxy.uddiNamespace=urn:uddi-org:a
 userid          =root
 password        =root
 
-javax.xml.registry.uddi.maxRows=10
+javax.xml.registry.uddi.maxRows=10
\ No newline at end of file



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


Mime
View raw message