juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexo...@apache.org
Subject svn commit: r1542568 - in /juddi/trunk: ./ juddi-client/src/test/java/org/apache/juddi/v3/client/ juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/ juddi-core-openjpa/src/test/resources/ juddi-core/src/main/java/org/apache/juddi/api/impl/ ...
Date Sat, 16 Nov 2013 20:59:12 GMT
Author: alexoree
Date: Sat Nov 16 20:59:12 2013
New Revision: 1542568

URL: http://svn.apache.org/r1542568
Log:
JUDDI-713 fixed for the tests with the largest output
JUDDI-712 fixed

Added:
    juddi/trunk/juddi-core-openjpa/src/test/resources/keystore.jks   (with props)
    juddi/trunk/juddi-core-openjpa/src/test/resources/truststore.jks   (with props)
    juddi/trunk/juddi-core/src/test/resources/keystore.jks   (with props)
    juddi/trunk/juddi-core/src/test/resources/truststore.jks   (with props)
Modified:
    juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/DigSigUtilTest.java
    juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/BPEL2UDDITest.java
    juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/WADL2UDDITest.java
    juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/WSDL2UDDITest.java
    juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/WSDLinaUDDIRegistryTest.java
    juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java
    juddi/trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java
    juddi/trunk/juddi-core/src/main/resources/messages.properties
    juddi/trunk/juddi-core/src/test/java/org/apache/juddi/api/impl/API_141_JIRATest.java
    juddi/trunk/readme.txt
    juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckBusiness.java
    juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckBusinessService.java

