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 2013/12/12 01:27:32 UTC
svn commit: r1550327 [7/8] - in /juddi/branches/juddi-3.3.x: ./
juddi-client/src/main/java/org/apache/juddi/v3/client/config/
juddi-client/src/test/java/org/apache/juddi/v3/client/mapping/
juddi-core/src/main/java/org/apache/juddi/validation/ juddi-cor...
Modified: juddi/branches/juddi-3.3.x/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_141_JIRAIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_141_JIRAIntegrationTest.java?rev=1550327&r1=1550326&r2=1550327&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_141_JIRAIntegrationTest.java (original)
+++ juddi/branches/juddi-3.3.x/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_141_JIRAIntegrationTest.java Thu Dec 12 00:27:31 2013
@@ -22,6 +22,7 @@ import java.util.UUID;
import javax.xml.bind.JAXB;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.soap.SOAPFault;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Endpoint;
import javax.xml.ws.Holder;
import javax.xml.ws.soap.SOAPFaultException;
@@ -31,8 +32,6 @@ import org.apache.commons.logging.LogFac
import org.apache.juddi.v3.client.UDDIConstants;
import org.apache.juddi.v3.client.config.UDDIClient;
import org.apache.juddi.v3.client.transport.Transport;
-import static org.apache.juddi.v3.tck.UDDI_030_BusinessEntityIntegrationTest.tckBusiness;
-import static org.apache.juddi.v3.tck.UDDI_140_NegativePublicationIntegrationTest.tckTModel;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Assume;
@@ -57,978 +56,993 @@ import org.uddi.v3_service.UDDISubscript
*/
public class UDDI_141_JIRAIntegrationTest {
- private static Log logger = LogFactory.getLog(UDDI_141_JIRAIntegrationTest.class);
- static UDDISecurityPortType security = null;
- static UDDISubscriptionPortType subscription = null;
- static UDDIInquiryPortType inquiry = null;
- static UDDIPublicationPortType publication = null;
- static TckTModel tckTModel = null;
- static TckBusiness tckBusiness = null;
- protected static String authInfoJoe = null;
- protected static String authInfoSam = null;
- private static UDDIClient manager;
- static final String str256 = "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111";
- static final String str255 = "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111";
- static final String strkey256 = "uddi:11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111";
- static final String strkey256_1 = "uddi:org.apache:omething.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.somethi.com";
- static final String str26 = "11111111111111111111111111";
- static final String str27 = "111111111111111111111111110";
- static final String str10 = "0123456789";
- static final String str11 = "01234567890";
- static final String str80 = "01234567890123456789012345678901234567890123456789012345678901234567890123456789";
- static final String str81 = "012345678901234567890123456789012345678901234567890123456789012345678901234567891";
- static final String TRANS = "The transaction has been rolled back";
- static final String str4096 = "12345670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001234567000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000001234567000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000123456700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000123456700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012345670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012345670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001234567000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000XXXXXXXX";
- static final String str4097 = "12345670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001234567000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000001234567000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000123456700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000123456700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012345670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012345670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001234567000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000XXXXXXXXZ";
- static final String str51 = "111111111111111111111111111111111111111111111111111";
- static final String str50 = "11111111111111111111111111111111111111111111111111";
- static final String MISSING_RESOURCE = "Can't find resource for bundle";
-
- @AfterClass
- public static void stopManager() throws ConfigurationException {
- manager.stop();
- }
-
- @BeforeClass
- public static void startManager() throws ConfigurationException {
- manager = new UDDIClient();
- manager.start();
-
- logger.debug("Getting auth tokens..");
- try {
- Transport transport = manager.getTransport();
- security = transport.getUDDISecurityService();
- publication = transport.getUDDIPublishService();
- inquiry = transport.getUDDIInquiryService();
-
- subscription = transport.getUDDISubscriptionService();
- tckTModel = new TckTModel(publication, inquiry);
- tckBusiness = new TckBusiness(publication, inquiry);
- authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
- authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
- Assert.assertNotNull(authInfoJoe);
- Assert.assertNotNull(authInfoSam);
-
-
-
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- Assert.fail("Could not obtain authInfo token.");
- }
- }
-
- static void HandleException(Exception ex) {
- System.err.println("Error caught of type " + ex.getClass().getCanonicalName());
- ex.printStackTrace();
- if (ex.getMessage() != null) {
- Assert.assertFalse(ex.getMessage().contains(TRANS));
- Assert.assertFalse(ex.getMessage().contains(MISSING_RESOURCE));
- }
- if (ex instanceof SOAPFault) {
- SOAPFault sf = (SOAPFault) ex;
- if (!sf.getTextContent().contains("org.apache.juddi.v3.error.ValueNotAllowedException")) {
- Assert.fail();
- }
- }
- }
-
- @Test
- public void JUDDI_JIRA_571_Part1_Test() {
- //add a business
- //add a business with lang defined
- //find business with lang defined, expecting one result
- //find business without lang defined, expecting 2 results
- List<String> businesskeysToDelete = new ArrayList<String>();
- String failuremsg = "";
- System.out.println("JUDDI_JIRA_571_Part1_Test");
- SaveBusiness sb = new SaveBusiness();
- sb.setAuthInfo(authInfoJoe);
- BusinessEntity be = new BusinessEntity();
- Name n = new Name();
- n.setValue("JUDDI_JIRA_571_Part1_Test no lang");
- be.getName().add(n);
- sb.getBusinessEntity().add(be);
-
- be = new BusinessEntity();
- n = new Name();
- n.setValue("JUDDI_JIRA_571_Part1_Test with lang");
- n.setLang("en");
- be.getName().add(n);
- sb.getBusinessEntity().add(be);
- try {
- BusinessDetail saveBusiness = publication.saveBusiness(sb);
- businesskeysToDelete.add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
- businesskeysToDelete.add(saveBusiness.getBusinessEntity().get(1).getBusinessKey());
-
- } catch (Exception ex) {
- HandleException(ex);
- Assert.fail("unexpected failure");
- }
-
- int found1 = 0;
- FindBusiness fb = new FindBusiness();
- fb.setAuthInfo(authInfoJoe);
- n = new Name();
- n.setValue("%");
- fb.getName().add(n);
- fb.setFindQualifiers(new FindQualifiers());
- fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
- try {
- BusinessList findBusiness = inquiry.findBusiness(fb);
- if (findBusiness.getBusinessInfos() != null) {
- for (int i = 0; i < findBusiness.getBusinessInfos().getBusinessInfo().size(); i++) {
- if (businesskeysToDelete.contains(findBusiness.getBusinessInfos().getBusinessInfo().get(i).getBusinessKey())) {
- found1++;
- }
- }
- }
- } catch (Exception ex) {
- HandleException(ex);
- Assert.fail("unexpected failure");
- }
- if (found1 != 2) {
- failuremsg += "No lang defined, " + found1 + " records found instead of 2";
- }
-
-
-
- found1 = 0;
- fb = new FindBusiness();
- fb.setAuthInfo(authInfoJoe);
- n = new Name();
- n.setLang("en");
- n.setValue("%");
- fb.getName().add(n);
- fb.setFindQualifiers(new FindQualifiers());
- fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
- try {
- BusinessList findBusiness = inquiry.findBusiness(fb);
- if (findBusiness.getBusinessInfos() != null) {
- for (int i = 0; i < findBusiness.getBusinessInfos().getBusinessInfo().size(); i++) {
- if (businesskeysToDelete.contains(findBusiness.getBusinessInfos().getBusinessInfo().get(i).getBusinessKey())) {
- found1++;
- }
- }
- }
- } catch (Exception ex) {
- HandleException(ex);
- Assert.fail("unexpected failure");
- }
- if (found1 != 1) {
- failuremsg += "Lang defined, " + found1 + " records found instead of 1";
- }
-
-
- DeleteBusinesses(businesskeysToDelete);
- if (failuremsg.length() > 0) {
- Assert.fail(failuremsg);
- }
- System.out.println("Pass");
-
- }
-
- @Test
- public void JUDDI_JIRA_571_Part2_Test() {
- //add a service
- //add a service with lang defined
- //find service with lang defined, expecting one result
- //find service without lang defined, expecting 2 results
-
-
-
- List<String> businesskeysToDelete = new ArrayList<String>();
- List<String> targetServiceKeys = new ArrayList<String>();
- String failuremsg = "";
- System.out.println("JUDDI_JIRA_571_Part2_Test");
- SaveBusiness sb = new SaveBusiness();
- sb.setAuthInfo(authInfoJoe);
- BusinessEntity be = new BusinessEntity();
- Name n = new Name();
- n.setValue("JUDDI_JIRA_571_Part2_Test no lang");
- be.getName().add(n);
- sb.getBusinessEntity().add(be);
-
- BusinessService bs = new BusinessService();
- n = new Name();
- n.setValue("Service1 No Lang");
- bs.getName().add(n);
- be.setBusinessServices(new BusinessServices());
- be.getBusinessServices().getBusinessService().add(bs);
-
- bs = new BusinessService();
- n = new Name();
- n.setValue("Service2 Lang");
- n.setLang("en");
- bs.getName().add(n);
- be.getBusinessServices().getBusinessService().add(bs);
- try {
- BusinessDetail saveBusiness = publication.saveBusiness(sb);
- businesskeysToDelete.add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
- targetServiceKeys.add(saveBusiness.getBusinessEntity().get(0).getBusinessServices().getBusinessService().get(0).getServiceKey());
- targetServiceKeys.add(saveBusiness.getBusinessEntity().get(0).getBusinessServices().getBusinessService().get(1).getServiceKey());
-
- } catch (Exception ex) {
- HandleException(ex);
- Assert.fail("unexpected failure");
- }
-
- int found1 = 0;
- FindService fb = new FindService();
- fb.setAuthInfo(authInfoJoe);
- n = new Name();
- n.setValue("%");
- fb.getName().add(n);
- fb.setFindQualifiers(new FindQualifiers());
- fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
- try {
- ServiceList findBusiness = inquiry.findService(fb);
- if (findBusiness.getServiceInfos() != null) {
- for (int i = 0; i < findBusiness.getServiceInfos().getServiceInfo().size(); i++) {
- if (targetServiceKeys.contains(findBusiness.getServiceInfos().getServiceInfo().get(i).getServiceKey())) {
- found1++;
- }
- }
- }
- } catch (Exception ex) {
- HandleException(ex);
- Assert.fail("unexpected failure");
- }
- if (found1 != 2) {
- failuremsg += "No lang defined, " + found1 + " records found instead of 2";
- }
-
-
-
- found1 = 0;
- fb = new FindService();
- fb.setAuthInfo(authInfoJoe);
- n = new Name();
- n.setLang("en");
- n.setValue("%");
- fb.getName().add(n);
- fb.setFindQualifiers(new FindQualifiers());
- fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
- try {
- ServiceList findBusiness = inquiry.findService(fb);
- if (findBusiness.getServiceInfos() != null) {
- for (int i = 0; i < findBusiness.getServiceInfos().getServiceInfo().size(); i++) {
- if (businesskeysToDelete.contains(findBusiness.getServiceInfos().getServiceInfo().get(i).getBusinessKey())) {
- found1++;
- }
- }
- }
- } catch (Exception ex) {
- HandleException(ex);
- Assert.fail("unexpected failure");
- }
- if (found1 != 1) {
- failuremsg += "Lang defined, " + found1 + " records found instead of 1";
- }
-
-
- DeleteBusinesses(businesskeysToDelete);
- if (failuremsg.length() > 0) {
- Assert.fail(failuremsg);
- }
- System.out.println("Pass");
-
- }
-
- @Test
- public void JUDDI_571_Part3_Test() {
- //add a tmodel
- //add a tmodel with lang defined
- //find tmodel with lang defined, expecting one result
- //find tmodel without lang defined, expecting 2 results
-
-
- List<String> businesskeysToDelete = new ArrayList<String>();
-
- String failuremsg = "";
- System.out.println("JUDDI_571_Part3_Test");
- SaveTModel sb = new SaveTModel();
- sb.setAuthInfo(authInfoJoe);
- TModel be = new TModel();
- Name n = new Name();
- n.setValue("JUDDI_571_Part3_Test no lang");
- be.setName(n);
- sb.getTModel().add(be);
-
- be = new TModel();
- n = new Name();
- n.setValue("JUDDI_571_Part3_Test lang");
- n.setLang("en");
- be.setName(n);
- sb.getTModel().add(be);
-
- try {
- TModelDetail saveTModel = publication.saveTModel(sb);
- businesskeysToDelete.add(saveTModel.getTModel().get(0).getTModelKey());
- businesskeysToDelete.add(saveTModel.getTModel().get(1).getTModelKey());
- } catch (Exception ex) {
- HandleException(ex);
- Assert.fail("unexpected failure");
- }
-
- int found1 = 0;
- FindTModel fb = new FindTModel();
- fb.setAuthInfo(authInfoJoe);
- n = new Name();
- n.setValue("%JUDDI_571_Part3_Test%");
- fb.setName(n);
- fb.setFindQualifiers(new FindQualifiers());
- fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
- try {
- TModelList findTModel = inquiry.findTModel(fb);
- if (findTModel.getTModelInfos() != null) {
- for (int i = 0; i < findTModel.getTModelInfos().getTModelInfo().size(); i++) {
- if (businesskeysToDelete.contains(findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey())) {
- found1++;
- }
- }
- }
- } catch (Exception ex) {
- HandleException(ex);
- Assert.fail("unexpected failure");
- }
- if (found1 != 2) {
- failuremsg += "No lang defined, " + found1 + " records found instead of 2";
- }
-
-
-
- found1 = 0;
- fb = new FindTModel();
- fb.setAuthInfo(authInfoJoe);
- n = new Name();
- n.setLang("en");
- n.setValue("%JUDDI_571_Part3_Test%");
- fb.setName(n);
- fb.setFindQualifiers(new FindQualifiers());
- fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
- try {
- TModelList findTModel = inquiry.findTModel(fb);
- if (findTModel.getTModelInfos() != null) {
- for (int i = 0; i < findTModel.getTModelInfos().getTModelInfo().size(); i++) {
- if (businesskeysToDelete.contains(findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey())) {
- found1++;
- }
- }
- }
- } catch (Exception ex) {
- HandleException(ex);
- Assert.fail("unexpected failure");
- }
- if (found1 != 1) {
- failuremsg += "Lang defined, " + found1 + " records found instead of 1";
- }
-
-
- DeleteTModels(businesskeysToDelete);
- if (failuremsg.length() > 0) {
- Assert.fail(failuremsg);
- }
- System.out.println("Pass");
-
- }
-
- @Test
- public void JUDDI_574() {
- //make a test model with a lang
-
- //search for it by name
-
- //confirm that the lang is present
-
- List<String> businesskeysToDelete = new ArrayList<String>();
-
- String failuremsg = "";
- System.out.println("JUDDI_574");
- SaveTModel sb = new SaveTModel();
- sb.setAuthInfo(authInfoJoe);
- TModel be = new TModel();
- Name n = new Name();
- n.setValue("JUDDI_574");
- n.setLang("en");
- be.setName(n);
- sb.getTModel().add(be);
-
- try {
- TModelDetail saveTModel = publication.saveTModel(sb);
- businesskeysToDelete.add(saveTModel.getTModel().get(0).getTModelKey());
- System.out.println("tmodel created with key " + saveTModel.getTModel().get(0).getTModelKey());
- } catch (Exception ex) {
- HandleException(ex);
- Assert.fail("unexpected failure");
- }
- int found1 = 0;
- FindTModel fb = new FindTModel();
- fb.setAuthInfo(authInfoJoe);
- n = new Name();
- n.setValue("JUDDI_574");
- fb.setName(n);
- fb.setFindQualifiers(new FindQualifiers());
- fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
- try {
- TModelList findTModel = inquiry.findTModel(fb);
- if (findTModel.getTModelInfos() != null) {
- for (int i = 0; i < findTModel.getTModelInfos().getTModelInfo().size(); i++) {
- if (businesskeysToDelete.contains(findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey())) {
- found1++;
- if (findTModel.getTModelInfos().getTModelInfo().get(i).getName() == null
- || findTModel.getTModelInfos().getTModelInfo().get(i).getName().getLang() == null
- || findTModel.getTModelInfos().getTModelInfo().get(i).getName().getLang().length() == 0) {
- failuremsg += "Tmodel key " + findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey()
- + " has a null or empty lang";
- }
- }
-
- }
- }
- } catch (Exception ex) {
- HandleException(ex);
- Assert.fail("unexpected failure");
- }
- if (found1 != 1) {
- failuremsg += "found " + found1 + " records found instead of 1";
- }
-
- DeleteTModels(businesskeysToDelete);
- if (failuremsg.length() > 0) {
- Assert.fail(failuremsg);
- }
- System.out.println("Pass");
-
- }
-
- /**
- * sets up a compelte publisher assertion
- *
- * @throws Exception
- */
- @Test
- public void JUDDI_590() throws Exception {
- //create two businesses
- System.out.println("JUDDI_590");
-
- SaveBusiness sb = new SaveBusiness();
- sb.setAuthInfo(authInfoJoe);
- BusinessEntity be = new BusinessEntity();
- Name n = new Name();
- n.setValue("JUDDI_590 Joe");
- be.getName().add(n);
- sb.getBusinessEntity().add(be);
- String joeBiz = null;
- try {
- BusinessDetail saveBusiness = publication.saveBusiness(sb);
- joeBiz = saveBusiness.getBusinessEntity().get(0).getBusinessKey();
- //DeleteBusiness db = new DeleteBusiness();
- //db.setAuthInfo(authInfoJoe);
- //db.getBusinessKey().add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
- //publication.deleteBusiness(db);
- //Assert.fail("request should have been rejected");
- } catch (SOAPFaultException ex) {
- HandleException(ex);
- }
-
- sb = new SaveBusiness();
- sb.setAuthInfo(authInfoSam);
- be = new BusinessEntity();
- n = new Name();
- n.setValue("JUDDI_590 Sam");
- be.getName().add(n);
- sb.getBusinessEntity().add(be);
- String samBiz = null;
- try {
- BusinessDetail saveBusiness = publication.saveBusiness(sb);
- samBiz = saveBusiness.getBusinessEntity().get(0).getBusinessKey();
- //DeleteBusiness db = new DeleteBusiness();
- //db.setAuthInfo(authInfoJoe);
- //db.getBusinessKey().add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
- //publication.deleteBusiness(db);
- //Assert.fail("request should have been rejected");
- } catch (SOAPFaultException ex) {
- HandleException(ex);
- }
-
-
- //create an assertion on one end
- AddPublisherAssertions apa = new AddPublisherAssertions();
- apa.setAuthInfo(authInfoJoe);
- apa.getPublisherAssertion().add(new PublisherAssertion());
- apa.getPublisherAssertion().get(0).setFromKey(joeBiz);
- apa.getPublisherAssertion().get(0).setToKey(samBiz);
- KeyedReference kr = new KeyedReference();
- kr.setKeyName("Subsidiary");
- kr.setKeyValue("parent-child");
- kr.setTModelKey("uddi:uddi.org:relationships");
- apa.getPublisherAssertion().get(0).setKeyedReference(kr);
- publication.addPublisherAssertions(apa);
- //check get status is not null from 1 and from 2
- boolean ok = true;
- String msg = "";
- try {
- List<AssertionStatusItem> assertionStatusReport = publication.getAssertionStatusReport(authInfoJoe, CompletionStatus.STATUS_TO_KEY_INCOMPLETE);
- if (assertionStatusReport.isEmpty()) {
- msg = "Stage1: no result returned, expected at least 1";
- ok = false;
- }
- for (int i = 0; i < assertionStatusReport.size(); i++) {
- JAXB.marshal(assertionStatusReport.get(i), System.out);
- if (assertionStatusReport.get(i).getToKey().equals(samBiz)) {
- if (!assertionStatusReport.get(i).getCompletionStatus().equals(CompletionStatus.STATUS_TO_KEY_INCOMPLETE)) {
- ok = false;
- msg = "Stage1: status type mismatch";
- }
+ private static Log logger = LogFactory.getLog(UDDI_141_JIRAIntegrationTest.class);
+ static UDDISecurityPortType security = null;
+ static UDDISubscriptionPortType subscriptionJoe = null;
+ static UDDIInquiryPortType inquiryJoe = null;
+ static UDDIPublicationPortType publicationJoe = null;
+ static TckTModel tckTModelJoe = null;
+ static TckBusiness tckBusinessJoe = null;
+ static UDDISubscriptionPortType subscriptionSam = null;
+ static UDDIInquiryPortType inquiryJoeSam = null;
+ static UDDIPublicationPortType publicationSam = null;
+ static TckTModel tckTModelSam = null;
+ static TckBusiness tckBusinessSam = null;
+ protected static String authInfoJoe = null;
+ protected static String authInfoSam = null;
+ private static UDDIClient manager;
+ static final String str256 = "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111";
+ static final String str255 = "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111";
+ static final String strkey256 = "uddi:11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111";
+ static final String strkey256_1 = "uddi:org.apache:omething.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.something.somethi.com";
+ static final String str26 = "11111111111111111111111111";
+ static final String str27 = "111111111111111111111111110";
+ static final String str10 = "0123456789";
+ static final String str11 = "01234567890";
+ static final String str80 = "01234567890123456789012345678901234567890123456789012345678901234567890123456789";
+ static final String str81 = "012345678901234567890123456789012345678901234567890123456789012345678901234567891";
+ static final String TRANS = "The transaction has been rolled back";
+ static final String str4096 = "1234567000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000123456700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000123456700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012345670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012345670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001234567000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001234567000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000123456700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000XXXXXXXX";
+ static final String str4097 = "1234567000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000123456700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000123456700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012345670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012345670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001234567000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001234567000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000123456700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000XXXXXXXXZ";
+ static final String str51 = "111111111111111111111111111111111111111111111111111";
+ static final String str50 = "11111111111111111111111111111111111111111111111111";
+ static final String MISSING_RESOURCE = "Can't find resource for bundle";
+
+ @AfterClass
+ public static void stopManager() throws ConfigurationException {
+ manager.stop();
+ }
+
+ @BeforeClass
+ public static void startManager() throws ConfigurationException {
+ manager = new UDDIClient();
+ manager.start();
+
+ logger.debug("Getting auth tokens..");
+ try {
+ Transport transport = manager.getTransport();
+ security = transport.getUDDISecurityService();
+
+ publicationJoe = transport.getUDDIPublishService();
+ inquiryJoe = transport.getUDDIInquiryService();
+
+ subscriptionJoe = transport.getUDDISubscriptionService();
+
+ authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+ authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
+ //Assert.assertNotNull(authInfoJoe);
+ //Assert.assertNotNull(authInfoSam);
+ if (!TckPublisher.isUDDIAuthMode()) {
+ TckSecurity.setCredentials((BindingProvider) publicationJoe, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+ TckSecurity.setCredentials((BindingProvider) inquiryJoe, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+ TckSecurity.setCredentials((BindingProvider) subscriptionJoe, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+
+ }
+ tckTModelJoe = new TckTModel(publicationJoe, inquiryJoe);
+ tckBusinessJoe = new TckBusiness(publicationJoe, inquiryJoe);
+
+
+ transport = manager.getTransport();
+
+ publicationSam = transport.getUDDIPublishService();
+ inquiryJoeSam = transport.getUDDIInquiryService();
+ if (!TckPublisher.isUDDIAuthMode()) {
+ TckSecurity.setCredentials((BindingProvider) publicationSam, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
+ TckSecurity.setCredentials((BindingProvider) inquiryJoeSam, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
+ TckSecurity.setCredentials((BindingProvider) subscriptionSam, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+ }
+ subscriptionSam = transport.getUDDISubscriptionService();
+ tckTModelSam = new TckTModel(publicationSam, inquiryJoeSam);
+ tckBusinessSam = new TckBusiness(publicationSam, inquiryJoeSam);
+
+
+
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ Assert.fail("Could not obtain authInfo token.");
+ }
+ }
+
+ static void HandleException(Exception ex) {
+ System.err.println("Error caught of type " + ex.getClass().getCanonicalName());
+ ex.printStackTrace();
+ if (ex.getMessage() != null) {
+ Assert.assertFalse(ex.getMessage().contains(TRANS));
+ Assert.assertFalse(ex.getMessage().contains(MISSING_RESOURCE));
+ }
+ if (ex instanceof SOAPFault) {
+ SOAPFault sf = (SOAPFault) ex;
+ if (!sf.getTextContent().contains("org.apache.juddi.v3.error.ValueNotAllowedException")) {
+ Assert.fail();
+ }
+ }
+ }
+
+ @Test
+ public void JUDDI_JIRA_571_Part1_Test() {
+ //add a business
+ //add a business with lang defined
+ //find business with lang defined, expecting one result
+ //find business without lang defined, expecting 2 results
+ List<String> businesskeysToDelete = new ArrayList<String>();
+ String failuremsg = "";
+ System.out.println("JUDDI_JIRA_571_Part1_Test");
+ SaveBusiness sb = new SaveBusiness();
+ sb.setAuthInfo(authInfoJoe);
+ BusinessEntity be = new BusinessEntity();
+ Name n = new Name();
+ n.setValue("JUDDI_JIRA_571_Part1_Test no lang");
+ be.getName().add(n);
+ sb.getBusinessEntity().add(be);
+
+ be = new BusinessEntity();
+ n = new Name();
+ n.setValue("JUDDI_JIRA_571_Part1_Test with lang");
+ n.setLang("en");
+ be.getName().add(n);
+ sb.getBusinessEntity().add(be);
+ try {
+ BusinessDetail saveBusiness = publicationJoe.saveBusiness(sb);
+ businesskeysToDelete.add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
+ businesskeysToDelete.add(saveBusiness.getBusinessEntity().get(1).getBusinessKey());
+
+ } catch (Exception ex) {
+ HandleException(ex);
+ Assert.fail("unexpected failure");
+ }
+
+ int found1 = 0;
+ FindBusiness fb = new FindBusiness();
+ fb.setAuthInfo(authInfoJoe);
+ n = new Name();
+ n.setValue("%");
+ fb.getName().add(n);
+ fb.setFindQualifiers(new FindQualifiers());
+ fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
+ try {
+ BusinessList findBusiness = inquiryJoe.findBusiness(fb);
+ if (findBusiness.getBusinessInfos() != null) {
+ for (int i = 0; i < findBusiness.getBusinessInfos().getBusinessInfo().size(); i++) {
+ if (businesskeysToDelete.contains(findBusiness.getBusinessInfos().getBusinessInfo().get(i).getBusinessKey())) {
+ found1++;
+ }
+ }
+ }
+ } catch (Exception ex) {
+ HandleException(ex);
+ Assert.fail("unexpected failure");
+ }
+ if (found1 != 2) {
+ failuremsg += "No lang defined, " + found1 + " records found instead of 2";
+ }
+
+
+
+ found1 = 0;
+ fb = new FindBusiness();
+ fb.setAuthInfo(authInfoJoe);
+ n = new Name();
+ n.setLang("en");
+ n.setValue("%");
+ fb.getName().add(n);
+ fb.setFindQualifiers(new FindQualifiers());
+ fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
+ try {
+ BusinessList findBusiness = inquiryJoe.findBusiness(fb);
+ if (findBusiness.getBusinessInfos() != null) {
+ for (int i = 0; i < findBusiness.getBusinessInfos().getBusinessInfo().size(); i++) {
+ if (businesskeysToDelete.contains(findBusiness.getBusinessInfos().getBusinessInfo().get(i).getBusinessKey())) {
+ found1++;
+ }
+ }
+ }
+ } catch (Exception ex) {
+ HandleException(ex);
+ Assert.fail("unexpected failure");
+ }
+ if (found1 != 1) {
+ failuremsg += "Lang defined, " + found1 + " records found instead of 1";
+ }
+
+
+ DeleteBusinesses(businesskeysToDelete, authInfoJoe, publicationJoe);
+ if (failuremsg.length() > 0) {
+ Assert.fail(failuremsg);
+ }
+ System.out.println("Pass");
+
+ }
+
+ @Test
+ public void JUDDI_JIRA_571_Part2_Test() {
+ //add a service
+ //add a service with lang defined
+ //find service with lang defined, expecting one result
+ //find service without lang defined, expecting 2 results
+
+
+
+ List<String> businesskeysToDelete = new ArrayList<String>();
+ List<String> targetServiceKeys = new ArrayList<String>();
+ String failuremsg = "";
+ System.out.println("JUDDI_JIRA_571_Part2_Test");
+ SaveBusiness sb = new SaveBusiness();
+ sb.setAuthInfo(authInfoJoe);
+ BusinessEntity be = new BusinessEntity();
+ Name n = new Name();
+ n.setValue("JUDDI_JIRA_571_Part2_Test no lang");
+ be.getName().add(n);
+ sb.getBusinessEntity().add(be);
+
+ BusinessService bs = new BusinessService();
+ n = new Name();
+ n.setValue("Service1 No Lang");
+ bs.getName().add(n);
+ be.setBusinessServices(new BusinessServices());
+ be.getBusinessServices().getBusinessService().add(bs);
+
+ bs = new BusinessService();
+ n = new Name();
+ n.setValue("Service2 Lang");
+ n.setLang("en");
+ bs.getName().add(n);
+ be.getBusinessServices().getBusinessService().add(bs);
+ try {
+ BusinessDetail saveBusiness = publicationJoe.saveBusiness(sb);
+ businesskeysToDelete.add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
+ targetServiceKeys.add(saveBusiness.getBusinessEntity().get(0).getBusinessServices().getBusinessService().get(0).getServiceKey());
+ targetServiceKeys.add(saveBusiness.getBusinessEntity().get(0).getBusinessServices().getBusinessService().get(1).getServiceKey());
+
+ } catch (Exception ex) {
+ HandleException(ex);
+ Assert.fail("unexpected failure");
+ }
+
+ int found1 = 0;
+ FindService fb = new FindService();
+ fb.setAuthInfo(authInfoJoe);
+ n = new Name();
+ n.setValue("%");
+ fb.getName().add(n);
+ fb.setFindQualifiers(new FindQualifiers());
+ fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
+ try {
+ ServiceList findBusiness = inquiryJoe.findService(fb);
+ if (findBusiness.getServiceInfos() != null) {
+ for (int i = 0; i < findBusiness.getServiceInfos().getServiceInfo().size(); i++) {
+ if (targetServiceKeys.contains(findBusiness.getServiceInfos().getServiceInfo().get(i).getServiceKey())) {
+ found1++;
+ }
+ }
+ }
+ } catch (Exception ex) {
+ HandleException(ex);
+ Assert.fail("unexpected failure");
+ }
+ if (found1 != 2) {
+ failuremsg += "No lang defined, " + found1 + " records found instead of 2";
+ }
+
+
+
+ found1 = 0;
+ fb = new FindService();
+ fb.setAuthInfo(authInfoJoe);
+ n = new Name();
+ n.setLang("en");
+ n.setValue("%");
+ fb.getName().add(n);
+ fb.setFindQualifiers(new FindQualifiers());
+ fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
+ try {
+ ServiceList findBusiness = inquiryJoe.findService(fb);
+ if (findBusiness.getServiceInfos() != null) {
+ for (int i = 0; i < findBusiness.getServiceInfos().getServiceInfo().size(); i++) {
+ if (businesskeysToDelete.contains(findBusiness.getServiceInfos().getServiceInfo().get(i).getBusinessKey())) {
+ found1++;
+ }
+ }
+ }
+ } catch (Exception ex) {
+ HandleException(ex);
+ Assert.fail("unexpected failure");
+ }
+ if (found1 != 1) {
+ failuremsg += "Lang defined, " + found1 + " records found instead of 1";
+ }
+
+
+ DeleteBusinesses(businesskeysToDelete, authInfoJoe, publicationJoe);
+ if (failuremsg.length() > 0) {
+ Assert.fail(failuremsg);
+ }
+ System.out.println("Pass");
+
+ }
+
+ @Test
+ public void JUDDI_571_Part3_Test() {
+ //add a tmodel
+ //add a tmodel with lang defined
+ //find tmodel with lang defined, expecting one result
+ //find tmodel without lang defined, expecting 2 results
+
+
+ List<String> businesskeysToDelete = new ArrayList<String>();
+
+ String failuremsg = "";
+ System.out.println("JUDDI_571_Part3_Test");
+ SaveTModel sb = new SaveTModel();
+ sb.setAuthInfo(authInfoJoe);
+ TModel be = new TModel();
+ Name n = new Name();
+ n.setValue("JUDDI_571_Part3_Test no lang");
+ be.setName(n);
+ sb.getTModel().add(be);
+
+ be = new TModel();
+ n = new Name();
+ n.setValue("JUDDI_571_Part3_Test lang");
+ n.setLang("en");
+ be.setName(n);
+ sb.getTModel().add(be);
+
+ try {
+ TModelDetail saveTModel = publicationJoe.saveTModel(sb);
+ businesskeysToDelete.add(saveTModel.getTModel().get(0).getTModelKey());
+ businesskeysToDelete.add(saveTModel.getTModel().get(1).getTModelKey());
+ } catch (Exception ex) {
+ HandleException(ex);
+ Assert.fail("unexpected failure");
+ }
+
+ int found1 = 0;
+ FindTModel fb = new FindTModel();
+ fb.setAuthInfo(authInfoJoe);
+ n = new Name();
+ n.setValue("%JUDDI_571_Part3_Test%");
+ fb.setName(n);
+ fb.setFindQualifiers(new FindQualifiers());
+ fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
+ try {
+ TModelList findTModel = inquiryJoe.findTModel(fb);
+ if (findTModel.getTModelInfos() != null) {
+ for (int i = 0; i < findTModel.getTModelInfos().getTModelInfo().size(); i++) {
+ if (businesskeysToDelete.contains(findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey())) {
+ found1++;
+ }
+ }
+ }
+ } catch (Exception ex) {
+ HandleException(ex);
+ Assert.fail("unexpected failure");
+ }
+ if (found1 != 2) {
+ failuremsg += "No lang defined, " + found1 + " records found instead of 2";
+ }
+
+
+
+ found1 = 0;
+ fb = new FindTModel();
+ fb.setAuthInfo(authInfoJoe);
+ n = new Name();
+ n.setLang("en");
+ n.setValue("%JUDDI_571_Part3_Test%");
+ fb.setName(n);
+ fb.setFindQualifiers(new FindQualifiers());
+ fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
+ try {
+ TModelList findTModel = inquiryJoe.findTModel(fb);
+ if (findTModel.getTModelInfos() != null) {
+ for (int i = 0; i < findTModel.getTModelInfos().getTModelInfo().size(); i++) {
+ if (businesskeysToDelete.contains(findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey())) {
+ found1++;
+ }
+ }
+ }
+ } catch (Exception ex) {
+ HandleException(ex);
+ Assert.fail("unexpected failure");
+ }
+ if (found1 != 1) {
+ failuremsg += "Lang defined, " + found1 + " records found instead of 1";
+ }
+
+
+ DeleteTModels(businesskeysToDelete);
+ if (failuremsg.length() > 0) {
+ Assert.fail(failuremsg);
}
- }
- } catch (Exception ex) {
- ok = false;
- ex.printStackTrace();
+ System.out.println("Pass");
+
}
+ @Test
+ public void JUDDI_574() {
+ //make a test model with a lang
+
+ //search for it by name
+
+ //confirm that the lang is present
+
+ List<String> businesskeysToDelete = new ArrayList<String>();
+
+ String failuremsg = "";
+ System.out.println("JUDDI_574");
+ SaveTModel sb = new SaveTModel();
+ sb.setAuthInfo(authInfoJoe);
+ TModel be = new TModel();
+ Name n = new Name();
+ n.setValue("JUDDI_574");
+ n.setLang("en");
+ be.setName(n);
+ sb.getTModel().add(be);
+
+ try {
+ TModelDetail saveTModel = publicationJoe.saveTModel(sb);
+ businesskeysToDelete.add(saveTModel.getTModel().get(0).getTModelKey());
+ System.out.println("tmodel created with key " + saveTModel.getTModel().get(0).getTModelKey());
+ } catch (Exception ex) {
+ HandleException(ex);
+ Assert.fail("unexpected failure");
+ }
+ int found1 = 0;
+ FindTModel fb = new FindTModel();
+ fb.setAuthInfo(authInfoJoe);
+ n = new Name();
+ n.setValue("JUDDI_574");
+ fb.setName(n);
+ fb.setFindQualifiers(new FindQualifiers());
+ fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
+ try {
+ TModelList findTModel = inquiryJoe.findTModel(fb);
+ if (findTModel.getTModelInfos() != null) {
+ for (int i = 0; i < findTModel.getTModelInfos().getTModelInfo().size(); i++) {
+ if (businesskeysToDelete.contains(findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey())) {
+ found1++;
+ if (findTModel.getTModelInfos().getTModelInfo().get(i).getName() == null
+ || findTModel.getTModelInfos().getTModelInfo().get(i).getName().getLang() == null
+ || findTModel.getTModelInfos().getTModelInfo().get(i).getName().getLang().length() == 0) {
+ failuremsg += "Tmodel key " + findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey()
+ + " has a null or empty lang";
+ }
+ }
+
+ }
+ }
+ } catch (Exception ex) {
+ HandleException(ex);
+ Assert.fail("unexpected failure");
+ }
+ if (found1 != 1) {
+ failuremsg += "found " + found1 + " records found instead of 1";
+ }
- //aprove the assertion from sam
- apa = new AddPublisherAssertions();
- apa.setAuthInfo(authInfoSam);
- apa.getPublisherAssertion().add(new PublisherAssertion());
- apa.getPublisherAssertion().get(0).setFromKey(joeBiz);
- apa.getPublisherAssertion().get(0).setToKey(samBiz);
- kr = new KeyedReference();
- kr.setKeyName("Subsidiary");
- kr.setKeyValue("parent-child");
- kr.setTModelKey("uddi:uddi.org:relationships");
- apa.getPublisherAssertion().get(0).setKeyedReference(kr);
- publication.addPublisherAssertions(apa);
- try {
- List<AssertionStatusItem> assertionStatusReport = publication.getAssertionStatusReport(authInfoJoe, CompletionStatus.STATUS_COMPLETE);
- if (assertionStatusReport.isEmpty()) {
- msg = "Stage2: no result returned, expected at least 1";
- ok = false;
- }
- for (int i = 0; i < assertionStatusReport.size(); i++) {
- JAXB.marshal(assertionStatusReport.get(i), System.out);
- if (assertionStatusReport.get(i).getToKey().equals(samBiz)) {
- if (!assertionStatusReport.get(i).getCompletionStatus().equals(CompletionStatus.STATUS_COMPLETE)) {
+ DeleteTModels(businesskeysToDelete);
+ if (failuremsg.length() > 0) {
+ Assert.fail(failuremsg);
+ }
+ System.out.println("Pass");
+
+ }
+
+ /**
+ * sets up a compelte publisher assertion
+ *
+ * @throws Exception
+ */
+ @Test
+ public void JUDDI_590() throws Exception {
+ //create two businesses
+ System.out.println("JUDDI_590");
+
+ SaveBusiness sb = new SaveBusiness();
+ sb.setAuthInfo(authInfoJoe);
+ BusinessEntity be = new BusinessEntity();
+ Name n = new Name();
+ n.setValue("JUDDI_590 Joe");
+ be.getName().add(n);
+ sb.getBusinessEntity().add(be);
+ String joeBiz = null;
+ try {
+ BusinessDetail saveBusiness = publicationJoe.saveBusiness(sb);
+ joeBiz = saveBusiness.getBusinessEntity().get(0).getBusinessKey();
+ //DeleteBusiness db = new DeleteBusiness();
+ //db.setAuthInfo(authInfoJoe);
+ //db.getBusinessKey().add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
+ //publicationJoe.deleteBusiness(db);
+ //Assert.fail("request should have been rejected");
+ } catch (SOAPFaultException ex) {
+ HandleException(ex);
+ }
+
+ sb = new SaveBusiness();
+ sb.setAuthInfo(authInfoSam);
+ be = new BusinessEntity();
+ n = new Name();
+ n.setValue("JUDDI_590 Sam");
+ be.getName().add(n);
+ sb.getBusinessEntity().add(be);
+ String samBiz = null;
+ try {
+ BusinessDetail saveBusiness = publicationSam.saveBusiness(sb);
+ samBiz = saveBusiness.getBusinessEntity().get(0).getBusinessKey();
+ //DeleteBusiness db = new DeleteBusiness();
+ //db.setAuthInfo(authInfoJoe);
+ //db.getBusinessKey().add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
+ //publicationJoe.deleteBusiness(db);
+ //Assert.fail("request should have been rejected");
+ } catch (SOAPFaultException ex) {
+ HandleException(ex);
+ }
+
+
+ //create an assertion on one end
+ AddPublisherAssertions apa = new AddPublisherAssertions();
+ apa.setAuthInfo(authInfoJoe);
+ apa.getPublisherAssertion().add(new PublisherAssertion());
+ apa.getPublisherAssertion().get(0).setFromKey(joeBiz);
+ apa.getPublisherAssertion().get(0).setToKey(samBiz);
+ KeyedReference kr = new KeyedReference();
+ kr.setKeyName("Subsidiary");
+ kr.setKeyValue("parent-child");
+ kr.setTModelKey("uddi:uddi.org:relationships");
+ apa.getPublisherAssertion().get(0).setKeyedReference(kr);
+ publicationJoe.addPublisherAssertions(apa);
+ //check get status is not null from 1 and from 2
+ boolean ok = true;
+ String msg = "";
+ try {
+ List<AssertionStatusItem> assertionStatusReport = publicationJoe.getAssertionStatusReport(authInfoJoe, CompletionStatus.STATUS_TO_KEY_INCOMPLETE);
+ if (assertionStatusReport.isEmpty()) {
+ msg = "Stage1: no result returned, expected at least 1";
+ ok = false;
+ }
+ for (int i = 0; i < assertionStatusReport.size(); i++) {
+ JAXB.marshal(assertionStatusReport.get(i), System.out);
+ if (assertionStatusReport.get(i).getToKey().equals(samBiz)) {
+ if (!assertionStatusReport.get(i).getCompletionStatus().equals(CompletionStatus.STATUS_TO_KEY_INCOMPLETE)) {
+ ok = false;
+ msg = "Stage1: status type mismatch";
+ }
+ }
+ }
+ } catch (Exception ex) {
ok = false;
- msg = "Stage2: status type mismatch";
- }
+ ex.printStackTrace();
}
- }
- //test to see what the status actually is
- if (!ok) {
- assertionStatusReport = publication.getAssertionStatusReport(authInfoJoe, CompletionStatus.STATUS_FROM_KEY_INCOMPLETE);
- for (int i = 0; i < assertionStatusReport.size(); i++) {
- JAXB.marshal(assertionStatusReport.get(i), System.out);
- if (assertionStatusReport.get(i).getToKey().equals(samBiz)) {
- msg = "Stage3: status is " + assertionStatusReport.get(i).getCompletionStatus().toString() + " instead of complete";
- }
- }
-
- assertionStatusReport = publication.getAssertionStatusReport(authInfoJoe, CompletionStatus.STATUS_TO_KEY_INCOMPLETE);
- for (int i = 0; i < assertionStatusReport.size(); i++) {
- JAXB.marshal(assertionStatusReport.get(i), System.out);
- if (assertionStatusReport.get(i).getToKey().equals(samBiz)) {
- msg = "Stage3: status is " + assertionStatusReport.get(i).getCompletionStatus().toString() + " instead of complete";
- }
- }
- assertionStatusReport = publication.getAssertionStatusReport(authInfoJoe, CompletionStatus.STATUS_BOTH_INCOMPLETE);
- for (int i = 0; i < assertionStatusReport.size(); i++) {
- JAXB.marshal(assertionStatusReport.get(i), System.out);
- if (assertionStatusReport.get(i).getToKey().equals(samBiz)) {
- msg = "Stage3: status is " + assertionStatusReport.get(i).getCompletionStatus().toString() + " instead of complete";
- }
- }
-
- }
- } catch (Exception ex) {
- ok = false;
- ex.printStackTrace();
- }
- List<String> biz = new ArrayList<String>();
- biz.add(samBiz);
- DeleteBusinesses(biz, authInfoSam);
-
- biz = new ArrayList<String>();
- biz.add(joeBiz);
- DeleteBusinesses(biz, authInfoJoe);
- Assert.assertTrue(msg, ok);
-
-
- }
-
- /**
- * setups up a partial relationship and confirms its existence
- *
- * @throws Exception
- */
- @Test
- public void JUDDI_590_1() throws Exception {
- //create two businesses
- System.out.println("JUDDI_590_1");
-
- SaveBusiness sb = new SaveBusiness();
- sb.setAuthInfo(authInfoJoe);
- BusinessEntity be = new BusinessEntity();
- Name n = new Name();
- n.setValue("JUDDI_590 Joe");
- be.getName().add(n);
- sb.getBusinessEntity().add(be);
- String joeBiz = null;
- try {
- BusinessDetail saveBusiness = publication.saveBusiness(sb);
- joeBiz = saveBusiness.getBusinessEntity().get(0).getBusinessKey();
- //DeleteBusiness db = new DeleteBusiness();
- //db.setAuthInfo(authInfoJoe);
- //db.getBusinessKey().add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
- //publication.deleteBusiness(db);
- //Assert.fail("request should have been rejected");
- } catch (SOAPFaultException ex) {
- HandleException(ex);
- }
-
- sb = new SaveBusiness();
- sb.setAuthInfo(authInfoSam);
- be = new BusinessEntity();
- n = new Name();
- n.setValue("JUDDI_590 Sam");
- be.getName().add(n);
- sb.getBusinessEntity().add(be);
- String samBiz = null;
- try {
- BusinessDetail saveBusiness = publication.saveBusiness(sb);
- samBiz = saveBusiness.getBusinessEntity().get(0).getBusinessKey();
- //DeleteBusiness db = new DeleteBusiness();
- //db.setAuthInfo(authInfoJoe);
- //db.getBusinessKey().add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
- //publication.deleteBusiness(db);
- //Assert.fail("request should have been rejected");
- } catch (SOAPFaultException ex) {
- HandleException(ex);
- }
-
-
- //create an assertion on one end
- AddPublisherAssertions apa = new AddPublisherAssertions();
- apa.setAuthInfo(authInfoJoe);
- apa.getPublisherAssertion().add(new PublisherAssertion());
- apa.getPublisherAssertion().get(0).setFromKey(joeBiz);
- apa.getPublisherAssertion().get(0).setToKey(samBiz);
- KeyedReference kr = new KeyedReference();
- kr.setKeyName("Subsidiary");
- kr.setKeyValue("parent-child");
- kr.setTModelKey("uddi:uddi.org:relationships");
- apa.getPublisherAssertion().get(0).setKeyedReference(kr);
- publication.addPublisherAssertions(apa);
- //ok so joe has asserted that he knows sam
-
- //check get status is not null from 1 and from 2
- boolean ok = true;
- String msg = "";
- try {
- List<AssertionStatusItem> assertionStatusReport = publication.getAssertionStatusReport(authInfoJoe, CompletionStatus.STATUS_TO_KEY_INCOMPLETE);
- if (assertionStatusReport.isEmpty()) {
- msg = "Stage1: no result returned, expected at least 1";
- ok = false;
- }
- for (int i = 0; i < assertionStatusReport.size(); i++) {
- JAXB.marshal(assertionStatusReport.get(i), System.out);
- if (assertionStatusReport.get(i).getToKey().equals(samBiz)) {
- if (!assertionStatusReport.get(i).getCompletionStatus().equals(CompletionStatus.STATUS_TO_KEY_INCOMPLETE)) {
+
+
+ //aprove the assertion from sam
+ apa = new AddPublisherAssertions();
+ apa.setAuthInfo(authInfoSam);
+ apa.getPublisherAssertion().add(new PublisherAssertion());
+ apa.getPublisherAssertion().get(0).setFromKey(joeBiz);
+ apa.getPublisherAssertion().get(0).setToKey(samBiz);
+ kr = new KeyedReference();
+ kr.setKeyName("Subsidiary");
+ kr.setKeyValue("parent-child");
+ kr.setTModelKey("uddi:uddi.org:relationships");
+ apa.getPublisherAssertion().get(0).setKeyedReference(kr);
+ publicationSam.addPublisherAssertions(apa);
+ try {
+ List<AssertionStatusItem> assertionStatusReport = publicationJoe.getAssertionStatusReport(authInfoJoe, CompletionStatus.STATUS_COMPLETE);
+ if (assertionStatusReport.isEmpty()) {
+ msg = "Stage2: no result returned, expected at least 1";
+ ok = false;
+ }
+ for (int i = 0; i < assertionStatusReport.size(); i++) {
+ JAXB.marshal(assertionStatusReport.get(i), System.out);
+ if (assertionStatusReport.get(i).getToKey().equals(samBiz)) {
+ if (!assertionStatusReport.get(i).getCompletionStatus().equals(CompletionStatus.STATUS_COMPLETE)) {
+ ok = false;
+ msg = "Stage2: status type mismatch";
+ }
+ }
+ }
+ //test to see what the status actually is
+ if (!ok) {
+ assertionStatusReport = publicationJoe.getAssertionStatusReport(authInfoJoe, CompletionStatus.STATUS_FROM_KEY_INCOMPLETE);
+ for (int i = 0; i < assertionStatusReport.size(); i++) {
+ JAXB.marshal(assertionStatusReport.get(i), System.out);
+ if (assertionStatusReport.get(i).getToKey().equals(samBiz)) {
+ msg = "Stage3: status is " + assertionStatusReport.get(i).getCompletionStatus().toString() + " instead of complete";
+ }
+ }
+
+ assertionStatusReport = publicationJoe.getAssertionStatusReport(authInfoJoe, CompletionStatus.STATUS_TO_KEY_INCOMPLETE);
+ for (int i = 0; i < assertionStatusReport.size(); i++) {
+ JAXB.marshal(assertionStatusReport.get(i), System.out);
+ if (assertionStatusReport.get(i).getToKey().equals(samBiz)) {
+ msg = "Stage3: status is " + assertionStatusReport.get(i).getCompletionStatus().toString() + " instead of complete";
+ }
+ }
+ assertionStatusReport = publicationJoe.getAssertionStatusReport(authInfoJoe, CompletionStatus.STATUS_BOTH_INCOMPLETE);
+ for (int i = 0; i < assertionStatusReport.size(); i++) {
+ JAXB.marshal(assertionStatusReport.get(i), System.out);
+ if (assertionStatusReport.get(i).getToKey().equals(samBiz)) {
+ msg = "Stage3: status is " + assertionStatusReport.get(i).getCompletionStatus().toString() + " instead of complete";
+ }
+ }
+
+ }
+ } catch (Exception ex) {
ok = false;
- msg = "Stage1: status type mismatch";
- }
+ ex.printStackTrace();
}
- }
- } catch (Exception ex) {
- ok = false;
- ex.printStackTrace();
- }
- //check that sam got the message
-
- try {
- List<AssertionStatusItem> assertionStatusReport = publication.getAssertionStatusReport(authInfoSam, CompletionStatus.STATUS_TO_KEY_INCOMPLETE);
- if (assertionStatusReport.isEmpty()) {
- msg = "Stage2: no result returned, expected at least 1";
- ok = false;
- }
- for (int i = 0; i < assertionStatusReport.size(); i++) {
- JAXB.marshal(assertionStatusReport.get(i), System.out);
- if (assertionStatusReport.get(i).getToKey().equals(samBiz)) {
- if (!assertionStatusReport.get(i).getCompletionStatus().equals(CompletionStatus.STATUS_TO_KEY_INCOMPLETE)) {
+ List<String> biz = new ArrayList<String>();
+ biz.add(samBiz);
+ DeleteBusinesses(biz, authInfoSam, publicationSam);
+
+ biz = new ArrayList<String>();
+ biz.add(joeBiz);
+ DeleteBusinesses(biz, authInfoJoe, publicationJoe);
+ Assert.assertTrue(msg, ok);
+
+
+ }
+
+ /**
+ * setups up a partial relationship and confirms its existence
+ *
+ * @throws Exception
+ */
+ @Test
+ public void JUDDI_590_1() throws Exception {
+ //create two businesses
+ System.out.println("JUDDI_590_1");
+
+ SaveBusiness sb = new SaveBusiness();
+ sb.setAuthInfo(authInfoJoe);
+ BusinessEntity be = new BusinessEntity();
+ Name n = new Name();
+ n.setValue("JUDDI_590 Joe");
+ be.getName().add(n);
+ sb.getBusinessEntity().add(be);
+ String joeBiz = null;
+ try {
+ BusinessDetail saveBusiness = publicationJoe.saveBusiness(sb);
+ joeBiz = saveBusiness.getBusinessEntity().get(0).getBusinessKey();
+ //DeleteBusiness db = new DeleteBusiness();
+ //db.setAuthInfo(authInfoJoe);
+ //db.getBusinessKey().add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
+ //publicationJoe.deleteBusiness(db);
+ //Assert.fail("request should have been rejected");
+ } catch (SOAPFaultException ex) {
+ HandleException(ex);
+ }
+
+ sb = new SaveBusiness();
+ sb.setAuthInfo(authInfoSam);
+ be = new BusinessEntity();
+ n = new Name();
+ n.setValue("JUDDI_590 Sam");
+ be.getName().add(n);
+ sb.getBusinessEntity().add(be);
+ String samBiz = null;
+ try {
+ BusinessDetail saveBusiness = publicationSam.saveBusiness(sb);
+ samBiz = saveBusiness.getBusinessEntity().get(0).getBusinessKey();
+ //DeleteBusiness db = new DeleteBusiness();
+ //db.setAuthInfo(authInfoJoe);
+ //db.getBusinessKey().add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
+ //publicationJoe.deleteBusiness(db);
+ //Assert.fail("request should have been rejected");
+ } catch (SOAPFaultException ex) {
+ HandleException(ex);
+ }
+
+
+ //create an assertion on one end
+ AddPublisherAssertions apa = new AddPublisherAssertions();
+ apa.setAuthInfo(authInfoJoe);
+ apa.getPublisherAssertion().add(new PublisherAssertion());
+ apa.getPublisherAssertion().get(0).setFromKey(joeBiz);
+ apa.getPublisherAssertion().get(0).setToKey(samBiz);
+ KeyedReference kr = new KeyedReference();
+ kr.setKeyName("Subsidiary");
+ kr.setKeyValue("parent-child");
+ kr.setTModelKey("uddi:uddi.org:relationships");
+ apa.getPublisherAssertion().get(0).setKeyedReference(kr);
+ publicationJoe.addPublisherAssertions(apa);
+ //ok so joe has asserted that he knows sam
+
+ //check get status is not null from 1 and from 2
+ boolean ok = true;
+ String msg = "";
+ try {
+ List<AssertionStatusItem> assertionStatusReport = publicationJoe.getAssertionStatusReport(authInfoJoe, CompletionStatus.STATUS_TO_KEY_INCOMPLETE);
+ if (assertionStatusReport.isEmpty()) {
+ msg = "Stage1: no result returned, expected at least 1";
+ ok = false;
+ }
+ for (int i = 0; i < assertionStatusReport.size(); i++) {
+ JAXB.marshal(assertionStatusReport.get(i), System.out);
+ if (assertionStatusReport.get(i).getToKey().equals(samBiz)) {
+ if (!assertionStatusReport.get(i).getCompletionStatus().equals(CompletionStatus.STATUS_TO_KEY_INCOMPLETE)) {
+ ok = false;
+ msg = "Stage1: status type mismatch";
+ }
+ }
+ }
+ } catch (Exception ex) {
ok = false;
- msg = "Stage2: status type mismatch";
- }
+ ex.printStackTrace();
}
- }
- } catch (Exception ex) {
- ok = false;
- ex.printStackTrace();
- }
-
- List<String> biz = new ArrayList<String>();
- biz.add(samBiz);
- DeleteBusinesses(biz, authInfoSam);
-
- biz = new ArrayList<String>();
- biz.add(joeBiz);
- DeleteBusinesses(biz, authInfoJoe);
- Assert.assertTrue(msg, ok);
-
-
- }
-
-
-
-
- private void removeAllExistingSubscriptions(String authinfo) {
- List<Subscription> subscriptions;
- try {
- subscriptions = subscription.getSubscriptions(authinfo);
-
- DeleteSubscription ds = new DeleteSubscription();
- ds.setAuthInfo(authinfo);
- for (int i = 0; i < subscriptions.size(); i++) {
- ds.getSubscriptionKey().add(subscriptions.get(i).getSubscriptionKey());
- }
- if (!subscriptions.isEmpty()) {
- logger.info("Purging " + subscriptions.size() + " old subscriptions");
- subscription.deleteSubscription(ds);
- }
- } catch (Exception ex) {
- logger.warn("error clearing subscriptions", ex);
- }
- }
-
- /**
- * //testing upper case subscription callbacks
- *
- * @throws Exception
- */
- @Test
- public void JIRA_597() throws Exception {
-
- System.out.println("JIRA_597");
-
- int port = 4444;
- String localhostname = java.net.InetAddress.getLocalHost().getHostName();
- UDDISubscriptionListenerImpl impl = new UDDISubscriptionListenerImpl();
- removeAllExistingSubscriptions(authInfoJoe);
- UDDISubscriptionListenerImpl.notifcationMap.clear();
- UDDISubscriptionListenerImpl.notificationCount = 0;
- Endpoint ep = null;
- boolean ok = false;
- do {
- try {
- ep = Endpoint.publish("http://" + localhostname + ":" + port + "/UDDI_CALLBACK", impl);
- ok = true;
- } catch (Exception ex) {
- port++;
- }
- } while (!ok);
- SaveBusiness sb = new SaveBusiness();
- sb.setAuthInfo(authInfoJoe);
[... 1126 lines stripped ...]
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org