Author: alexoree
Date: Sat Nov  9 18:38:10 2013
New Revision: 1540364

URL: http://svn.apache.org/r1540364
Log:
JUDDI-701 10 issues fixed
JUDDI-702 done
JUDDI-567 fixing the build

Added:
    juddi/trunk/juddi-client.net/juddi-client.net.test/WSDL2UDDITest.cs
Removed:
    
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/v3/auth/CryptorUtil.java
Modified:
    
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/Cryptor.java
    
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/CryptorFactory.java
    
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/cryptor/CryptorFactory.java
    
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/util/DynamicQuery.java

Added: juddi/trunk/juddi-client.net/juddi-client.net.test/WSDL2UDDITest.cs
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-client.net/juddi-client.net.test/WSDL2UDDITest.cs?rev=1540364&view=auto
==============================================================================
--- juddi/trunk/juddi-client.net/juddi-client.net.test/WSDL2UDDITest.cs (added)
+++ juddi/trunk/juddi-client.net/juddi-client.net.test/WSDL2UDDITest.cs Sat Nov 
 9 18:38:10 2013
@@ -0,0 +1,133 @@
+using net.java.dev.wadl;
+using NUnit.Framework;
+using org.apache.juddi.v3.client;
+using org.apache.juddi.v3.client.config;
+using org.apache.juddi.v3.client.mapping;
+using org.apache.juddi.v3.client.transport;
+using org.uddi.apiv3;
+using org.xmlsoap.schemas.easyWsdl;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+
+namespace juddi_client.net.test
+{
+    [TestFixture]
+    public class WSDL2UDDITest
+    {
+        string path = "";
+        public WSDL2UDDITest()
+        {
+            Console.Out.WriteLine(Directory.GetCurrentDirectory());
+            path = Directory.GetCurrentDirectory() + 
Path.DirectorySeparatorChar + "resources";
+            if (!Directory.Exists(path))
+            {
+                path = Directory.GetCurrentDirectory() + 
Path.DirectorySeparatorChar + ".." + Path.DirectorySeparatorChar + ".." + 
Path.DirectorySeparatorChar + "resources";
+                Console.Out.WriteLine(path);
+            }
+            if (!Directory.Exists(path))
+            {
+                path = Environment.GetEnvironmentVariable("JUDDI_TEST_RES");
+                Console.Out.WriteLine(path);
+            }
+            if (path == null || !Directory.Exists(path))
+            {
+                path = null;
+                Console.Out.WriteLine("uh oh, I can't find the resources 
directory, override with the environment variable JUDDI_TEST_RES=<path>");
+            }
+        }
+
+        [Test]
+        public void juddiapiflattenedTest()
+        {
+            Assume.That(path != null);
+            runTest(path + Path.DirectorySeparatorChar + 
"juddi-api-flattened.wsdl");
+        }
+
+
+        [Test]
+        public void ReadWSDLTest1()
+        {
+            ReadWSDL wsi = new ReadWSDL();
+            try
+            {
+                org.xmlsoap.schemas.easyWsdl.tDefinitions wsdlDefinition = 
wsi.readWSDL(null);
+            }
+            catch (ArgumentNullException)
+            {
+
+            }
+        }
+
+        [Test]
+        public void WSDL2UDDITest2()
+        {
+            try
+            {
+                WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, null, null);
+            }
+            catch (ArgumentNullException)
+            {
+
+            }
+        }
+
+
+        void runTest(String pathAndFile)
+        {
+            Assume.That(File.Exists(pathAndFile));
+
+            String wsdlURL = 
"http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL";;
+            ReadWSDL wsi = new ReadWSDL();
+            org.xmlsoap.schemas.easyWsdl.tDefinitions wsdlDefinition = 
wsi.readWSDL(
+               pathAndFile
+                );
+            Properties properties1 = new Properties();
+            properties1.put("keyDomain", "my.key.domain");
+            WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizer(), 
properties1);
+            Assert.NotNull(wsdl2UDDI);
+
+            Dictionary<QName, tPortType> portTypes1 = (Dictionary<QName, 
tPortType>)wsdlDefinition.getAllPortTypes();
+            Assert.NotNull(portTypes1);
+            Assert.True(portTypes1.Count > 0);
+            List<tModel> portTypeTModels1 = 
wsdl2UDDI.createWSDLPortTypeTModels(wsdlURL, portTypes1);
+
+            Assert.NotNull(portTypeTModels1);
+            Assert.True(portTypeTModels1.Count > 0);
+
+
+            Dictionary<QName, tBinding> allBindings1 = 
wsdlDefinition.getAllBindings();
+            Assert.NotNull(allBindings1);
+            Assert.True(allBindings1.Count > 0);
+            List<tModel> createWSDLBindingTModels1 = 
wsdl2UDDI.createWSDLBindingTModels(wsdlURL, allBindings1);
+            Assert.NotNull(createWSDLBindingTModels1);
+            Assert.True(createWSDLBindingTModels1.Count > 0);
+
+            businessService[] businessServices = 
wsdl2UDDI.createBusinessServices(wsdlDefinition);
+
+            Assert.NotNull(businessServices);
+            Assert.True(businessServices.Length > 0);
+            for (int i = 0; i < businessServices.Length; i++)
+            {
+                foreach (bindingTemplate bt in 
businessServices[i].bindingTemplates)
+                {
+                    Assert.NotNull(bt);
+                    Assert.NotNull(bt.bindingKey);
+                    Assert.NotNull(bt.Item);
+                    Assert.NotNull(bt.serviceKey);
+                    Assert.True(bt.Item is accessPoint);
+                    Assert.NotNull(((accessPoint)bt.Item).useType);
+                    Assert.NotNull(((accessPoint)bt.Item).Value);
+                }
+                Assert.True(businessServices[i].bindingTemplates.Length > 0);
+                Assert.NotNull(businessServices[i].description);
+                Assert.True(businessServices[i].description.Length > 0);
+                Assert.NotNull(businessServices[i].serviceKey);
+            }
+
+
+        }
+
+    }
+}