Modified: juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/DigSigUtilTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/DigSigUtilTest.java?rev=1542568&r1=1542567&r2=1542568&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/DigSigUtilTest.java (original)
+++ juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/DigSigUtilTest.java Sat Nov 16 20:59:12 2013
@@ -44,10 +44,13 @@ public class DigSigUtilTest {
     org.apache.juddi.v3.client.cryptor.DigSigUtil ds = null;
 
     public DigSigUtilTest() throws Exception {
+        if (System.getProperty("debug") != null && System.getProperty("debug").equalsIgnoreCase("true")) {
+            serialize = true;
+        }
         Default();
     }
+    static boolean serialize = false;
 
-    
     void SetCertStoreSettigns() {
         ds.put(DigSigUtil.SIGNATURE_KEYSTORE_FILE, "./src/test/resources/keystore.jks");
         ds.put(DigSigUtil.SIGNATURE_KEYSTORE_FILETYPE, "JKS");
@@ -99,6 +102,7 @@ public class DigSigUtilTest {
         be.getName().add(new Name("My biz", "en"));
 
         BusinessEntity signUDDI_JAXBObject = ds.signUddiEntity(be);
+        if (serialize)
         DigSigUtil.JAXB_ToStdOut(signUDDI_JAXBObject);
         Assert.assertNotSame("items are the same", be, signUDDI_JAXBObject);
         //System.out.println("verifing");
@@ -126,6 +130,7 @@ public class DigSigUtilTest {
         be.getName().add(new Name("My biz", "en"));
 
         BusinessEntity signUDDI_JAXBObject = ds.signUddiEntity(be);
+        if (serialize)
         DigSigUtil.JAXB_ToStdOut(signUDDI_JAXBObject);
         Assert.assertNotSame("items are the same", be, signUDDI_JAXBObject);
         //System.out.println("verifing");
@@ -139,8 +144,8 @@ public class DigSigUtilTest {
         }
         validAllSignatureElementsArePresent(signUDDI_JAXBObject.getSignature());
     }
-    
-        @Test
+
+    @Test
     public void testSignBusinessEverything() throws CertificateException {
         System.out.println("testSignBusinessEverything signing");
         Everything();
@@ -153,6 +158,7 @@ public class DigSigUtilTest {
         be.getName().add(new Name("My biz", "en"));
 
         BusinessEntity signUDDI_JAXBObject = ds.signUddiEntity(be);
+        if (serialize)
         DigSigUtil.JAXB_ToStdOut(signUDDI_JAXBObject);
         Assert.assertNotSame("items are the same", be, signUDDI_JAXBObject);
         //System.out.println("verifing");

Modified: juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/BPEL2UDDITest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/BPEL2UDDITest.java?rev=1542568&r1=1542567&r2=1542568&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/BPEL2UDDITest.java (original)
+++ juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/BPEL2UDDITest.java Sat Nov 16 20:59:12 2013
@@ -47,7 +47,13 @@ public class BPEL2UDDITest {
 	PrintUDDI<FindTModel> pFindTModel = new PrintUDDI<FindTModel>();
 	PrintUDDI<BindingTemplate> pBinding = new PrintUDDI<BindingTemplate>();
 	ReadWSDL rw = new ReadWSDL();
-	
+
+        static boolean serialize=false;
+	public BPEL2UDDITest(){
+            if (System.getProperty("debug")!=null && System.getProperty("debug").equalsIgnoreCase("true"))
+                serialize = true;
+        }
+        
 	@BeforeClass
 	public static void before() throws JAXBException, ConfigurationException {
 		Properties properties = new Properties();
@@ -68,6 +74,7 @@ public class BPEL2UDDITest {
 	    Set<TModel> portTypeTModels = bpel2UDDI.createWSDLPortTypeTModels(wsdlDefinition.getDocumentBaseURI(), portTypes); 
 	    for (TModel tModel : portTypeTModels) {
 			System.out.println("***** UDDI PortType TModel: " + tModel.getName().getValue());
+                        if (serialize)
 			System.out.println(pTModel.print(tModel));
 		}
 		Assert.assertEquals(2,portTypeTModels.size());
@@ -89,6 +96,7 @@ public class BPEL2UDDITest {
 	    TModel bpel4WSTModel = bpel2UDDI.createBPEL4WSProcessTModel(serviceName, targetNamespace, portTypes, bpelOverViewUrl);
 	    
 		System.out.println("***** BPEL4WS Process TModel: " + bpel4WSTModel.getName().getValue());
+                if (serialize)
 		System.out.println(pTModel.print(bpel4WSTModel));
 		
 		Assert.assertNotNull(bpel4WSTModel);
@@ -102,6 +110,7 @@ public class BPEL2UDDITest {
 		FindTModel findTModel = bpel2UDDI.createFindTModelForProcessName(processName);
 		
 		System.out.println("***** Find TModel For ProcessName: " + processName);
+                if (serialize)
 		System.out.println(pFindTModel.print(findTModel));
 		
 		Assert.assertNotNull(findTModel.getCategoryBag());
@@ -118,6 +127,7 @@ public class BPEL2UDDITest {
 	    
 		for (TModel tModel : portTypeTModels) {
 			System.out.println("***** UDDI PortType TModel: " + tModel.getName().getValue());
+                        if (serialize)
 			System.out.println(pTModel.print(tModel));
 		}
 		Assert.assertEquals(1,portTypeTModels.size());
@@ -134,6 +144,7 @@ public class BPEL2UDDITest {
 	    
 		for (TModel tModel : bindingTModels) {
 			System.out.println("***** UDDI Binding TModel: " + tModel.getName().getValue());
+                        if (serialize)
 			System.out.println(pTModel.print(tModel));
 		}
 		Assert.assertEquals(1,bindingTModels.size());
@@ -155,6 +166,7 @@ public class BPEL2UDDITest {
 	    TModel bpel4WSTModel = bpel2UDDI.createBPEL4WSProcessTModel(serviceName, targetNamespace, portTypes, bpelOverViewUrl);
 	    
 		System.out.println("***** BPEL4WS Process TModel: " + bpel4WSTModel.getName().getValue());
+                if (serialize)
 		System.out.println(pTModel.print(bpel4WSTModel));
 		
 		Assert.assertNotNull(bpel4WSTModel);
@@ -173,6 +185,7 @@ public class BPEL2UDDITest {
 	    BindingTemplate binding = bpel2UDDI.createBPELBinding(serviceName, portName, serviceUrl, wsdlDefinition);
 	    
 		System.out.println("***** WSDL Port BindingTemplate: " + binding.getBindingKey());
+                if (serialize)
 		System.out.println(pBinding.print(binding));
 		
 		Assert.assertNotNull(binding.getTModelInstanceDetails());
@@ -186,6 +199,7 @@ public class BPEL2UDDITest {
 		FindTModel findTModel = bpel2UDDI.createFindTModelForProcessName(processName);
 		
 		System.out.println("***** Find TModel For ProcessName: " + processName);
+                if (serialize)
 		System.out.println(pFindTModel.print(findTModel));
 		
 		Assert.assertNotNull(findTModel.getCategoryBag());

Modified: juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/WADL2UDDITest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/WADL2UDDITest.java?rev=1542568&r1=1542567&r2=1542568&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/WADL2UDDITest.java (original)
+++ juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/WADL2UDDITest.java Sat Nov 16 20:59:12 2013
@@ -41,6 +41,13 @@ public class WADL2UDDITest {
     static final Logger log = Logger.getLogger(WADL2UDDITest.class.getCanonicalName());
     static PrintUDDI<TModel> pTModel = new PrintUDDI<TModel>();
     static Properties properties = new Properties();
+    static boolean serialize = false;
+
+    public WADL2UDDITest() {
+        if (System.getProperty("debug") != null && System.getProperty("debug").equalsIgnoreCase("true")) {
+            serialize = true;
+        }
+    }
 
     /**
      * tests loading a wadl from a file
@@ -50,7 +57,7 @@ public class WADL2UDDITest {
     @Test
     public void Test1() throws Exception {
         log.info("Test1 read from file");
- 
+
         Application app = WADL2UDDI.parseWadl(new File("src/test/resources/wadl/cxf.wadl"));
         Assert.assertNotNull(app);
         Assert.assertNotNull(app);
@@ -62,7 +69,9 @@ public class WADL2UDDITest {
         //save the keygen
         SaveTModel stm = new SaveTModel();
         stm.getTModel().add(keygen);
-        System.out.println(tmodelPrinter.print(keygen));
+        if (serialize) {
+            System.out.println(tmodelPrinter.print(keygen));
+        }
 
         properties.put("keyDomain", domain);
         properties.put("businessName", domain);
@@ -86,8 +95,9 @@ public class WADL2UDDITest {
 
 
         PrintUDDI<BusinessService> servicePrinter = new PrintUDDI<BusinessService>();
-
-        System.out.println(servicePrinter.print(businessServices));
+        if (serialize) {
+            System.out.println(servicePrinter.print(businessServices));
+        }
 
 
 
@@ -144,7 +154,9 @@ public class WADL2UDDITest {
         //save the keygen
         SaveTModel stm = new SaveTModel();
         stm.getTModel().add(keygen);
-        System.out.println(tmodelPrinter.print(keygen));
+        if (serialize) {
+            System.out.println(tmodelPrinter.print(keygen));
+        }
 
         properties.put("keyDomain", domain);
         properties.put("businessName", domain);
@@ -168,8 +180,9 @@ public class WADL2UDDITest {
 
 
         PrintUDDI<BusinessService> servicePrinter = new PrintUDDI<BusinessService>();
-
-        System.out.println(servicePrinter.print(businessServices));
+        if (serialize) {
+            System.out.println(servicePrinter.print(businessServices));
+        }
 
 
     }

Modified: juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/WSDL2UDDITest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/WSDL2UDDITest.java?rev=1542568&r1=1542567&r2=1542568&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/WSDL2UDDITest.java (original)
+++ juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/WSDL2UDDITest.java Sat Nov 16 20:59:12 2013
@@ -42,6 +42,14 @@ public class WSDL2UDDITest {
 	PrintUDDI<TModel> pTModel = new PrintUDDI<TModel>();
 	ReadWSDL rw = new ReadWSDL();
 	
+        static boolean serialize = false;
+
+    public WSDL2UDDITest() {
+        if (System.getProperty("debug") != null && System.getProperty("debug").equalsIgnoreCase("true")) {
+            serialize = true;
+        }
+    }
+    
         @Test
         public void Nulltest1()
         {
@@ -79,6 +87,7 @@ public class WSDL2UDDITest {
 	    
 		for (TModel tModel : tModels) {
 			System.out.println("UDDI PortType TModel " + tModel.getName().getValue());
+                        if (serialize)
 			System.out.println(pTModel.print(tModel));
 		}
 		Assert.assertEquals(1,tModels.size());
@@ -102,6 +111,7 @@ public class WSDL2UDDITest {
 	    
 		for (TModel tModel : tModels) {
 			System.out.println("UDDI Binding TModel " + tModel.getName().getValue());
+                        if (serialize)
 			System.out.println(pTModel.print(tModel));
 		}
 		Assert.assertEquals(1,tModels.size());

Modified: juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/WSDLinaUDDIRegistryTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/WSDLinaUDDIRegistryTest.java?rev=1542568&r1=1542567&r2=1542568&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/WSDLinaUDDIRegistryTest.java (original)
+++ juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/WSDLinaUDDIRegistryTest.java Sat Nov 16 20:59:12 2013
@@ -50,8 +50,11 @@ public class WSDLinaUDDIRegistryTest {
 	static Definition wsdlDefinition = null;
 	static Properties properties = new Properties();
 	static String wsdlURL = null;
-	
-	
+	static boolean serialize=false;
+	public WSDLinaUDDIRegistryTest(){
+            if (System.getProperty("debug")!=null && System.getProperty("debug").equalsIgnoreCase("true"))
+                serialize = true;
+        }
 	@BeforeClass
 	public static void before() throws Exception{
 		try {
@@ -81,7 +84,8 @@ public class WSDLinaUDDIRegistryTest {
 	    
 		TModel tModel =tModels.iterator().next();
 		System.out.println("UDDI PortType TModel " + tModel.getName().getValue());
-		System.out.println(pTModel.print(tModel));
+		if (serialize)
+                System.out.println(pTModel.print(tModel));
 		
 		//now compare to the spec example
 		String porttypeXml = "wsdl/uddiv3-xml/3_2_1_porttype.xml";
@@ -130,6 +134,7 @@ public class WSDLinaUDDIRegistryTest {
 	    
 		TModel tModel =tModels.iterator().next();
 		System.out.println("UDDI Binding TModel " + tModel.getName().getValue());
+                if (serialize)
 		System.out.println(pTModel.print(tModel));
 		
 		//Compare to the spec example
@@ -175,6 +180,7 @@ public class WSDLinaUDDIRegistryTest {
 		BusinessService businessService = businessServices.getBusinessService().get(0);
 		
 		System.out.println(businessService.getName().get(0).getValue());
+                if (serialize)
 		System.out.println(servicePrinter.print(businessService));
 		
 		//Compare to the spec example

Added: juddi/trunk/juddi-core-openjpa/src/test/resources/keystore.jks
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core-openjpa/src/test/resources/keystore.jks?rev=1542568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: juddi/trunk/juddi-core-openjpa/src/test/resources/keystore.jks
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: juddi/trunk/juddi-core-openjpa/src/test/resources/truststore.jks
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core-openjpa/src/test/resources/truststore.jks?rev=1542568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: juddi/trunk/juddi-core-openjpa/src/test/resources/truststore.jks
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java?rev=1542568&r1=1542567&r2=1542568&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java Sat Nov 16 20:59:12 2013
@@ -567,9 +567,10 @@ public class UDDIPublicationImpl extends
 	public BusinessDetail saveBusiness(SaveBusiness body)
 			throws DispositionReportFaultMessage {
 	        long startTime = System.currentTimeMillis();
-
+               if (!body.getBusinessEntity().isEmpty()) {
                 log.debug("Inbound save business request for key " + body.getBusinessEntity().get(0).getBusinessKey());
-		EntityManager em = PersistenceManager.getEntityManager();
+                 }
+                EntityManager em = PersistenceManager.getEntityManager();
 		EntityTransaction tx = em.getTransaction();
 		try {
 			tx.begin();

Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java?rev=1542568&r1=1542567&r2=1542568&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java Sat Nov 16 20:59:12 2013
@@ -543,6 +543,69 @@ public class ValidatePublish extends Val
             }
         }
     }
+    
+    void validateNotSigned(org.uddi.api_v3.BusinessEntity item) throws ValueNotAllowedException{
+        if (item==null)
+            return;
+        if (item.getBusinessKey()==null && !item.getSignature().isEmpty())
+            throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "businessKey"));
+        if (item.getBusinessServices()!=null && !item.getSignature().isEmpty())
+        {
+            for (int i=0; i < item.getBusinessServices().getBusinessService().size(); i++){
+                if (item.getBusinessServices().getBusinessService().get(i).getBusinessKey()==null ||
+                        item.getBusinessServices().getBusinessService().get(i).getBusinessKey().length()==0){
+                    throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "business/Service("+i+")/businessKey"));        
+                }
+                if (item.getBusinessServices().getBusinessService().get(i).getServiceKey()==null ||
+                        item.getBusinessServices().getBusinessService().get(i).getServiceKey().length()==0){
+                    throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "business/Service("+i+")/serviceKey"));        
+                }
+                if (item.getBusinessServices().getBusinessService().get(i).getBindingTemplates()!=null){
+                    for (int k=0; k < item.getBusinessServices().getBusinessService().get(i).getBindingTemplates().getBindingTemplate().size(); k++){
+                        if (item.getBusinessServices().getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k).getBindingKey()==null ||
+                                item.getBusinessServices().getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k).getBindingKey().length()==0)
+                        {
+                            throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "business/Service("+i+")/bindingTemplate)"+k+")/bindingKey"));        
+                        }
+                    }
+                }
+            }
+        }
+    }
+    
+    void validateNotSigned(org.uddi.api_v3.BindingTemplate item) throws ValueNotAllowedException{
+        if (item==null)
+            return;
+        if (item.getBindingKey()==null && !item.getSignature().isEmpty())
+            throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "bindingKey"));
+        if (item.getServiceKey()==null && !item.getSignature().isEmpty())
+            throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "serviceKey"));
+    }
+    void validateNotSigned(org.uddi.api_v3.TModel item) throws ValueNotAllowedException{
+        if (item==null)
+            return;
+        if (item.getTModelKey()==null && !item.getSignature().isEmpty())
+            throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "tModelKey"));
+    }
+    
+    void validateNotSigned(org.uddi.api_v3.BusinessService item) throws ValueNotAllowedException{
+        if (item==null)
+            return;
+        if (item.getBusinessKey()==null && !item.getSignature().isEmpty())
+            throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "businessKey"));
+        if (item.getServiceKey()==null && !item.getSignature().isEmpty())
+            throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "serviceKey"));
+        //if i'm signed and a key isn't defined in a bt
+        if (item.getBindingTemplates()!=null && !item.getSignature().isEmpty())
+            for (int i=0; i < item.getBindingTemplates().getBindingTemplate().size(); i++)
+            {
+                if (item.getBindingTemplates().getBindingTemplate().get(i).getBindingKey()==null ||
+                        item.getBindingTemplates().getBindingTemplate().get(i).getBindingKey().length()==0)
+                {
+                    throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "businessService/bindingTemplate(" + i + ")/bindingKey"));
+                }
+        }
+    }
 
     public void validateBusinessEntity(EntityManager em, org.uddi.api_v3.BusinessEntity businessEntity, Configuration config) throws DispositionReportFaultMessage {
 
@@ -552,6 +615,7 @@ public class ValidatePublish extends Val
         }
 
         boolean entityExists = false;
+        validateNotSigned(businessEntity);
         String entityKey = businessEntity.getBusinessKey();
         if (entityKey == null || entityKey.length() == 0) {
             KeyGenerator keyGen = KeyGeneratorFactory.getKeyGenerator();
@@ -608,7 +672,6 @@ public class ValidatePublish extends Val
         if (businessServices == null) {
             return;
         }
-
         List<org.uddi.api_v3.BusinessService> businessServiceList = businessServices.getBusinessService();
         if (businessServiceList == null || businessServiceList.size() == 0) {
             throw new ValueNotAllowedException(new ErrorMessage("errors.businessservices.NoInput"));
@@ -628,6 +691,7 @@ public class ValidatePublish extends Val
             throw new ValueNotAllowedException(new ErrorMessage("errors.businessservice.NullInput"));
         }
 
+        validateNotSigned(businessService);
         // Retrieve the service's passed key
         String entityKey = businessService.getServiceKey();
         if (entityKey != null && entityKey.length() > 0) {
@@ -665,6 +729,8 @@ public class ValidatePublish extends Val
 
         // Projections don't require as rigorous testing as only the projected service's business key and service key are examined for validity.
         if (isProjection) {
+
+         
             Object obj = em.find(org.apache.juddi.model.BusinessService.class, entityKey);
             // Can't project a service that doesn't exist!
             if (obj == null) {
@@ -828,6 +894,7 @@ public class ValidatePublish extends Val
 
         boolean entityExists = false;
         if (entityKey == null || entityKey.length() == 0) {
+            validateNotSigned(bindingTemplate);
             KeyGenerator keyGen = KeyGeneratorFactory.getKeyGenerator();
             entityKey = keyGen.generate();
             bindingTemplate.setBindingKey(entityKey);
@@ -932,6 +999,7 @@ public class ValidatePublish extends Val
         if (entityKey == null || entityKey.length() == 0) {
             KeyGenerator keyGen = KeyGeneratorFactory.getKeyGenerator();
             entityKey = keyGen.generate();
+            validateNotSigned(tModel);
             tModel.setTModelKey(entityKey);
         } else {
             // Per section 4.4: keys must be case-folded

Modified: juddi/trunk/juddi-core/src/main/resources/messages.properties
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/resources/messages.properties?rev=1542568&r1=1542567&r2=1542568&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/resources/messages.properties (original)
+++ juddi/trunk/juddi-core/src/main/resources/messages.properties Sat Nov 16 20:59:12 2013
@@ -1,4 +1,4 @@
-#/*
+errors.businessentity.SignedButNoKey#/*
 # * Copyright 2001-2008 The Apache Software Foundation.
 # * 
 # * Licensed under the Apache License, Version 2.0 (the "License");
@@ -107,6 +107,7 @@ errors.saveNodes.NoInput=At least one No
 errors.savetmodel.NoInput=At least one tModel must be provided
 errors.addpublisherassertions.NoInput=At least one publisherAssertion must be provided
 errors.businessentity.NullInput=The businessEntity structure cannot be blank
+errors.entity.SignedButNoKey=The entity has no key defined, which means I'll generate one for you, but the entity is signed and thus will become invalid after I add a generated key. Either specify your own key or omit the signature.
 errors.businessservice.NullInput=The businessService structure cannot be blank
 errors.bindingtemplate.NullInput=The bindingTemplate structure cannot be blank
 errors.bindingtemplate.NoAccessPoint=A binding template must contain either an access point or a hosting redirector element, but not both

Modified: juddi/trunk/juddi-core/src/test/java/org/apache/juddi/api/impl/API_141_JIRATest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/test/java/org/apache/juddi/api/impl/API_141_JIRATest.java?rev=1542568&r1=1542567&r2=1542568&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/test/java/org/apache/juddi/api/impl/API_141_JIRATest.java (original)
+++ juddi/trunk/juddi-core/src/test/java/org/apache/juddi/api/impl/API_141_JIRATest.java Sat Nov 16 20:59:12 2013
@@ -14,6 +14,7 @@
  */
 package org.apache.juddi.api.impl;
 
+import java.security.cert.CertificateException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -25,6 +26,10 @@ import org.apache.commons.logging.LogFac
 import org.apache.juddi.Registry;
 import org.apache.juddi.v3.client.UDDIConstants;
 import org.apache.juddi.v3.client.config.UDDIClient;
+import org.apache.juddi.v3.client.cryptor.DigSigUtil;
+import org.apache.juddi.v3.error.ValueNotAllowedException;
+import org.apache.juddi.v3.tck.TckBusiness;
+import org.apache.juddi.v3.tck.TckBusinessService;
 import org.apache.juddi.v3.tck.TckPublisher;
 import org.apache.juddi.v3.tck.TckSecurity;
 import org.apache.juddi.v3.tck.TckTModel;
@@ -32,6 +37,8 @@ import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.uddi.api_v3.AccessPoint;
+import org.uddi.api_v3.BindingTemplate;
 import org.uddi.api_v3.BindingTemplates;
 import org.uddi.api_v3.BusinessDetail;
 import org.uddi.api_v3.BusinessEntity;
@@ -50,8 +57,11 @@ import org.uddi.api_v3.FindService;
 import org.uddi.api_v3.FindTModel;
 import org.uddi.api_v3.KeyedReference;
 import org.uddi.api_v3.Name;
+import org.uddi.api_v3.SaveBinding;
 import org.uddi.api_v3.SaveBusiness;
+import org.uddi.api_v3.SaveService;
 import org.uddi.api_v3.SaveTModel;
+import org.uddi.api_v3.ServiceDetail;
 import org.uddi.api_v3.ServiceInfos;
 import org.uddi.api_v3.ServiceList;
 import org.uddi.api_v3.TModel;
@@ -72,12 +82,10 @@ import org.uddi.v3_service.UDDISecurityP
 public class API_141_JIRATest {
 
     private static Log logger = LogFactory.getLog(API_141_JIRATest.class);
-
     static UDDISecurityPortType security = new UDDISecurityImpl();
     static UDDIInquiryPortType inquiry = new UDDIInquiryImpl();
     static UDDIPublicationPortType publication = new UDDIPublicationImpl();
-    static TckTModel tckTModel               = new TckTModel(new UDDIPublicationImpl(), new UDDIInquiryImpl());
-
+    static TckTModel tckTModel = new TckTModel(new UDDIPublicationImpl(), new UDDIInquiryImpl());
     protected static String authInfoJoe = null;
     protected static String authInfoSam = null;
     private static UDDIClient manager;
@@ -99,13 +107,13 @@ public class API_141_JIRATest {
     static final String MISSING_RESOURCE = "Can't find resource for bundle";
 
     @AfterClass
-    public static  void stopManager() throws ConfigurationException {
-    	Registry.stop();
+    public static void stopManager() throws ConfigurationException {
+        Registry.stop();
     }
 
     @BeforeClass
     public static void startManager() throws ConfigurationException {
-    	Registry.start();
+        Registry.start();
 
         logger.debug("Getting auth tokens..");
         try {
@@ -113,10 +121,10 @@ public class API_141_JIRATest {
             authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
             Assert.assertNotNull(authInfoJoe);
             Assert.assertNotNull(authInfoSam);
-            String authInfoUDDI  = TckSecurity.getAuthToken(security, TckPublisher.getUDDIPublisherId(),  TckPublisher.getUDDIPassword());
-			tckTModel.saveUDDIPublisherTmodel(authInfoUDDI);
-			tckTModel.saveTModels(authInfoUDDI, TckTModel.TMODELS_XML);
-			tckTModel.saveJoePublisherTmodel(authInfoJoe);
+            String authInfoUDDI = TckSecurity.getAuthToken(security, TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword());
+            tckTModel.saveUDDIPublisherTmodel(authInfoUDDI);
+            tckTModel.saveTModels(authInfoUDDI, TckTModel.TMODELS_XML);
+            tckTModel.saveJoePublisherTmodel(authInfoJoe);
         } catch (Exception e) {
             logger.error(e.getMessage(), e);
             Assert.fail("Could not obtain authInfo token.");
@@ -680,4 +688,629 @@ public class API_141_JIRATest {
             ex.printStackTrace();
         }
     }
+
+    org.apache.juddi.v3.client.cryptor.DigSigUtil GetDigSig() throws CertificateException {
+        org.apache.juddi.v3.client.cryptor.DigSigUtil ds = new DigSigUtil();
+        ds.put(DigSigUtil.SIGNATURE_KEYSTORE_FILE, "./src/test/resources/keystore.jks");
+        ds.put(DigSigUtil.SIGNATURE_KEYSTORE_FILETYPE, "JKS");
+        ds.put(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD, "Test");
+        ds.put(DigSigUtil.SIGNATURE_KEYSTORE_KEY_ALIAS, "Test");
+        ds.put(DigSigUtil.TRUSTSTORE_FILE, "./src/test/resources/truststore.jks");
+        ds.put(DigSigUtil.TRUSTSTORE_FILETYPE, "JKS");
+        ds.put(DigSigUtil.TRUSTSTORE_FILE_PASSWORD, "Test");
+        ds.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_BASE64, "true");
+        return ds;
+    }
+
+    @Test()
+    public void JUDDI_712_SaveBusinessProjectionWithSignature() throws CertificateException {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_JUDDI_712_SaveBusinessProjectionWithSignature");
+        be.getName().add(n);
+        DigSigUtil ds = GetDigSig();
+        be = ds.signUddiEntity(be);
+        sb.getBusinessEntity().add(be);
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: " + ex.getMessage());
+        }
+    }
+
+    @Test()
+    public void JUDDI_712_SaveBusinessProjectionNoServiceKeyWithSignature() throws CertificateException {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_712_SaveBusinessProjectionNoServiceKeyWithSignature");
+        be.getName().add(n);
+        be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+
+        //service has neither business or service key
+        BusinessService bs = new BusinessService();
+        bs.getName().add(new Name("Joe's bs", null));
+        be.setBusinessServices(new BusinessServices());
+        be.getBusinessServices().getBusinessService().add(bs);
+
+        DigSigUtil ds = GetDigSig();
+        be = ds.signUddiEntity(be);
+        sb.getBusinessEntity().add(be);
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: " + ex.getMessage());
+        }
+    }
+
+    @Test()
+    public void JUDDI_712_SaveBusinessProjectionNoServiceKey2WithSignature() throws CertificateException {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_712_SaveBusinessProjectionNoServiceKey2WithSignature");
+        be.getName().add(n);
+        be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+
+        //service has business but not service key
+        BusinessService bs = new BusinessService();
+        bs.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        bs.getName().add(new Name("Joe's bs", null));
+        be.setBusinessServices(new BusinessServices());
+        be.getBusinessServices().getBusinessService().add(bs);
+
+        DigSigUtil ds = GetDigSig();
+        be = ds.signUddiEntity(be);
+        sb.getBusinessEntity().add(be);
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: " + ex.getMessage());
+        }
+    }
+
+    @Test()
+    public void JUDDI_712_SaveBusinessProjectionNoServiceKey3WithSignature() throws CertificateException {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_712_SaveBusinessProjectionNoServiceKey3WithSignature");
+        be.getName().add(n);
+        be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+
+        //service has business but not service key
+        BusinessService bs = new BusinessService();
+        //bs.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        bs.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
+        bs.getName().add(new Name("Joe's bs", null));
+        be.setBusinessServices(new BusinessServices());
+        be.getBusinessServices().getBusinessService().add(bs);
+
+        DigSigUtil ds = GetDigSig();
+        be = ds.signUddiEntity(be);
+        sb.getBusinessEntity().add(be);
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: " + ex.getMessage());
+        }
+    }
+
+    @Test()
+    public void JUDDI_712_SaveServiceProjectionNoServiceKey3WithSignature() throws CertificateException {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_712_SaveServiceProjectionNoServiceKey3WithSignature");
+        be.getName().add(n);
+        be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+
+
+        BusinessService bs = new BusinessService();
+        bs.setBusinessKey(null);
+        bs.setServiceKey(null);
+        bs.getName().add(new Name("Joe's bs", null));
+        DigSigUtil ds = GetDigSig();
+        bs = ds.signUddiEntity(bs);
+
+        be.setBusinessServices(new BusinessServices());
+        be.getBusinessServices().getBusinessService().add(bs);
+
+
+        sb.getBusinessEntity().add(be);
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: " + ex.getMessage());
+        }
+    }
+
+    @Test()
+    public void JUDDI_712_SaveServiceProjectionNoServiceKey1WithSignature() throws CertificateException {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_712_SaveServiceProjectionNoServiceKey1WithSignature");
+        be.getName().add(n);
+        be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+
+
+        BusinessService bs = new BusinessService();
+        bs.setBusinessKey(null);
+        bs.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
+        bs.getName().add(new Name("Joe's bs", null));
+        DigSigUtil ds = GetDigSig();
+        bs = ds.signUddiEntity(bs);
+
+        be.setBusinessServices(new BusinessServices());
+        be.getBusinessServices().getBusinessService().add(bs);
+
+
+        sb.getBusinessEntity().add(be);
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: " + ex.getMessage());
+        }
+    }
+
+    @Test()
+    public void JUDDI_712_SaveServiceProjectionNoServiceKey2WithSignature() throws CertificateException {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_712_SaveServiceProjectionNoServiceKey2WithSignature");
+        be.getName().add(n);
+        be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+
+
+        BusinessService bs = new BusinessService();
+        bs.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        bs.setServiceKey(null);
+        bs.getName().add(new Name("Joe's bs", null));
+        DigSigUtil ds = GetDigSig();
+        bs = ds.signUddiEntity(bs);
+
+        be.setBusinessServices(new BusinessServices());
+        be.getBusinessServices().getBusinessService().add(bs);
+
+
+        sb.getBusinessEntity().add(be);
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: " + ex.getMessage());
+        }
+    }
+
+    @Test(expected = ValueNotAllowedException.class)
+    public void JUDDI_712_SaveBusinessNoneDefined() throws Exception {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_712_SaveServiceWithSignature");
+        be.getName().add(n);
+        be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: "+ ex.getMessage());
+            throw ex;
+        }
+    }
+
+    @Test()
+    public void JUDDI_712_SaveServiceWithSignature() throws CertificateException {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_712_SaveServiceWithSignature");
+        be.getName().add(n);
+        be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        sb.getBusinessEntity().add(be);
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+        } catch (Exception ex) {
+            logger.info("UnExpected failure: ", ex);
+            Assert.fail();
+        }
+
+        SaveService ss = new SaveService();
+        ss.setAuthInfo(authInfoJoe);
+        BusinessService bs = new BusinessService();
+        bs.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        bs.setServiceKey(null);
+        bs.getName().add(new Name("Joe's bs", null));
+        DigSigUtil ds = GetDigSig();
+        bs = ds.signUddiEntity(bs);
+
+        be.setBusinessServices(new BusinessServices());
+        be.getBusinessServices().getBusinessService().add(bs);
+
+
+        sb.getBusinessEntity().add(be);
+        try {
+            publication.saveService(ss);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: " + ex.getMessage());
+        }
+    }
+
+    @Test()
+    public void JUDDI_712_SaveService1WithSignature() throws CertificateException {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_712_SaveService1WithSignature");
+        be.getName().add(n);
+        be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        sb.getBusinessEntity().add(be);
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+        } catch (Exception ex) {
+            logger.info("UnExpected failure: ", ex);
+            Assert.fail();
+        }
+
+        SaveService ss = new SaveService();
+        ss.setAuthInfo(authInfoJoe);
+        BusinessService bs = new BusinessService();
+        bs.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        bs.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
+        bs.setBindingTemplates(new BindingTemplates());
+        BindingTemplate bt = new BindingTemplate();
+        bt.setBindingKey(null);
+        bt.setServiceKey(null);
+        bt.setAccessPoint(new AccessPoint("http://localhost", "wsdl"));
+        bs.getBindingTemplates().getBindingTemplate().add(bt);
+        bs.getName().add(new Name("Joe's bs", null));
+        DigSigUtil ds = GetDigSig();
+        bs = ds.signUddiEntity(bs);
+
+        be.setBusinessServices(new BusinessServices());
+        be.getBusinessServices().getBusinessService().add(bs);
+
+
+        sb.getBusinessEntity().add(be);
+        try {
+            publication.saveService(ss);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: " + ex.getMessage());
+        }
+    }
+
+    @Test()
+    public void JUDDI_712_SaveService2WithSignature() throws CertificateException {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_712_SaveService2WithSignature");
+        be.getName().add(n);
+        be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        sb.getBusinessEntity().add(be);
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+        } catch (Exception ex) {
+            logger.info("UnExpected failure: ", ex);
+            Assert.fail();
+        }
+
+        SaveService ss = new SaveService();
+        ss.setAuthInfo(authInfoJoe);
+        BusinessService bs = new BusinessService();
+        bs.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        bs.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
+        bs.setBindingTemplates(new BindingTemplates());
+        BindingTemplate bt = new BindingTemplate();
+        bt.setBindingKey(null);
+        bt.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
+        bt.setAccessPoint(new AccessPoint("http://localhost", "wsdl"));
+        bs.getBindingTemplates().getBindingTemplate().add(bt);
+        bs.getName().add(new Name("Joe's bs", null));
+        DigSigUtil ds = GetDigSig();
+        bs = ds.signUddiEntity(bs);
+
+        be.setBusinessServices(new BusinessServices());
+        be.getBusinessServices().getBusinessService().add(bs);
+
+
+        sb.getBusinessEntity().add(be);
+        try {
+            publication.saveService(ss);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: " + ex.getMessage());
+        }
+    }
+
+    @Test()
+    public void JUDDI_712_SaveService3WithSignature() throws CertificateException {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_712_SaveService3WithSignature");
+        be.getName().add(n);
+        be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        sb.getBusinessEntity().add(be);
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+        } catch (Exception ex) {
+            logger.info("UnExpected failure: ", ex);
+            Assert.fail();
+        }
+
+        SaveService ss = new SaveService();
+        ss.setAuthInfo(authInfoJoe);
+        BusinessService bs = new BusinessService();
+        bs.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        bs.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
+        bs.setBindingTemplates(new BindingTemplates());
+        BindingTemplate bt = new BindingTemplate();
+        bt.setBindingKey(TckBusinessService.JOE_BINDING_KEY_1);
+        bt.setServiceKey(null);
+        bt.setAccessPoint(new AccessPoint("http://localhost", "wsdl"));
+        bs.getBindingTemplates().getBindingTemplate().add(bt);
+        bs.getName().add(new Name("Joe's bs", null));
+        DigSigUtil ds = GetDigSig();
+        bs = ds.signUddiEntity(bs);
+
+        be.setBusinessServices(new BusinessServices());
+        be.getBusinessServices().getBusinessService().add(bs);
+
+
+        sb.getBusinessEntity().add(be);
+        try {
+            publication.saveService(ss);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: " + ex.getMessage());
+        }
+    }
+    
+    
+    @Test()
+    public void JUDDI_712_SaveTModelWithSignature() throws CertificateException {
+        SaveTModel sb = new SaveTModel();
+        sb.setAuthInfo(authInfoJoe);
+        DigSigUtil ds = GetDigSig();
+        TModel bs = new TModel();
+        bs.setName(new Name("Joe's Tmodel",null));
+        bs = ds.signUddiEntity(bs);
+        
+
+        sb.getTModel().add(bs);
+        try {
+            publication.saveTModel(sb);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: "+ ex.getMessage());
+        }
+    }
+    
+    
+    @Test()
+    public void JUDDI_712_SaveService4BTWithSignature() throws CertificateException {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_712_SaveService4BTWithSignature");
+        be.getName().add(n);
+        be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        sb.getBusinessEntity().add(be);
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+        } catch (Exception ex) {
+            logger.info("UnExpected failure: ", ex);
+            Assert.fail();
+        }
+
+        SaveService ss = new SaveService();
+        ss.setAuthInfo(authInfoJoe);
+        BusinessService bs = new BusinessService();
+        bs.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        bs.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
+        bs.setBindingTemplates(new BindingTemplates());
+        BindingTemplate bt = new BindingTemplate();
+        bt.setBindingKey(TckBusinessService.JOE_BINDING_KEY_1);
+        bt.setServiceKey(null);
+        bt.setAccessPoint(new AccessPoint("http://localhost", "wsdl"));
+        
+        bs.getName().add(new Name("Joe's bs", null));
+        DigSigUtil ds = GetDigSig();
+        bt = ds.signUddiEntity(bt);
+        bs.getBindingTemplates().getBindingTemplate().add(bt);
+        be.setBusinessServices(new BusinessServices());
+        be.getBusinessServices().getBusinessService().add(bs);
+
+
+        sb.getBusinessEntity().add(be);
+        try {
+            publication.saveService(ss);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: " + ex.getMessage());
+        }
+    }
+    
+    @Test()
+    public void JUDDI_712_SaveService5BTWithSignature() throws CertificateException {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_712_SaveService5BTWithSignature");
+        be.getName().add(n);
+        be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        sb.getBusinessEntity().add(be);
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+        } catch (Exception ex) {
+            logger.info("UnExpected failure: ", ex);
+            Assert.fail();
+        }
+
+        SaveService ss = new SaveService();
+        ss.setAuthInfo(authInfoJoe);
+        BusinessService bs = new BusinessService();
+        bs.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        bs.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
+        bs.setBindingTemplates(new BindingTemplates());
+        BindingTemplate bt = new BindingTemplate();
+        bt.setBindingKey(null);
+        bt.setServiceKey(null);
+        bt.setAccessPoint(new AccessPoint("http://localhost", "wsdl"));
+        
+        bs.getName().add(new Name("Joe's bs", null));
+        DigSigUtil ds = GetDigSig();
+        bt = ds.signUddiEntity(bt);
+        bs.getBindingTemplates().getBindingTemplate().add(bt);
+        be.setBusinessServices(new BusinessServices());
+        be.getBusinessServices().getBusinessService().add(bs);
+
+
+        sb.getBusinessEntity().add(be);
+        try {
+            publication.saveService(ss);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: " + ex.getMessage());
+        }
+    }
+    
+    @Test()
+    public void JUDDI_712_SaveService6BTWithSignature() throws CertificateException {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_712_SaveService6BTWithSignature");
+        be.getName().add(n);
+        be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        sb.getBusinessEntity().add(be);
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+        } catch (Exception ex) {
+            logger.info("UnExpected failure: ", ex);
+            Assert.fail();
+        }
+
+        SaveService ss = new SaveService();
+        ss.setAuthInfo(authInfoJoe);
+        BusinessService bs = new BusinessService();
+        bs.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        bs.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
+        bs.setBindingTemplates(new BindingTemplates());
+        BindingTemplate bt = new BindingTemplate();
+        bt.setBindingKey(null);
+        bt.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
+        bt.setAccessPoint(new AccessPoint("http://localhost", "wsdl"));
+        
+        bs.getName().add(new Name("Joe's bs", null));
+        DigSigUtil ds = GetDigSig();
+        bt = ds.signUddiEntity(bt);
+        bs.getBindingTemplates().getBindingTemplate().add(bt);
+        be.setBusinessServices(new BusinessServices());
+        be.getBusinessServices().getBusinessService().add(bs);
+
+
+        sb.getBusinessEntity().add(be);
+        try {
+            publication.saveService(ss);
+            Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: " + ex.getMessage());
+        }
+    }
+    
+    
+    
+    @Test()
+    public void JUDDI_712_SaveBindingWithSignature() throws CertificateException {
+        SaveBusiness sb = new SaveBusiness();
+        sb.setAuthInfo(authInfoJoe);
+        BusinessEntity be = new BusinessEntity();
+        Name n = new Name();
+        n.setValue("JUDDI_712_SaveBindingWithSignature");
+        be.getName().add(n);
+        be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        sb.getBusinessEntity().add(be);
+        try {
+            BusinessDetail saveBusiness = publication.saveBusiness(sb);
+        } catch (Exception ex) {
+            logger.info("UnExpected failure: ", ex);
+            Assert.fail();
+        }
+
+        SaveService ss = new SaveService();
+        ss.setAuthInfo(authInfoJoe);
+        BusinessService bs = new BusinessService();
+        bs.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
+        bs.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
+        bs.getName().add(new Name("joe's service",null));
+        
+        
+        be.setBusinessServices(new BusinessServices());
+        be.getBusinessServices().getBusinessService().add(bs);
+
+
+        sb.getBusinessEntity().add(be);
+        ServiceDetail saveService=null;
+        ss.getBusinessService().add(bs);
+        try {
+             saveService = publication.saveService(ss);
+        } catch (Exception ex) {
+            //logger.error("unExpected failure: ",ex);
+            Assert.fail("unexpected failure " + ex.getMessage() + ex.toString());
+        }
+        
+        
+        bs = saveService.getBusinessService().get(0);
+        bs.setBindingTemplates(new BindingTemplates());
+        BindingTemplate bt = new BindingTemplate();
+        bt.setBindingKey(null);
+        bt.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
+        bt.setAccessPoint(new AccessPoint("http://localhost", "wsdl"));
+        
+        bs.getName().add(new Name("Joe's bs", null));
+        DigSigUtil ds = GetDigSig();
+        bt = ds.signUddiEntity(bt);
+        bs.getBindingTemplates().getBindingTemplate().add(bt);
+        
+         try {
+             SaveBinding sb1 = new SaveBinding();
+             sb1.setAuthInfo(authInfoJoe);
+             sb1.getBindingTemplate().add(bt);
+             publication.saveBinding(sb1);
+             Assert.fail("unexpected success");
+        } catch (Exception ex) {
+            logger.info("Expected failure: " + ex.getMessage());
+        }
+    }
+    
+    
 }

Added: juddi/trunk/juddi-core/src/test/resources/keystore.jks
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/test/resources/keystore.jks?rev=1542568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: juddi/trunk/juddi-core/src/test/resources/keystore.jks
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: juddi/trunk/juddi-core/src/test/resources/truststore.jks
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/test/resources/truststore.jks?rev=1542568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: juddi/trunk/juddi-core/src/test/resources/truststore.jks
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: juddi/trunk/readme.txt
URL: http://svn.apache.org/viewvc/juddi/trunk/readme.txt?rev=1542568&r1=1542567&r2=1542568&view=diff
==============================================================================
--- juddi/trunk/readme.txt (original)
+++ juddi/trunk/readme.txt Sat Nov 16 20:59:12 2013
@@ -8,16 +8,19 @@ Here's some quick notes for building, te
 4) Make sure the Maven/bin folder and the JDK/bin folders are in the current path
 5) execute "mvn clean install"
 
-That should build the whole project. Depending on your computer's speed, it can take up to 15 minutes to build.
+That should build the whole project and test all Java components. Depending on your computer's speed, it can take up to 15 minutes to build.
+
+To enable additional output during the build and test project:
+	mvn clean install -Ddebug=true
 
 To attach the debugger to the build process
 mvn -Dmaven.surefire.debug clean install
-It listens on port 5005 by default. More info on debugginb maven projects is here http://maven.apache.org/surefire/maven-surefire-plugin/examples/debugging.html
+It listens on port 5005 by default. More info on debugging maven projects is here http://maven.apache.org/surefire/maven-surefire-plugin/examples/debugging.html
 
 To setup an Eclipse environment with support for building using the Google Web Toolkit portlets in Pluto, see the blog entry here http://apachejuddi.blogspot.com/2013_02_01_archive.html
 Eclipse will initially complain about maven plugins.
 
-To setup a Netbeans environment, the process is much simplier.
+To setup a Netbeans environment, the process is much simpler.
 Install Netbeans and open the project. Compiling from Netbeans however doesn't work and you'll have to resort to command line builds
 
 

Modified: juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckBusiness.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckBusiness.java?rev=1542568&r1=1542567&r2=1542568&view=diff
==============================================================================
--- juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckBusiness.java (original)
+++ juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckBusiness.java Sat Nov 16 20:59:12 2013
@@ -50,20 +50,20 @@ import org.w3c.dom.Element;
  */
 public class TckBusiness 
 {
-	final static String JOE_BUSINESS_XML        = "uddi_data/joepublisher/businessEntity.xml";
-    final static String JOE_BUSINESS_KEY        = "uddi:uddi.joepublisher.com:businessone";
-    final static String JOE_BUSINESS3_XML       = "uddi_data/joepublisher/businessEntity3.xml";
-    final static String JOE_BUSINESS3_KEY       = "uddi:uddi.joepublisher.com:businessthree.com";
-    final static String JOE_BUSINESS_MOVE_XML   = "uddi_data/joepublisher/moveBusinessService1to3.xml";
-    final static String MARY_BUSINESS_XML       = "uddi_data/marypublisher/businessEntity.xml";
-    final static String MARY_BUSINESS_KEY       = "uddi:uddi.marypublisher.com:marybusinessone";
-    final static String SAM_BUSINESS_XML        = "uddi_data/samsyndicator/businessEntity.xml";
-    final static String SAM_BUSINESS_WITHPROJECTION_XML = "uddi_data/samsyndicator/businessEntity_withProjection.xml";
-    final static String SAM_BUSINESS_KEY        = "uddi:www.samco.com:samco";
-    final static String COMBINE_CATBAGS_BIZ_XML = "uddi_data/joepublisher/combineCatBagsBusinessServices.xml";
-    final static String COMBINE_CATBAGS_BIZ_KEY = "uddi:uddi.joepublisher.com:business01";
-    public final static String RIFTSAW_BUSINESS_KEY    = "uddi:riftsaw.jboss.org:business_redhat-jboss";
-    public final static String RIFTSAW_BUSINESS_XML    = "uddi_data/bpel/riftsaw/businessEntity.xml";
+    public final static String JOE_BUSINESS_XML = "uddi_data/joepublisher/businessEntity.xml";
+    public final static String JOE_BUSINESS_KEY = "uddi:uddi.joepublisher.com:businessone";
+    public final static String JOE_BUSINESS3_XML = "uddi_data/joepublisher/businessEntity3.xml";
+    public final static String JOE_BUSINESS3_KEY = "uddi:uddi.joepublisher.com:businessthree.com";
+    public final static String JOE_BUSINESS_MOVE_XML = "uddi_data/joepublisher/moveBusinessService1to3.xml";
+    public final static String MARY_BUSINESS_XML = "uddi_data/marypublisher/businessEntity.xml";
+    public final static String MARY_BUSINESS_KEY = "uddi:uddi.marypublisher.com:marybusinessone";
+    public final static String SAM_BUSINESS_XML = "uddi_data/samsyndicator/businessEntity.xml";
+    public final static String SAM_BUSINESS_WITHPROJECTION_XML = "uddi_data/samsyndicator/businessEntity_withProjection.xml";
+    public final static String SAM_BUSINESS_KEY = "uddi:www.samco.com:samco";
+    public final static String COMBINE_CATBAGS_BIZ_XML = "uddi_data/joepublisher/combineCatBagsBusinessServices.xml";
+    public final static String COMBINE_CATBAGS_BIZ_KEY = "uddi:uddi.joepublisher.com:business01";
+    public final static String RIFTSAW_BUSINESS_KEY = "uddi:riftsaw.jboss.org:business_redhat-jboss";
+    public final static String RIFTSAW_BUSINESS_XML = "uddi_data/bpel/riftsaw/businessEntity.xml";
 
     final static String SIGNATURE_KEYSTORE = "uddi_data/signature/signature.jks";
     final static String SIGNATURE_KEYSTORE_TYPE = "JKS";

Modified: juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckBusinessService.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckBusinessService.java?rev=1542568&r1=1542567&r2=1542568&view=diff
==============================================================================
--- juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckBusinessService.java (original)
+++ juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckBusinessService.java Sat Nov 16 20:59:12 2013
@@ -25,13 +25,9 @@ import org.junit.Assert;
 import org.uddi.api_v3.BindingTemplate;
 import org.uddi.api_v3.BusinessService;
 import org.uddi.api_v3.DeleteService;
-import org.uddi.api_v3.FindQualifiers;
-import org.uddi.api_v3.FindService;
 import org.uddi.api_v3.GetServiceDetail;
-import org.uddi.api_v3.Name;
 import org.uddi.api_v3.SaveService;
 import org.uddi.api_v3.ServiceDetail;
-import org.uddi.api_v3.ServiceList;
 import org.uddi.v3_service.UDDIInquiryPortType;
 import org.uddi.v3_service.UDDIPublicationPortType;
 /**
@@ -41,21 +37,19 @@ import org.uddi.v3_service.UDDIPublicati
 public class TckBusinessService 
 {
 	
-	public final static String NOTIFIER_SERVICE_XML  = "uddi_data/subscriptionnotifier/businessService.xml";
-	public final static String NOTIFIER_SERVICE_KEY  = "uddi:uddi.joepublisher.com:notifierone";
-
-	final static String JOE_SERVICE_XML              = "uddi_data/joepublisher/businessService.xml";
-    final static String JOE_SERVICE_KEY              = "uddi:uddi.joepublisher.com:serviceone";
-    final static String JOE_SERVICE_XML_2              = "uddi_data/joepublisher/businessService2.xml";
-    final static String JOE_SERVICE_KEY_2              = "uddi:uddi.joepublisher.com:servicetwo";
-    final static String SAM_SERVICE_XML              = "uddi_data/samsyndicator/businessService.xml";
-    final static String SAM_SERVICE_KEY              = "uddi:www.samco.com:listingservice";
-    
-    public final static String RIFTSAW_PROCESS_XML          = "uddi_data/bpel/riftsaw/WSDLPort.xml";
-    public final static String RIFTSAW_PROCESS_KEY          = "uddi:riftsaw.jboss.org:ticket-service";
-   
+    public final static String NOTIFIER_SERVICE_XML = "uddi_data/subscriptionnotifier/businessService.xml";
+    public final static String NOTIFIER_SERVICE_KEY = "uddi:uddi.joepublisher.com:notifierone";
+    public final static String JOE_SERVICE_XML = "uddi_data/joepublisher/businessService.xml";
+    public final static String JOE_SERVICE_KEY = "uddi:uddi.joepublisher.com:serviceone";
+    public final static String JOE_SERVICE_XML_2 = "uddi_data/joepublisher/businessService2.xml";
+    public final static String JOE_SERVICE_KEY_2 = "uddi:uddi.joepublisher.com:servicetwo";
+    public final static String SAM_SERVICE_XML = "uddi_data/samsyndicator/businessService.xml";
+    public final static String SAM_SERVICE_KEY = "uddi:www.samco.com:listingservice";
+    public final static String RIFTSAW_PROCESS_XML = "uddi_data/bpel/riftsaw/WSDLPort.xml";
+    public final static String RIFTSAW_PROCESS_KEY = "uddi:riftsaw.jboss.org:ticket-service";
+    public final static String JOE_BINDING_KEY_1="uddi:uddi.joepublisher.com:bindingone";
     private Log logger = LogFactory.getLog(this.getClass());
-	private UDDIPublicationPortType publication = null;
+    private UDDIPublicationPortType publication = null;
     private UDDIInquiryPortType inquiry = null;
 	
 	public TckBusinessService(UDDIPublicationPortType publication, 



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


Mime
View raw message