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.
git-svn-id: https://svn.apache.org/repos/asf/juddi/scout/trunk@1234533 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index 409db07..c545861 100644
--- a/pom.xml
+++ b/pom.xml
@@ -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>
diff --git a/src/main/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerV3Impl.java b/src/main/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerV3Impl.java
index 84ed199..ea9c850 100644
--- a/src/main/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerV3Impl.java
+++ b/src/main/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerV3Impl.java
@@ -823,7 +823,7 @@
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()];
diff --git a/src/main/java/org/apache/ws/scout/registry/ConnectionFactoryImpl.java b/src/main/java/org/apache/ws/scout/registry/ConnectionFactoryImpl.java
index 6e43871..3404ef4 100644
--- a/src/main/java/org/apache/ws/scout/registry/ConnectionFactoryImpl.java
+++ b/src/main/java/org/apache/ws/scout/registry/ConnectionFactoryImpl.java
@@ -41,13 +41,17 @@
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 @@
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 @@
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 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 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 @@
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 @@
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;
- }
}
diff --git a/src/main/java/org/apache/ws/scout/registry/ConnectionImpl.java b/src/main/java/org/apache/ws/scout/registry/ConnectionImpl.java
index 4324da9..023f916 100644
--- a/src/main/java/org/apache/ws/scout/registry/ConnectionImpl.java
+++ b/src/main/java/org/apache/ws/scout/registry/ConnectionImpl.java
@@ -25,6 +25,11 @@
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 @@
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 @@
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 @@
*/
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 @@
* 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);
diff --git a/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java b/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java
index ec2c829..c746e99 100644
--- a/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java
+++ b/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java
@@ -39,6 +39,7 @@
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 @@
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 @@
/**
* 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 @@
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 @@
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);
}
diff --git a/src/main/java/org/apache/ws/scout/transport/LocalTransport.java b/src/main/java/org/apache/ws/scout/transport/LocalTransport.java
index 485f630..1e729f2 100644
--- a/src/main/java/org/apache/ws/scout/transport/LocalTransport.java
+++ b/src/main/java/org/apache/ws/scout/transport/LocalTransport.java
@@ -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 @@
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 @@
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();
}
diff --git a/src/test/java/org/apache/ws/scout/BaseTestCase.java b/src/test/java/org/apache/ws/scout/BaseTestCase.java
index dcfb7a2..9effa72 100644
--- a/src/test/java/org/apache/ws/scout/BaseTestCase.java
+++ b/src/test/java/org/apache/ws/scout/BaseTestCase.java
@@ -65,22 +65,14 @@
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 @@
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 @@
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)
diff --git a/src/test/java/org/apache/ws/scout/registry/BusinessLifeCyleManagerlTest.java b/src/test/java/org/apache/ws/scout/registry/BusinessLifeCyleManagerlTest.java
index 8a961aa..5ac2277 100644
--- a/src/test/java/org/apache/ws/scout/registry/BusinessLifeCyleManagerlTest.java
+++ b/src/test/java/org/apache/ws/scout/registry/BusinessLifeCyleManagerlTest.java
@@ -26,6 +26,7 @@
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 @@
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
diff --git a/src/test/java/org/apache/ws/scout/registry/ConnectionFactoryTest.java b/src/test/java/org/apache/ws/scout/registry/ConnectionFactoryTest.java
index a3b9733..1b9bab6 100644
--- a/src/test/java/org/apache/ws/scout/registry/ConnectionFactoryTest.java
+++ b/src/test/java/org/apache/ws/scout/registry/ConnectionFactoryTest.java
@@ -47,14 +47,18 @@
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 @@
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 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 @@
}
}
-// 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();
diff --git a/src/test/resources/META-INF/jaxr-uddi.xml b/src/test/resources/META-INF/jaxr-uddi.xml
new file mode 100644
index 0000000..68ff957
--- /dev/null
+++ b/src/test/resources/META-INF/jaxr-uddi.xml
@@ -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
diff --git a/src/test/resources/log4j.properties b/src/test/resources/log4j.properties
index da74752..f19255e 100644
--- a/src/test/resources/log4j.properties
+++ b/src/test/resources/log4j.properties
@@ -5,7 +5,7 @@
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
diff --git a/src/test/resources/scoutv2.properties b/src/test/resources/scoutv2.properties
index 18fb346..8a34af2 100644
--- a/src/test/resources/scoutv2.properties
+++ b/src/test/resources/scoutv2.properties
@@ -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
########################################################################################################
diff --git a/src/test/resources/scoutv3.properties b/src/test/resources/scoutv3.properties
index e774a33..8acce35 100644
--- a/src/test/resources/scoutv3.properties
+++ b/src/test/resources/scoutv3.properties
@@ -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 @@
userid =root
password =root
-javax.xml.registry.uddi.maxRows=10
+javax.xml.registry.uddi.maxRows=10
\ No newline at end of file