Modified: 
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/Cryptor.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/Cryptor.java?rev=1540364&r1=1540363&r2=1540364&view=diff
==============================================================================
--- 
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/Cryptor.java
 (original)
+++ 
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/Cryptor.java
 Sat Nov  9 18:38:10 2013
@@ -24,7 +24,6 @@ import java.security.NoSuchAlgorithmExce
 import javax.crypto.BadPaddingException;
 import javax.crypto.IllegalBlockSizeException;
 import javax.crypto.NoSuchPaddingException;
-import org.apache.juddi.v3.client.config.UDDIClerk;
 
 /**
  * @author Anou Manavalan

Modified: 
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/CryptorFactory.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/CryptorFactory.java?rev=1540364&r1=1540363&r2=1540364&view=diff
==============================================================================
--- 
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/CryptorFactory.java
 (original)
+++ 
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/CryptorFactory.java
 Sat Nov  9 18:38:10 2013
@@ -14,18 +14,20 @@
  * limitations under the License.
  *
  */
-
 package org.apache.juddi.v3.client.cryptor;
 
 import java.util.HashMap;
 import java.util.Map;
+import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.juddi.v3.client.ClassUtil;
+import org.apache.juddi.v3.client.config.ClientConfig;
+import org.apache.juddi.v3.client.config.Property;
 
 /**
- * Used to create the org.apache.juddi.cryptor.Cryptor implementation
- * as specified by the 'juddi.cryptor' property. Defaults to
+ * Used to create the org.apache.juddi.cryptor.Cryptor implementation as
+ * specified by the 'juddi.cryptor' property. Defaults to
  * org.apache.juddi.cryptor.DefaultCryptor if an implementation is not
  * specified.
  *
@@ -33,41 +35,93 @@ import org.apache.juddi.v3.client.ClassU
  * @author <a href="mailto:[email protected]";>Jeff Faath</a>
  */
 public abstract class CryptorFactory {
-       private static Log log = LogFactory.getLog(CryptorFactory.class);
-
-       // the shared Cryptor instance
-       private static Cryptor cryptor = null;
 
-        
-       private static Map<String, Cryptor> cache = new HashMap<String, 
Cryptor>();
-        
-        
-        public static Cryptor getCryptor(String className) throws Exception {
-                if (cache.containsKey(className))
-                    return cache.get(className);
-               Class<?> cryptorClass = null;
-               try {
-                       // Use Loader to locate & load the Cryptor 
implementation
-                       cryptorClass = ClassUtil.forName(className, 
CryptorFactory.class);
-               }
-               catch(ClassNotFoundException e) {
-                       log.error("The specified Cryptor class '" + className + 
"' was not found in classpath.");
-                       log.error(e);
-                        throw e;
-               }
-       
-               try {
-                       // try to instantiate the Cryptor implementation
-                       cryptor = (Cryptor)cryptorClass.newInstance();
-                        cache.put(className, cryptor);
-               }
-               catch(Exception e) {
-                       log.error("Exception while attempting to instantiate 
the implementation of Cryptor: " + cryptorClass.getName() + "\n" + 
e.getMessage());
-                       log.error(e);
-                        throw e;
-               }
-       
-               return cryptor;
-       }
+    private static Log log = LogFactory.getLog(CryptorFactory.class);
+    // the shared Cryptor instance
+    private static Cryptor cryptor = null;
+    private static Map<String, Cryptor> cache = new HashMap<String, Cryptor>();
+
+    /**
+     * Returns a crypto provider with the matching classname, throws if not 
possible
+     * @param className
+     * @return
+     * @throws Exception 
+     */
+    public static Cryptor getCryptor(String className) throws Exception {
+        if (cache.containsKey(className)) {
+            return cache.get(className);
+        }
+        Class<?> cryptorClass = null;
+        try {
+            // Use Loader to locate & load the Cryptor implementation
+            cryptorClass = ClassUtil.forName(className, CryptorFactory.class);
+        } catch (ClassNotFoundException e) {
+            log.error("The specified Cryptor class '" + className + "' was not 
found in classpath.");
+            log.error(e);
+            throw e;
+        }
+
+        try {
+            // try to instantiate the Cryptor implementation
+            cryptor = (Cryptor) cryptorClass.newInstance();
+            cache.put(className, cryptor);
+        } catch (Exception e) {
+            log.error("Exception while attempting to instantiate the 
implementation of Cryptor: " + cryptorClass.getName() + "\n" + e.getMessage());
+            log.error(e);
+            throw e;
+        }
+
+        return cryptor;
+    }
+
+    
+    /**
+     * Returns a new instance of a CryptorFactory.
+     * 
+     * @return Cryptor
+     */
+    public static synchronized Cryptor getCryptor() {
+        if (cryptor == null) {
+            cryptor = createCryptor();
+        }
+        return cryptor;
+    }
+    
+    /*
+     * Returns a new instance of a Cryptor.
+     * 
+     * @return Cryptor
+     */
+    private static synchronized Cryptor createCryptor() {
+        if (cryptor != null) {
+            return cryptor;
+        }
+
+        // grab class name of the Cryptor implementation to create
+        String className = Property.DEFAULT_CRYPTOR;
+       
+        // write the Cryptor implementation name to the log
+        log.debug("Cryptor Implementation = " + className);
+
+        Class<?> cryptorClass = null;
+        try {
+            // Use Loader to locate & load the Cryptor implementation
+            cryptorClass = ClassUtil.forName(className, CryptorFactory.class);
+        } catch (ClassNotFoundException e) {
+            log.error("The specified Cryptor class '" + className + "' was not 
found in classpath.");
+            log.error(e);
+        }
+
+        if (cryptorClass != null) {
+            try {
+                // try to instantiate the Cryptor implementation
+                cryptor = (Cryptor) cryptorClass.newInstance();
+            } catch (Exception e) {
+                log.error("Exception while attempting to instantiate the 
implementation of Cryptor: " + cryptorClass.getName() + "\n" + e.getMessage());
+                log.error(e);
+            }
+        }
 
+        return cryptor;
+    }
 }
\ No newline at end of file

Modified: 
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/cryptor/CryptorFactory.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/cryptor/CryptorFactory.java?rev=1540364&r1=1540363&r2=1540364&view=diff
==============================================================================
--- 
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/cryptor/CryptorFactory.java
 (original)
+++ 
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/cryptor/CryptorFactory.java
 Sat Nov  9 18:38:10 2013
@@ -30,12 +30,14 @@ import org.apache.juddi.v3.client.crypto
  * org.apache.juddi.cryptor.DefaultCryptor if an implementation is not
  * specified.<Br>
  * <br>
+ * This class is a special instance that loads from the juddi server side 
config file.<br>
  *
- * @deprecated Use org.apache.juddi.v3.client.cryptor.CryptorFactor 
+ * Use org.apache.juddi.v3.client.cryptor.CryptorFactor for all client side 
actions
+ * @see org.apache.juddi.v3.client.cryptor.CryptorFactory
  * @author Steve Viens ([email protected])
  * @author <a href="mailto:[email protected]";>Jeff Faath</a>
  */
-@Deprecated
+
 public abstract class CryptorFactory {
 
     private static Log log = LogFactory.getLog(CryptorFactory.class);
@@ -55,26 +57,8 @@ public abstract class CryptorFactory {
     }
 
     public static synchronized Cryptor getCryptor(String className) throws 
Exception {
-        Class<?> cryptorClass = null;
-        try {
-            // Use Loader to locate & load the Cryptor implementation
-            cryptorClass = ClassUtil.forName(className, CryptorFactory.class);
-        } catch (ClassNotFoundException e) {
-            log.error("The specified Cryptor class '" + className + "' was not 
found in classpath.");
-            log.error(e);
-            throw e;
-        }
-
-        try {
-            // try to instantiate the Cryptor implementation
-            cryptor = (Cryptor) cryptorClass.newInstance();
-        } catch (Exception e) {
-            log.error("Exception while attempting to instantiate the 
implementation of Cryptor: " + cryptorClass.getName() + "\n" + e.getMessage());
-            log.error(e);
-            throw e;
-        }
-
-        return cryptor;
+        return org.apache.juddi.cryptor.CryptorFactory.getCryptor(className);
+        
     }
 
     /*

Modified: 
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/util/DynamicQuery.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/util/DynamicQuery.java?rev=1540364&r1=1540363&r2=1540364&view=diff
==============================================================================
--- 
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/util/DynamicQuery.java
 (original)
+++ 
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/util/DynamicQuery.java
 Sat Nov  9 18:38:10 2013
@@ -28,21 +28,21 @@ import javax.persistence.EntityManager;
  * @author Steve Viens ([email protected])
  */
 public class DynamicQuery {
-       public static String CLAUSE_WHERE = "where";
-       public static String CLAUSE_GROUPBY = "group by";
-       public static String CLAUSE_ORDERBY = "order by";
-       public static String CLAUSE_HAVING = "having";
-       public static String OPERATOR_OR = "or";
-       public static String OPERATOR_AND = "and";
-       public static String PREDICATE_EQUALS = "=";
-       public static String PREDICATE_NOTEQUALS = "<>";
-       public static String PREDICATE_LIKE = "like";
-       public static String PREDICATE_IN = "in";
-       public static String PREDICATE_GREATERTHAN = ">";
-       public static String PREDICATE_LESSTHAN = "<";
-       public static String SORT_ASC = "asc";
-       public static String SORT_DESC = "desc";
-       public static String WILDCARD = "%";
+       public static final String CLAUSE_WHERE = "where";
+       public static final String CLAUSE_GROUPBY = "group by";
+       public static final String CLAUSE_ORDERBY = "order by";
+       public static final String CLAUSE_HAVING = "having";
+       public static final String OPERATOR_OR = "or";
+       public static final String OPERATOR_AND = "and";
+       public static final String PREDICATE_EQUALS = "=";
+       public static final String PREDICATE_NOTEQUALS = "<>";
+       public static final String PREDICATE_LIKE = "like";
+       public static final String PREDICATE_IN = "in";
+       public static final String PREDICATE_GREATERTHAN = ">";
+       public static final String PREDICATE_LESSTHAN = "<";
+       public static final String SORT_ASC = "asc";
+       public static final String SORT_DESC = "desc";
+       public static final String WILDCARD = "%";
        
        private Vector<Object> values = null;
        private StringBuffer sql = null;



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to