You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juddi.apache.org by al...@apache.org on 2014/01/11 04:17:59 UTC
svn commit: r1557304 - in /juddi/trunk: uddi-client-dist/src/main/assembly/
uddi-tck-base/src/main/resources/ uddi-tck-runner/
uddi-tck-runner/src/main/java/org/apache/juddi/tckrunner/
uddi-tck/src/test/java/org/apache/juddi/v3/tck/
Author: alexoree
Date: Sat Jan 11 03:17:57 2014
New Revision: 1557304
URL: http://svn.apache.org/r1557304
Log:
JUDDI-716 adding TCK tests for digital signature projection and for various signature options, adding to tck-runner. new configuration options
Added:
juddi/trunk/uddi-tck-runner/keystore.jks (with props)
juddi/trunk/uddi-tck-runner/truststore.jks (with props)
Modified:
juddi/trunk/uddi-client-dist/src/main/assembly/assembly.xml
juddi/trunk/uddi-tck-base/src/main/resources/tck.properties
juddi/trunk/uddi-tck-runner/pom.xml
juddi/trunk/uddi-tck-runner/src/main/java/org/apache/juddi/tckrunner/App.java
juddi/trunk/uddi-tck-runner/tck.properties
juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_141_JIRAIntegrationTest.java
Modified: juddi/trunk/uddi-client-dist/src/main/assembly/assembly.xml
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-client-dist/src/main/assembly/assembly.xml?rev=1557304&r1=1557303&r2=1557304&view=diff
==============================================================================
--- juddi/trunk/uddi-client-dist/src/main/assembly/assembly.xml (original)
+++ juddi/trunk/uddi-client-dist/src/main/assembly/assembly.xml Sat Jan 11 03:17:57 2014
@@ -219,6 +219,8 @@
<include>readme.txt</include>
<include>uddi.xml</include>
<include>juddiv3.xml</include>
+ <include>keystore.jks</include>
+ <include>truststore.jks</include>
</includes>
<directoryMode>0755</directoryMode>
<fileMode>0755</fileMode>
Modified: juddi/trunk/uddi-tck-base/src/main/resources/tck.properties
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck-base/src/main/resources/tck.properties?rev=1557304&r1=1557303&r2=1557304&view=diff
==============================================================================
--- juddi/trunk/uddi-tck-base/src/main/resources/tck.properties (original)
+++ juddi/trunk/uddi-tck-base/src/main/resources/tck.properties Sat Jan 11 03:17:57 2014
@@ -64,4 +64,15 @@ bpel.enabled=true
#load tests
loadtest.enable=true
-loadtest.maxbusinesses=1100
\ No newline at end of file
+loadtest.maxbusinesses=1100
+
+
+# digital signature tests
+keyStorePath=../uddi-tck-base/src/main/resources/keystore.jks
+keyStoreType=JKS
+filePassword=Test
+keyPassword=Test
+keyAlias=Test
+trustStorePath=../uddi-tck-base/src/main/resources/truststore.jks
+trustStoreType=JKS
+trustStorePassword=Test
\ No newline at end of file
Added: juddi/trunk/uddi-tck-runner/keystore.jks
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck-runner/keystore.jks?rev=1557304&view=auto
==============================================================================
Binary file - no diff available.
Propchange: juddi/trunk/uddi-tck-runner/keystore.jks
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: juddi/trunk/uddi-tck-runner/pom.xml
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck-runner/pom.xml?rev=1557304&r1=1557303&r2=1557304&view=diff
==============================================================================
--- juddi/trunk/uddi-tck-runner/pom.xml (original)
+++ juddi/trunk/uddi-tck-runner/pom.xml Sat Jan 11 03:17:57 2014
@@ -63,6 +63,8 @@
<configuration>
<tasks>
<copy file="${basedir}/uddi.xml" tofile="${basedir}/target/uddi.xml"/>
+ <copy file="${basedir}keystore.jks" tofile="${basedir}/target/keystore.jks"/>
+ <copy file="${basedir}truststore.jks" tofile="${basedir}/target/truststore.jks"/>
<copy file="${basedir}/tck.properties" tofile="${basedir}/target/tck.properties"/>
</tasks>
</configuration>
Modified: juddi/trunk/uddi-tck-runner/src/main/java/org/apache/juddi/tckrunner/App.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck-runner/src/main/java/org/apache/juddi/tckrunner/App.java?rev=1557304&r1=1557303&r2=1557304&view=diff
==============================================================================
--- juddi/trunk/uddi-tck-runner/src/main/java/org/apache/juddi/tckrunner/App.java (original)
+++ juddi/trunk/uddi-tck-runner/src/main/java/org/apache/juddi/tckrunner/App.java Sat Jan 11 03:17:57 2014
@@ -88,6 +88,7 @@ public class App {
org.apache.juddi.v3.tck.UDDI_130_CombineCategoryBagsFindBusinessIntegrationTest.class,
org.apache.juddi.v3.tck.UDDI_140_NegativePublicationIntegrationTest.class,
org.apache.juddi.v3.tck.UDDI_141_JIRAIntegrationTest.class,
+ org.apache.juddi.v3.tck.UDDI_142_DigitalSignatureIntegrationTest.class,
org.apache.juddi.v3.tck.UDDI_150_CustodyTransferIntegrationTest.class,
org.apache.juddi.v3.tck.UDDI_160_RESTIntergrationTest.class,
org.apache.juddi.v3.tck.UDDI_170_ValueSetValidation.class
Modified: juddi/trunk/uddi-tck-runner/tck.properties
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck-runner/tck.properties?rev=1557304&r1=1557303&r2=1557304&view=diff
==============================================================================
--- juddi/trunk/uddi-tck-runner/tck.properties (original)
+++ juddi/trunk/uddi-tck-runner/tck.properties Sat Jan 11 03:17:57 2014
@@ -67,4 +67,14 @@ bpel.enabled=true
#load tests
loadtest.enable=false
-loadtest.maxbusinesses=1100
\ No newline at end of file
+loadtest.maxbusinesses=1100
+
+# digital signature tests
+keyStorePath=./keystore.jks
+keyStoreType=JKS
+filePassword=Test
+keyPassword=Test
+keyAlias=Test
+trustStorePath=./truststore.jks
+trustStoreType=JKS
+trustStorePassword=Test
\ No newline at end of file
Added: juddi/trunk/uddi-tck-runner/truststore.jks
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck-runner/truststore.jks?rev=1557304&view=auto
==============================================================================
Binary file - no diff available.
Propchange: juddi/trunk/uddi-tck-runner/truststore.jks
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_141_JIRAIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_141_JIRAIntegrationTest.java?rev=1557304&r1=1557303&r2=1557304&view=diff
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_141_JIRAIntegrationTest.java (original)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_141_JIRAIntegrationTest.java Sat Jan 11 03:17:57 2014
@@ -1428,728 +1428,5 @@ public class UDDI_141_JIRAIntegrationTes
}
}
-
-
- @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 = publicationJoe.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 = publicationJoe.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 = publicationJoe.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 = publicationJoe.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 = publicationJoe.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 = publicationJoe.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 = publicationJoe.saveBusiness(sb);
- Assert.fail("unexpected success");
- } catch (Exception ex) {
- logger.info("Expected failure: " + ex.getMessage());
- }
- }
-
-
- 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 = publicationJoe.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 = publicationJoe.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 {
- publicationJoe.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);
- BusinessDetail saveBusiness=null;
- try {
- saveBusiness = publicationJoe.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 {
- publicationJoe.saveService(ss);
- Assert.fail("unexpected success");
- } catch (Exception ex) {
- logger.info("Expected failure: " + ex.getMessage());
- }
- finally{
- DeleteBusinesses(saveBusiness.getBusinessEntity().get(0).getBusinessKey(), authInfoJoe, publicationJoe);
- }
- }
-
- @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);
- BusinessDetail saveBusiness=null;
- try {
-
- saveBusiness = publicationJoe.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 {
- publicationJoe.saveService(ss);
- Assert.fail("unexpected success");
- } catch (Exception ex) {
- logger.info("Expected failure: " + ex.getMessage());
- }
- finally{
- DeleteBusinesses(saveBusiness.getBusinessEntity().get(0).getBusinessKey(), authInfoJoe, publicationJoe);
- }
- }
-
- @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);
- BusinessDetail saveBusiness=null;
- try {
- saveBusiness = publicationJoe.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 {
- publicationJoe.saveService(ss);
- Assert.fail("unexpected success");
- } catch (Exception ex) {
- logger.info("Expected failure: " + ex.getMessage());
- }
- finally{
- DeleteBusinesses(saveBusiness.getBusinessEntity().get(0).getBusinessKey(), authInfoJoe, publicationJoe);
- }
- }
-
- @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 {
- publicationJoe.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);
- BusinessDetail saveBusiness=null;
- try {
- saveBusiness = publicationJoe.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 {
- publicationJoe.saveService(ss);
- Assert.fail("unexpected success");
- } catch (Exception ex) {
- logger.info("Expected failure: " + ex.getMessage());
- }
- finally{
- DeleteBusinesses(saveBusiness.getBusinessEntity().get(0).getBusinessKey(), authInfoJoe, publicationJoe);
- }
- }
-
- @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);
- BusinessDetail saveBusiness=null;
- try {
- saveBusiness = publicationJoe.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 {
- publicationJoe.saveService(ss);
- Assert.fail("unexpected success");
- } catch (Exception ex) {
- logger.info("Expected failure: " + ex.getMessage());
- }
- finally{
- DeleteBusinesses(saveBusiness.getBusinessEntity().get(0).getBusinessKey(), authInfoJoe, publicationJoe);
- }
- }
-
- @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);
- BusinessDetail saveBusiness=null;
- try {
- saveBusiness = publicationJoe.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 {
- publicationJoe.saveService(ss);
- Assert.fail("unexpected success");
- } catch (Exception ex) {
- logger.info("Expected failure: " + ex.getMessage());
- }
- finally{
- DeleteBusinesses(saveBusiness.getBusinessEntity().get(0).getBusinessKey(), authInfoJoe, publicationJoe);
- }
- }
-
- @Test()
- public void JUDDI_712_SaveBusinessWithSignature() 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);
- BusinessDetail saveBusiness=null;
- try {
- saveBusiness = publicationJoe.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 = publicationJoe.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);
- publicationJoe.saveBinding(sb1);
- Assert.fail("unexpected success");
- } catch (Exception ex) {
- logger.info("Expected failure: " + ex.getMessage());
- }
- finally{
- DeleteBusinesses(saveBusiness.getBusinessEntity().get(0).getBusinessKey(), authInfoJoe, publicationJoe);
- }
- }
-
- @Test()
- public void JUDDI_716_SaveBusinessWithSignatureX509IssuerSerial() throws CertificateException {
- SaveBusiness sb = new SaveBusiness();
- sb.setAuthInfo(authInfoJoe);
- BusinessEntity be = new BusinessEntity();
- be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
-
- Name n = new Name();
- n.setValue("JUDDI_716_SaveBusinessWithSignatureX509IssuerSerial");
- be.getName().add(n);
- DigSigUtil ds = GetDigSig();
- ds.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SERIAL, "true");
- be = ds.signUddiEntity(be);
- sb.getBusinessEntity().add(be);
- BusinessDetail saveBusiness=null;
- try {
- saveBusiness = publicationJoe.saveBusiness(sb);
- GetBusinessDetail gsb=new GetBusinessDetail();
- gsb.setAuthInfo(authInfoJoe);
- gsb.getBusinessKey().add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
- BusinessDetail businessDetail = inquiryJoe.getBusinessDetail(gsb);
- PrintUDDI<BusinessEntity> printer = new PrintUDDI<BusinessEntity>();
- System.out.println(printer.print(businessDetail.getBusinessEntity().get(0)));
- AtomicReference<String> msg = new AtomicReference<String>();
- boolean b=ds.verifySignedUddiEntity(businessDetail.getBusinessEntity().get(0), msg);
- Assert.assertTrue(msg.get(),b );
- Assert.assertTrue(msg.get()==null || msg.get().length()==0);
-
- } catch (Exception ex) {
- logger.error("unExpected failure: ", ex);
- Assert.fail("unexpected failure");
- }
- finally{
- DeleteBusinesses(saveBusiness.getBusinessEntity().get(0).getBusinessKey(), authInfoJoe, publicationJoe);
- }
- }
-
- @Test()
- public void JUDDI_716_SaveBusinessAllOptions() throws CertificateException {
- SaveBusiness sb = new SaveBusiness();
- sb.setAuthInfo(authInfoJoe);
- BusinessEntity be = new BusinessEntity();
- be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
-
- Name n = new Name();
- n.setValue("JUDDI_716_SaveBusinessWithSignatureX509IssuerSerial");
- be.getName().add(n);
- DigSigUtil ds = GetDigSig();
- ds.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SERIAL, "true");
- ds.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SUBJECTDN, "true");
- be = ds.signUddiEntity(be);
- sb.getBusinessEntity().add(be);
- BusinessDetail saveBusiness=null;
- try {
- saveBusiness = publicationJoe.saveBusiness(sb);
- GetBusinessDetail gsb=new GetBusinessDetail();
- gsb.setAuthInfo(authInfoJoe);
- gsb.getBusinessKey().add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
- BusinessDetail businessDetail = inquiryJoe.getBusinessDetail(gsb);
- PrintUDDI<BusinessEntity> printer = new PrintUDDI<BusinessEntity>();
- System.out.println(printer.print(businessDetail.getBusinessEntity().get(0)));
- AtomicReference<String> msg = new AtomicReference<String>();
- boolean b=ds.verifySignedUddiEntity(businessDetail.getBusinessEntity().get(0), msg);
- Assert.assertTrue(msg.get(),b );
- Assert.assertTrue(msg.get()==null || msg.get().length()==0);
-
- } catch (Exception ex) {
- logger.error("unExpected failure: ", ex);
- Assert.fail("unexpected failure");
- }
- finally{
- DeleteBusinesses(saveBusiness.getBusinessEntity().get(0).getBusinessKey(), authInfoJoe, publicationJoe);
- }
- }
-
- 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;
- }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org