SCOUT-128, set the UDDI version to "3.0" if 'v3' is found in the connection URL.

In some tests the TCK connects directly to scout, not using the JNDI lookup. In this case the UDDI version property is not set, and Scout defaults it to "2.0", which leads to issues. The preferred way to solve this is to have the TCK set this property, but this does seem that easy to do. To work around this issue we check the juddi URL, and if this contains 'v3' we automatically set the UDDI version to "3.0" if it is not set. This maybe a jUDDI specific fix. I'm open to other suggestions.

git-svn-id: https://svn.apache.org/repos/asf/juddi/scout/trunk@1295121 13f79535-47bb-0310-9956-ffa450edef68
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 5cd0fca..6d2be0d 100644
--- a/src/main/java/org/apache/ws/scout/registry/ConnectionImpl.java
+++ b/src/main/java/org/apache/ws/scout/registry/ConnectionImpl.java
@@ -60,6 +60,16 @@
         String val = properties.getProperty(ConnectionFactoryImpl.MAXROWS_PROPERTY);

         maxRows = (val == null) ? -1 : Integer.valueOf(val);

         uddiVersion = properties.getProperty(ConnectionFactoryImpl.UDDI_VERSION_PROPERTY, DEFAULT_UDDI_VERSION);

+        //The TCK does not set the UDDI_VERSION, so if the lifecycle URL contains 'v3' we 

+        //automagically set the version to be "3.0"

+        if (!properties.contains(ConnectionFactoryImpl.UDDI_VERSION_PROPERTY) 

+                && (properties.contains(ConnectionFactoryImpl.LIFECYCLEMANAGER_PROPERTY)) 

+                && properties.getProperty(ConnectionFactoryImpl.LIFECYCLEMANAGER_PROPERTY).contains("v3") ) {

+            properties.setProperty(ConnectionFactoryImpl.UDDI_VERSION_PROPERTY, "3.0");

+            uddiVersion = "3.0";

+            String securityManager = properties.getProperty(ConnectionFactoryImpl.LIFECYCLEMANAGER_PROPERTY).replace("publish", "security");

+            properties.setProperty(ConnectionFactoryImpl.SECURITYMANAGER_PROPERTY, securityManager);

+        }

      

         String uddiConfigFile      = properties.getProperty(JUDDI_CLIENT_CONFIG_FILE);// DEFAULT_JUDDI_CLIENT_CONFIG_FILE);

         if (isUDDIv3(uddiVersion)) {