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/06 03:18:39 UTC
svn commit: r1555648 [6/13] - in /juddi/trunk: ./ docs/examples/auth/
juddi-client/src/main/java/org/apache/juddi/v3/client/config/
juddi-core-openjpa/ juddi-core/src/main/java/org/apache/juddi/api/impl/
juddi-core/src/main/java/org/apache/juddi/subscr...
Modified: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_010_PublisherIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_010_PublisherIntegrationTest.java?rev=1555648&r1=1555647&r2=1555648&view=diff
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_010_PublisherIntegrationTest.java (original)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_010_PublisherIntegrationTest.java Mon Jan 6 02:18:37 2014
@@ -14,8 +14,6 @@
*/
package org.apache.juddi.v3.tck;
-import static junit.framework.Assert.assertEquals;
-
import java.rmi.RemoteException;
import java.util.List;
@@ -36,6 +34,7 @@ import org.apache.juddi.v3.client.transp
import org.apache.juddi.v3_service.JUDDIApiPortType;
import org.junit.AfterClass;
import org.junit.Assert;
+import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.Test;
import org.uddi.api_v3.AuthToken;
@@ -44,228 +43,246 @@ import org.uddi.v3_service.DispositionRe
import org.uddi.v3_service.UDDISecurityPortType;
/**
+ * jUDDI specific tests
+ *
* @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
*/
public class JUDDI_010_PublisherIntegrationTest {
-
- private static Log logger = LogFactory.getLog(JUDDI_010_PublisherIntegrationTest.class);
- private static UDDIClient manager;
- private static UDDISecurityPortType security =null;
- private static JUDDIApiPortType publisher = null;
- private static String authInfo = null;
-
- @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();
- GetAuthToken getAuthToken = new GetAuthToken();
- getAuthToken.setUserID(TckPublisher.getRootPublisherId());
- getAuthToken.setCred(TckPublisher.getRootPassword());
- authInfo = security.getAuthToken(getAuthToken).getAuthInfo();
-
- publisher = transport.getJUDDIApiService();
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- Assert.fail("Could not obtain authInfo token.");
- }
- }
-
- @AfterClass
- public static void stopManager() throws ConfigurationException {
- manager.stop();
- }
-
- @Test
- public void testAuthToken() {
- try {
- Transport transport = manager.getTransport();
-
- UDDISecurityPortType securityService = transport.getUDDISecurityService();
- GetAuthToken getAuthToken = new GetAuthToken();
- getAuthToken.setUserID("root");
- getAuthToken.setCred("");
- AuthToken authToken = securityService.getAuthToken(getAuthToken);
- System.out.println(authToken.getAuthInfo());
- Assert.assertNotNull(authToken);
- } catch (Exception e) {
- e.printStackTrace();
- Assert.fail();
- }
- }
-
- @Test
- public void testJoePublisher() {
- //We can only test this if the publisher is not there already.
- //If it already there is probably has foreign key relationships.
- //This test should really only run on an empty database. Seed
- //data will be added if the root publisher is missing.
- if (!isExistPublisher(TckPublisher.getJoePublisherId())) {
- saveJoePublisher();
- deleteJoePublisher();
- }
- }
-
- @Test
- public void testSamSyndicator() {
- //We can only test this if the publisher is not there already.
- if (!isExistPublisher(TckPublisher.getSamPublisherId())) {
- saveSamSyndicator();
- deleteSamSyndicator();
- }
- }
-
- @Test
- public void testGetAllPublishers(){
- GetAllPublisherDetail gp = new GetAllPublisherDetail();
- gp.setAuthInfo(authInfo);
- try {
- PublisherDetail publisherDetail = publisher.getAllPublisherDetail(gp);
- Assert.assertTrue(publisherDetail.getPublisher().size() > 1);
- } catch (Exception e) {
- Assert.fail();
- }
- }
-
- /**
- * Persists Joe Publisher to the database.
- * @return - true if the published did not exist already,
- * - false in all other cases.
- */
- public boolean saveJoePublisher() {
- if (!isExistPublisher(TckPublisher.getJoePublisherId())) {
- savePublisher(TckPublisher.getJoePublisherId(), TckPublisher.JOE_PUBLISHER_XML);
- return true;
- } else {
- return false;
- }
- }
- /**
- * Removes Joe Publisher from the database, this will fail if there
- * are child objects attached; think Services etc.
- */
- public void deleteJoePublisher() {
- deletePublisher(TckPublisher.getJoePublisherId());
- }
- /**
- * Persists Sam Syndicator to the database.
- * @return publisherId
- */
- public String saveSamSyndicator() {
- if (!isExistPublisher(TckPublisher.getSamPublisherId())) {
- savePublisher(TckPublisher.getSamPublisherId(), TckPublisher.SAM_SYNDICATOR_XML);
- }
- return TckPublisher.getSamPublisherId();
- }
- /**
- * Removes Sam Syndicator from the database, this will fail if there
- * are child objects attached; think Services etc.
- */
- public void deleteSamSyndicator() {
- deletePublisher(TckPublisher.getSamPublisherId());
- }
-
- private void savePublisher(String publisherId, String publisherXML) {
- try {
- authInfo = TckSecurity.getAuthToken(security, TckPublisher.getRootPublisherId(), TckPublisher.getRootPassword());
- logger.debug("Saving new publisher: " + publisherXML);
- SavePublisher sp = new SavePublisher();
- sp.setAuthInfo(authInfo);
- Publisher pubIn = (Publisher)EntityCreator.buildFromDoc(publisherXML, "org.apache.juddi.api_v3");
- sp.getPublisher().add(pubIn);
- publisher.savePublisher(sp);
-
- // Now get the entity and check the values
- GetPublisherDetail gp = new GetPublisherDetail();
- gp.getPublisherId().add(publisherId);
- gp.setAuthInfo(authInfo);
- PublisherDetail pd = publisher.getPublisherDetail(gp);
- List<Publisher> pubOutList = pd.getPublisher();
- Publisher pubOut = pubOutList.get(0);
-
- assertEquals(pubIn.getAuthorizedName(), pubOut.getAuthorizedName());
- assertEquals(pubIn.getPublisherName(), pubOut.getPublisherName());
- assertEquals(pubIn.getEmailAddress(), pubOut.getEmailAddress());
- assertEquals(pubIn.getIsAdmin(), pubOut.getIsAdmin());
- assertEquals(pubIn.getIsEnabled(), pubOut.getIsEnabled());
- assertEquals(pubIn.getMaxBindingsPerService(), pubOut.getMaxBindingsPerService());
- assertEquals(pubIn.getMaxBusinesses(), pubOut.getMaxBusinesses());
- assertEquals(pubIn.getMaxServicePerBusiness(), pubOut.getMaxServicePerBusiness());
- assertEquals(pubIn.getMaxTModels(), pubOut.getMaxTModels());
-
- logger.debug("Querying for publisher: " + publisherXML);
- //Querying for this publisher to make sure it's really gone
- //We're expecting a invalid Key exception at this point.
- PublisherDetail pdBeforeDelete =null;
- try {
- pdBeforeDelete = publisher.getPublisherDetail(gp);
- Assert.assertNotNull(pdBeforeDelete);
- } catch (Exception e) {
- Assert.fail("We expected to find publisher " + publisherXML);
- }
-
- } catch(Exception e) {
- logger.error(e.getMessage(), e);
- Assert.fail("No exception should be thrown");
- }
- }
-
- private void deletePublisher(String publisherId) {
- try {
- authInfo = TckSecurity.getAuthToken(security, TckPublisher.getRootPublisherId(), TckPublisher.getRootPassword());
- logger.debug("Delete publisher: " + publisherId);
- //Now deleting this publisher
- DeletePublisher dp = new DeletePublisher();
- dp.setAuthInfo(authInfo);
- dp.getPublisherId().add(publisherId);
- publisher.deletePublisher(dp);
-
- logger.info("Querying for publisher: " + publisherId + " after deletion.");
- //Querying for this publisher to make sure it's really gone
- //We're expecting a invalid Key exception at this point.
- GetPublisherDetail gp = new GetPublisherDetail();
- gp.getPublisherId().add(publisherId);
- gp.setAuthInfo(authInfo);
- PublisherDetail pdAfterDelete =null;
- try {
- pdAfterDelete = publisher.getPublisherDetail(gp);
- Assert.fail("We did not expect to find this publisher anymore.");
- //don't think we really want a SOAPFaulException be thrown here.
- } catch (SOAPFaultException e) {
- Assert.assertNull(pdAfterDelete);
- }
-
- } catch(Exception e) {
- logger.error(e.getMessage(), e);
- Assert.fail("No exception should be thrown");
- }
- }
-
- private boolean isExistPublisher(String publisherId) {
- GetPublisherDetail gp = new GetPublisherDetail();
- gp.setAuthInfo(authInfo);
- gp.getPublisherId().add(publisherId);
- try {
- publisher.getPublisherDetail(gp);
- return true;
- } catch (Exception e) {
- return false;
- }
- }
-
- protected String authInfoJoe() throws RemoteException, DispositionReportFaultMessage {
- return TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
- }
-
- protected String authInfoSam() throws RemoteException, DispositionReportFaultMessage {
- return TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
- }
-
+
+ private static Log logger = LogFactory.getLog(JUDDI_010_PublisherIntegrationTest.class);
+ private static UDDIClient manager;
+ private static UDDISecurityPortType security = null;
+ private static JUDDIApiPortType publisher = null;
+ private static String authInfo = null;
+
+ @BeforeClass
+ public static void startManager() throws ConfigurationException {
+ Assume.assumeTrue(TckPublisher.isJUDDI());
+ manager = new UDDIClient();
+ manager.start();
+
+
+ logger.debug("Getting auth tokens..");
+ try {
+ Transport transport = manager.getTransport();
+
+ security = transport.getUDDISecurityService();
+ GetAuthToken getAuthToken = new GetAuthToken();
+ getAuthToken.setUserID(TckPublisher.getRootPublisherId());
+ getAuthToken.setCred(TckPublisher.getRootPassword());
+ authInfo = security.getAuthToken(getAuthToken).getAuthInfo();
+
+ publisher = transport.getJUDDIApiService();
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ Assert.fail("Could not obtain authInfo token.");
+ }
+ }
+
+ @AfterClass
+ public static void stopManager() throws ConfigurationException {
+ manager.stop();
+ }
+
+ @Test
+ public void testAuthToken() {
+ Assume.assumeTrue(TckPublisher.isUDDIAuthMode());
+ try {
+ Transport transport = manager.getTransport();
+
+ UDDISecurityPortType securityService = transport.getUDDISecurityService();
+ GetAuthToken getAuthToken = new GetAuthToken();
+ getAuthToken.setUserID("root");
+ getAuthToken.setCred("");
+ AuthToken authToken = securityService.getAuthToken(getAuthToken);
+ logger.info("don't log auth tokens!!!");
+ Assert.assertNotNull(authToken);
+ } catch (Exception e) {
+ logger.error(e);
+ Assert.fail();
+ }
+ }
+
+ @Test
+ public void testJoePublisher() {
+ Assume.assumeTrue(TckPublisher.isJUDDI());
+ //We can only test this if the publisher is not there already.
+ //If it already there is probably has foreign key relationships.
+ //This test should really only run on an empty database. Seed
+ //data will be added if the root publisher is missing.
+ if (!isExistPublisher(TckPublisher.getJoePublisherId())) {
+ saveJoePublisher();
+ deleteJoePublisher();
+ }
+ }
+
+ @Test
+ public void testSamSyndicator() {
+ Assume.assumeTrue(TckPublisher.isJUDDI());
+ //We can only test this if the publisher is not there already.
+ if (!isExistPublisher(TckPublisher.getSamPublisherId())) {
+ saveSamSyndicator();
+ deleteSamSyndicator();
+ }
+ }
+
+ @Test
+ public void testGetAllPublishers() {
+ Assume.assumeTrue(TckPublisher.isJUDDI());
+ GetAllPublisherDetail gp = new GetAllPublisherDetail();
+ gp.setAuthInfo(authInfo);
+ try {
+ PublisherDetail publisherDetail = publisher.getAllPublisherDetail(gp);
+ Assert.assertTrue(publisherDetail.getPublisher().size() > 1);
+ } catch (Exception e) {
+ logger.error(e);
+ Assert.fail();
+ }
+ }
+
+ /**
+ * Persists Joe Publisher to the database.
+ *
+ * @return - true if the published did not exist already, - false in all
+ * other cases.
+ */
+ public boolean saveJoePublisher() {
+ Assume.assumeTrue(TckPublisher.isJUDDI());
+ if (!isExistPublisher(TckPublisher.getJoePublisherId())) {
+ savePublisher(TckPublisher.getJoePublisherId(), TckPublisher.JOE_PUBLISHER_XML);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Removes Joe Publisher from the database, this will fail if there are
+ * child objects attached; think Services etc.
+ */
+ public void deleteJoePublisher() {
+ Assume.assumeTrue(TckPublisher.isJUDDI());
+ deletePublisher(TckPublisher.getJoePublisherId());
+ }
+
+ /**
+ * Persists Sam Syndicator to the database.
+ *
+ * @return publisherId
+ */
+ public String saveSamSyndicator() {
+ Assume.assumeTrue(TckPublisher.isJUDDI());
+ if (!isExistPublisher(TckPublisher.getSamPublisherId())) {
+ savePublisher(TckPublisher.getSamPublisherId(), TckPublisher.SAM_SYNDICATOR_XML);
+ }
+ return TckPublisher.getSamPublisherId();
+ }
+
+ /**
+ * Removes Sam Syndicator from the database, this will fail if there are
+ * child objects attached; think Services etc.
+ */
+ public void deleteSamSyndicator() {
+ Assume.assumeTrue(TckPublisher.isJUDDI());
+ deletePublisher(TckPublisher.getSamPublisherId());
+ }
+
+ private void savePublisher(String publisherId, String publisherXML) {
+ try {
+ authInfo = TckSecurity.getAuthToken(security, TckPublisher.getRootPublisherId(), TckPublisher.getRootPassword());
+ logger.info("Saving new publisher: " + publisherXML);
+ SavePublisher sp = new SavePublisher();
+ sp.setAuthInfo(authInfo);
+ Publisher pubIn = (Publisher) EntityCreator.buildFromDoc(publisherXML, "org.apache.juddi.api_v3");
+ sp.getPublisher().add(pubIn);
+ publisher.savePublisher(sp);
+
+ // Now get the entity and check the values
+ GetPublisherDetail gp = new GetPublisherDetail();
+ gp.getPublisherId().add(publisherId);
+ gp.setAuthInfo(authInfo);
+ PublisherDetail pd = publisher.getPublisherDetail(gp);
+ List<Publisher> pubOutList = pd.getPublisher();
+ Publisher pubOut = pubOutList.get(0);
+
+ Assert.assertEquals(pubIn.getAuthorizedName(), pubOut.getAuthorizedName());
+ Assert.assertEquals(pubIn.getPublisherName(), pubOut.getPublisherName());
+ Assert.assertEquals(pubIn.getEmailAddress(), pubOut.getEmailAddress());
+ Assert.assertEquals(pubIn.getIsAdmin(), pubOut.getIsAdmin());
+ Assert.assertEquals(pubIn.getIsEnabled(), pubOut.getIsEnabled());
+ Assert.assertEquals(pubIn.getMaxBindingsPerService(), pubOut.getMaxBindingsPerService());
+ Assert.assertEquals(pubIn.getMaxBusinesses(), pubOut.getMaxBusinesses());
+ Assert.assertEquals(pubIn.getMaxServicePerBusiness(), pubOut.getMaxServicePerBusiness());
+ Assert.assertEquals(pubIn.getMaxTModels(), pubOut.getMaxTModels());
+
+ logger.debug("Querying for publisher: " + publisherXML);
+ //Querying for this publisher to make sure it's really gone
+ //We're expecting a invalid Key exception at this point.
+ PublisherDetail pdBeforeDelete = null;
+ try {
+ pdBeforeDelete = publisher.getPublisherDetail(gp);
+ Assert.assertNotNull(pdBeforeDelete);
+ } catch (Exception e) {
+ logger.error(e);
+ Assert.fail("We expected to find publisher " + publisherXML);
+ }
+
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ Assert.fail("No exception should be thrown");
+ }
+ }
+
+ private void deletePublisher(String publisherId) {
+ try {
+ authInfo = TckSecurity.getAuthToken(security, TckPublisher.getRootPublisherId(), TckPublisher.getRootPassword());
+ logger.debug("Delete publisher: " + publisherId);
+ //Now deleting this publisher
+ DeletePublisher dp = new DeletePublisher();
+ dp.setAuthInfo(authInfo);
+ dp.getPublisherId().add(publisherId);
+ publisher.deletePublisher(dp);
+
+ logger.info("Querying for publisher: " + publisherId + " after deletion.");
+ //Querying for this publisher to make sure it's really gone
+ //We're expecting a invalid Key exception at this point.
+ GetPublisherDetail gp = new GetPublisherDetail();
+ gp.getPublisherId().add(publisherId);
+ gp.setAuthInfo(authInfo);
+ PublisherDetail pdAfterDelete = null;
+ try {
+ pdAfterDelete = publisher.getPublisherDetail(gp);
+ Assert.fail("We did not expect to find this publisher anymore.");
+ //don't think we really want a SOAPFaulException be thrown here.
+ } catch (SOAPFaultException e) {
+ Assert.assertNull(pdAfterDelete);
+ }
+
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ Assert.fail("No exception should be thrown");
+ }
+ }
+
+ private boolean isExistPublisher(String publisherId) {
+ GetPublisherDetail gp = new GetPublisherDetail();
+ gp.setAuthInfo(authInfo);
+ gp.getPublisherId().add(publisherId);
+ try {
+ publisher.getPublisherDetail(gp);
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ protected String authInfoJoe() throws RemoteException, DispositionReportFaultMessage {
+ return TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+ }
+
+ protected String authInfoSam() throws RemoteException, DispositionReportFaultMessage {
+ return TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
+ }
+
}
Modified: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_091_RMISubscriptionListenerIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_091_RMISubscriptionListenerIntegrationTest.java?rev=1555648&r1=1555647&r2=1555648&view=diff
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_091_RMISubscriptionListenerIntegrationTest.java (original)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_091_RMISubscriptionListenerIntegrationTest.java Mon Jan 6 02:18:37 2014
@@ -14,11 +14,13 @@ package org.apache.juddi.v3.tck;
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+import java.net.InetAddress;
import java.net.URI;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
+import java.util.Iterator;
import java.util.Random;
+import javax.xml.ws.BindingProvider;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.logging.Log;
@@ -27,6 +29,7 @@ import org.apache.juddi.v3.client.config
import org.apache.juddi.v3.client.transport.Transport;
import org.junit.AfterClass;
import org.junit.Assert;
+import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.Test;
import org.uddi.v3_service.UDDIInquiryPortType;
@@ -35,125 +38,143 @@ import org.uddi.v3_service.UDDISecurityP
import org.uddi.v3_service.UDDISubscriptionPortType;
/**
+ * jUDDI specific test
+ *
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
* @author <a href="mailto:tcunning@apache.org">Tom Cunningham</a>
*/
-public class JUDDI_091_RMISubscriptionListenerIntegrationTest
-{
- private static Log logger = LogFactory.getLog(JUDDI_091_RMISubscriptionListenerIntegrationTest.class);
-
- private static TckTModel tckTModel = null;
- private static TckBusiness tckBusiness = null;
- private static TckBusinessService tckBusinessService = null;
- private static TckSubscriptionListenerRMI rmiSubscriptionListener = null;
-
- private static String authInfoJoe = null;
- private static UDDIClient manager;
- private static UDDISubscriptionListenerImpl rmiSubscriptionListenerService = null;
- private static Registry registry;
- private static Integer randomPort = null;
-
- @AfterClass
- public static void stopManager() throws ConfigurationException {
- manager.stop();
- //shutting down the TCK SubscriptionListener
- //re
- }
-
- @BeforeClass
- public static void startManager() throws ConfigurationException {
-
- try {
- //bring up the RMISubscriptionListener
- //random port
- randomPort = 19800 + new Random().nextInt(99);
- System.out.println("RMI Random port=" + randomPort);
- //bring up the RMISubscriptionListener
- URI rmiEndPoint = new URI("rmi://localhost:" + randomPort + "/tck/rmisubscriptionlistener");
- registry = LocateRegistry.createRegistry(rmiEndPoint.getPort());
- String path = rmiEndPoint.getPath();
-
- //starting the service
- rmiSubscriptionListenerService = new UDDISubscriptionListenerImpl(0);
- //binding to the RMI Registry
- registry.bind(path,rmiSubscriptionListenerService);
-
- //double check that the service is bound in the local Registry
- Registry registry2 = LocateRegistry.getRegistry(rmiEndPoint.getHost(), rmiEndPoint.getPort());
- registry2.lookup(rmiEndPoint.getPath());
-
-
- } catch (Exception e2) {
- // TODO Auto-generated catch block
- e2.printStackTrace();
- Assert.fail();
- }
-
- manager = new UDDIClient();
- manager.start();
-
- logger.debug("Getting auth tokens..");
- try {
-
- Transport transport = manager.getTransport();
- UDDISecurityPortType security = transport.getUDDISecurityService();
- authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
- Assert.assertNotNull(authInfoJoe);
- UDDISubscriptionPortType subscription = transport.getUDDISubscriptionService();
-
- UDDIPublicationPortType publication = transport.getUDDIPublishService();
- UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
- tckTModel = new TckTModel(publication, inquiry);
- tckBusiness = new TckBusiness(publication, inquiry);
- tckBusinessService = new TckBusinessService(publication, inquiry);
- rmiSubscriptionListener = new TckSubscriptionListenerRMI(subscription, publication);
-
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- Assert.fail("Could not obtain authInfo token.");
- }
- }
-
- @Test
- public void joePublisher() {
- try {
- tckTModel.saveJoePublisherTmodel(authInfoJoe);
- tckBusiness.saveJoePublisherBusiness(authInfoJoe);
- tckBusinessService.saveJoePublisherService(authInfoJoe);
- rmiSubscriptionListener.saveService(authInfoJoe, TckSubscriptionListener.LISTENER_RMI_SERVICE_XML, randomPort);
-
- rmiSubscriptionListener.saveNotifierSubscription(authInfoJoe, TckSubscriptionListenerRMI.SUBSCRIPTION_XML_RMI);
-
- tckBusinessService.updateJoePublisherService(authInfoJoe, "foo");
-
- //waiting up to 100 seconds for the listener to notice the change.
- String test="";
- for (int i=0; i<200; i++) {
- Thread.sleep(500);
- System.out.print(".");
- if (UDDISubscriptionListenerImpl.notificationCount > 0) {
- break;
- } else {
- System.out.print(test);
- }
- }
- if (UDDISubscriptionListenerImpl.notificationCount == 0) {
- Assert.fail("No Notification was sent");
- }
- if (!UDDISubscriptionListenerImpl.notifcationMap.get(0).contains("<name xml:lang=\"en\">Service One</name>")) {
- Assert.fail("Notification does not contain the correct service");
- }
-
- } catch (Exception e) {
- e.printStackTrace();
-
- Assert.fail();
- } finally {
-
- rmiSubscriptionListener.deleteNotifierSubscription(authInfoJoe, TckSubscriptionListenerRMI.SUBSCRIPTION_KEY_RMI);
- tckBusinessService.deleteJoePublisherService(authInfoJoe);
- tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
- tckTModel.deleteJoePublisherTmodel(authInfoJoe);
- }
- }
-
+public class JUDDI_091_RMISubscriptionListenerIntegrationTest {
+
+ private static Log logger = LogFactory.getLog(JUDDI_091_RMISubscriptionListenerIntegrationTest.class);
+ private static TckTModel tckTModel = null;
+ private static TckBusiness tckBusiness = null;
+ private static TckBusinessService tckBusinessService = null;
+ private static TckSubscriptionListenerRMI rmiSubscriptionListener = null;
+ private static String authInfoJoe = null;
+ private static String hostname = null;
+ private static UDDIClient manager;
+ private static UDDISubscriptionListenerImpl rmiSubscriptionListenerService = null;
+ private static Registry registry;
+ private static Integer randomPort = null;
+
+ @AfterClass
+ public static void stopManager() throws ConfigurationException {
+ manager.stop();
+ //shutting down the TCK SubscriptionListener
+ //re
+ }
+
+ @BeforeClass
+ public static void startManager() throws ConfigurationException {
+
+ try {
+ //bring up the RMISubscriptionListener
+ //random port
+ randomPort = 19800 + new Random().nextInt(99);
+ System.out.println("RMI Random port=" + randomPort);
+ //bring up the RMISubscriptionListener
+ URI rmiEndPoint = new URI("rmi://localhost:" + randomPort + "/tck/rmisubscriptionlistener");
+ registry = LocateRegistry.createRegistry(rmiEndPoint.getPort());
+ String path = rmiEndPoint.getPath();
+ hostname = InetAddress.getLocalHost().getHostName();
+ //starting the service
+ rmiSubscriptionListenerService = new UDDISubscriptionListenerImpl(0);
+ //binding to the RMI Registry
+ registry.bind(path, rmiSubscriptionListenerService);
+
+ //double check that the service is bound in the local Registry
+ Registry registry2 = LocateRegistry.getRegistry(rmiEndPoint.getHost(), rmiEndPoint.getPort());
+ registry2.lookup(rmiEndPoint.getPath());
+
+
+ } catch (Exception e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ Assert.fail();
+ }
+
+ manager = new UDDIClient();
+ manager.start();
+
+ logger.debug("Getting auth tokens..");
+ try {
+
+ Transport transport = manager.getTransport();
+ UDDISecurityPortType security = transport.getUDDISecurityService();
+ authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+
+
+ UDDISubscriptionPortType subscription = transport.getUDDISubscriptionService();
+ UDDIPublicationPortType publication = transport.getUDDIPublishService();
+ UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
+
+ tckTModel = new TckTModel(publication, inquiry);
+ tckBusiness = new TckBusiness(publication, inquiry);
+ tckBusinessService = new TckBusinessService(publication, inquiry);
+ rmiSubscriptionListener = new TckSubscriptionListenerRMI(subscription, publication);
+
+ if (!TckPublisher.isUDDIAuthMode()) {
+ TckSecurity.setCredentials((BindingProvider) publication, TckPublisher.getRootPublisherId(), TckPublisher.getRootPassword());
+ TckSecurity.setCredentials((BindingProvider) subscription, TckPublisher.getRootPublisherId(), TckPublisher.getRootPassword());
+ TckSecurity.setCredentials((BindingProvider) inquiry, TckPublisher.getRootPublisherId(), TckPublisher.getRootPassword());
+ }
+
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ Assert.fail("Could not obtain authInfo token.");
+ }
+ }
+
+ @Test
+ public void joePublisher() {
+ Assume.assumeTrue(TckPublisher.isRMI());
+ Assume.assumeTrue(TckPublisher.isSubscriptionEnabled());
+ try {
+ UDDISubscriptionListenerImpl.notifcationMap.clear();
+ UDDISubscriptionListenerImpl.notificationCount=0;
+ tckTModel.saveJoePublisherTmodel(authInfoJoe);
+ tckBusiness.saveJoePublisherBusiness(authInfoJoe);
+ tckBusinessService.saveJoePublisherService(authInfoJoe);
+ rmiSubscriptionListener.saveService(authInfoJoe, TckSubscriptionListener.LISTENER_RMI_SERVICE_XML, randomPort, hostname);
+
+ rmiSubscriptionListener.saveNotifierSubscription(authInfoJoe, TckSubscriptionListenerRMI.SUBSCRIPTION_XML_RMI);
+
+ tckBusinessService.updateJoePublisherService(authInfoJoe, "foo");
+
+ //waiting up to 100 seconds for the listener to notice the change.
+
+ for (int i = 0; i < 60; i++) {
+ Thread.sleep(1000);
+
+ if (UDDISubscriptionListenerImpl.notificationCount > 0) {
+ break;
+ }
+ }
+ if (UDDISubscriptionListenerImpl.notificationCount == 0) {
+ Assert.fail("No Notification was sent");
+ }
+ Iterator<String> it = UDDISubscriptionListenerImpl.notifcationMap.values().iterator();
+ boolean found=false;
+ while (it.hasNext()){
+ String test = it.next();
+ if (test.toLowerCase().contains("service one"))
+ found = true;
+ }
+ if (!found){
+ //if (!UDDISubscriptionListenerImpl.notifcationMap.get(0).contains("<name xml:lang=\"en\">Service One</name>")) {
+ Assert.fail("Notification does not contain the correct service");
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ Assert.fail();
+ } finally {
+
+ rmiSubscriptionListener.deleteNotifierSubscription(authInfoJoe, TckSubscriptionListenerRMI.SUBSCRIPTION_KEY_RMI);
+ tckBusinessService.deleteJoePublisherService(authInfoJoe);
+ tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
+ tckTModel.deleteJoePublisherTmodel(authInfoJoe);
+ }
+ }
}
Added: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_100_ClientSubscriptionInfoIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_100_ClientSubscriptionInfoIntegrationTest.java?rev=1555648&view=auto
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_100_ClientSubscriptionInfoIntegrationTest.java (added)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_100_ClientSubscriptionInfoIntegrationTest.java Mon Jan 6 02:18:37 2014
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2001-2009 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juddi.v3.tck;
+
+import javax.xml.ws.BindingProvider;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.juddi.api_v3.Clerk;
+import org.apache.juddi.api_v3.ClientSubscriptionInfo;
+import org.apache.juddi.api_v3.ClientSubscriptionInfoDetail;
+import org.apache.juddi.api_v3.DeleteClientSubscriptionInfo;
+import org.apache.juddi.api_v3.Node;
+import org.apache.juddi.api_v3.SaveClerk;
+import org.apache.juddi.api_v3.SaveClientSubscriptionInfo;
+import org.apache.juddi.api_v3.SaveNode;
+import org.apache.juddi.v3.client.config.UDDIClient;
+import org.apache.juddi.v3.client.transport.Transport;
+import org.apache.juddi.v3_service.JUDDIApiPortType;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.uddi.v3_service.UDDISecurityPortType;
+
+/**
+ * jUDDI specific tests
+ *
+ * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
+ */
+public class JUDDI_100_ClientSubscriptionInfoIntegrationTest {
+
+ private static UDDISecurityPortType security = null;
+ private static JUDDIApiPortType publisher = null;
+ private static Log logger = LogFactory.getLog(JUDDI_100_ClientSubscriptionInfoIntegrationTest.class);
+ private static String authInfo = null;
+ private static UDDIClient manager;
+
+ @BeforeClass
+ public static void startRegistry() throws ConfigurationException {
+
+ manager = new UDDIClient();
+ manager.start();
+
+
+ logger.debug("Getting auth tokens..");
+ try {
+ Transport transport = manager.getTransport();
+
+ security = transport.getUDDISecurityService();
+ authInfo = TckSecurity.getAuthToken(security, TckPublisher.getRootPublisherId(), TckPublisher.getRootPassword());
+
+ publisher = transport.getJUDDIApiService();
+ if (!TckPublisher.isUDDIAuthMode()) {
+ TckSecurity.setCredentials((BindingProvider) publisher, TckPublisher.getRootPublisherId(), TckPublisher.getRootPassword());
+ }
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ Assert.fail("Could not obtain authInfo token.");
+ }
+ }
+
+ @AfterClass
+ public static void stopRegistry() throws ConfigurationException {
+ manager.stop();
+ }
+
+ @Test
+ public void addClientSubscriptionInfo() throws Exception {
+ Assume.assumeTrue(TckPublisher.isJUDDI());
+
+ ClientSubscriptionInfo clientSubscriptionInfo = new ClientSubscriptionInfo();
+
+ Node node = new Node();
+ node.setSecurityUrl("http://localhost:8080/services");
+ node.setCustodyTransferUrl("http://localhost:8080/services");
+ node.setDescription("TEST");
+ node.setInquiryUrl("http://localhost:8080/services");
+ node.setPublishUrl("http://localhost:8080/services");
+ node.setSubscriptionListenerUrl("http://localhost:8080/services");
+ node.setSubscriptionUrl("http://localhost:8080/services");
+ node.setProxyTransport(org.apache.juddi.v3.client.transport.JAXWSTransport.class.getCanonicalName());
+
+ node.setName("addClientSubscriptionInfoNode");
+ node.setClientName("addClientSubscriptionInfoNode");
+
+ Clerk clerk = new Clerk();
+ clerk.setName("addClientSubscriptionInfoClerk");
+ clerk.setPublisher("root");
+ clerk.setNode(node);
+
+ Clerk toClerk = new Clerk();
+ toClerk.setName("addClientSubscriptionInfoClerk2");
+ toClerk.setPublisher("root");
+ toClerk.setNode(node);
+
+ clientSubscriptionInfo.setFromClerk(clerk);
+ clientSubscriptionInfo.setToClerk(toClerk);
+
+ clientSubscriptionInfo.setSubscriptionKey("mykey");
+
+ SaveClientSubscriptionInfo saveClientSubscriptionInfo = new SaveClientSubscriptionInfo();
+ saveClientSubscriptionInfo.setAuthInfo(authInfo);
+ saveClientSubscriptionInfo.getClientSubscriptionInfo().add(clientSubscriptionInfo);
+
+ try {
+ SaveNode sni = new SaveNode();
+ sni.setAuthInfo(authInfo);
+ sni.getNode().add(node);
+ publisher.saveNode(sni);
+
+ saveClerk(clerk);
+ saveClerk(toClerk);
+ ClientSubscriptionInfoDetail detail = publisher.saveClientSubscriptionInfo(saveClientSubscriptionInfo);
+
+ Assert.assertEquals("mykey", detail.getClientSubscriptionInfo().get(0).getSubscriptionKey());
+
+ DeleteClientSubscriptionInfo deleteInfo = new DeleteClientSubscriptionInfo();
+ deleteInfo.setAuthInfo(authInfo);
+ deleteInfo.getSubscriptionKey().add("mykey");
+ publisher.deleteClientSubscriptionInfo(deleteInfo);
+
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ Assert.fail("No exception should be thrown");
+ }
+ }
+
+
+
+ private Clerk saveClerk(Clerk clerk) throws Exception {
+ SaveClerk saveClerkInfo = new SaveClerk();
+ saveClerkInfo.setAuthInfo(authInfo);
+
+ saveClerkInfo.getClerk().add(clerk);
+ return publisher.saveClerk(saveClerkInfo).getClerk().get(0);
+ }
+}
Modified: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_010_PublisherIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_010_PublisherIntegrationTest.java?rev=1555648&r1=1555647&r2=1555648&view=diff
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_010_PublisherIntegrationTest.java (original)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_010_PublisherIntegrationTest.java Mon Jan 6 02:18:37 2014
@@ -19,6 +19,7 @@ import org.apache.juddi.v3.client.config
import org.apache.juddi.v3.client.transport.Transport;
import org.junit.AfterClass;
import org.junit.Assert;
+import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.Test;
import org.uddi.api_v3.AuthToken;
@@ -27,6 +28,7 @@ import org.uddi.v3_service.UDDISecurityP
/**
* @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
*/
public class UDDI_010_PublisherIntegrationTest {
@@ -45,6 +47,7 @@ public class UDDI_010_PublisherIntegrati
@Test
public void testAuthToken() {
+ Assume.assumeTrue(TckPublisher.isUDDIAuthMode());
try {
Transport transport = manager.getTransport();
UDDISecurityPortType securityService = transport.getUDDISecurityService();
@@ -52,7 +55,7 @@ public class UDDI_010_PublisherIntegrati
getAuthToken.setUserID(TckPublisher.getRootPublisherId());
getAuthToken.setCred(TckPublisher.getRootPassword());
AuthToken authToken = securityService.getAuthToken(getAuthToken);
- System.out.println(authToken.getAuthInfo());
+ System.out.println("Don't log auth tokens!");
Assert.assertNotNull(authToken);
} catch (Exception e) {
e.printStackTrace();
Modified: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_020_TmodelIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_020_TmodelIntegrationTest.java?rev=1555648&r1=1555647&r2=1555648&view=diff
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_020_TmodelIntegrationTest.java (original)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_020_TmodelIntegrationTest.java Mon Jan 6 02:18:37 2014
@@ -14,11 +14,13 @@
*/
package org.apache.juddi.v3.tck;
+import javax.xml.ws.BindingProvider;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.juddi.v3.client.config.UDDIClient;
import org.apache.juddi.v3.client.transport.Transport;
+import static org.apache.juddi.v3.tck.UDDI_040_BusinessServiceIntegrationTest.tckTModelJoe;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -33,77 +35,91 @@ import org.uddi.v3_service.UDDISecurityP
/**
* @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
* @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
*/
public class UDDI_020_TmodelIntegrationTest {
-
- private static TckTModel tckTModel = null;
- private static Log logger = LogFactory.getLog(UDDI_020_TmodelIntegrationTest.class);
-
- private static String authInfoJoe = null;
- private static String authInfoSam = null;
-
-private static UDDIClient manager;
-
-
- @BeforeClass
- public static void startManager() throws ConfigurationException {
-
- manager = new UDDIClient();
- manager.start();
- logger.debug("Getting auth tokens..");
- try {
- Transport transport = manager.getTransport();
-
- UDDISecurityPortType security = transport.getUDDISecurityService();
- authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
- authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
- Assert.assertNotNull(authInfoJoe);
- Assert.assertNotNull(authInfoSam);
-
- UDDIPublicationPortType publication = transport.getUDDIPublishService();
- UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
- tckTModel = new TckTModel(publication, inquiry);
-
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- Assert.fail("Could not obtain authInfo token.");
- }
- }
-
- @AfterClass
- public static void stopManager() throws ConfigurationException {
- manager.stop();
- }
-
- @Test
- public void testJoePublisherTmodel() {
- tckTModel.saveJoePublisherTmodel(authInfoJoe);
-
- //Now if we use a finder it should be found.
- TModelList tModelList = tckTModel.findJoeTModelDetail();
- Assert.assertNotNull(tModelList.getTModelInfos());
-
- tckTModel.deleteJoePublisherTmodel(authInfoJoe);
-
- //Even if it deleted you should still be able to access it through a getTModelDetail
- TModelDetail detail = tckTModel.getJoePublisherTmodel(authInfoJoe);
- Assert.assertNotNull(detail.getTModel());
-
- //However if we use a finder it should not be found.
- TModelList tModelList2 = tckTModel.findJoeTModelDetail();
- Assert.assertNull(tModelList2.getTModelInfos());
-
- //Make sure none of the found key generators is Joe's key generator
- TModelList tModelList3 = tckTModel.findJoeTModelDetailByCategoryBag();
- for (TModelInfo tModelInfo : tModelList3.getTModelInfos().getTModelInfo()) {
- Assert.assertFalse("uddi:uddi.joepublisher.com:keygenerator".equals(tModelInfo.getTModelKey()));
- }
- }
-
- @Test
- public void testSamSyndicatorTmodelTest() {
- tckTModel.saveSamSyndicatorTmodel(authInfoSam);
- tckTModel.deleteSamSyndicatorTmodel(authInfoSam);
- }
-
+
+ private static TckTModel tckTModelJoe = null;
+ private static TckTModel tckTModelSam = null;
+ private static Log logger = LogFactory.getLog(UDDI_020_TmodelIntegrationTest.class);
+ private static String authInfoJoe = null;
+ private static String authInfoSam = null;
+ private static UDDIClient manager;
+
+ @BeforeClass
+ public static void startManager() throws ConfigurationException {
+
+ manager = new UDDIClient();
+ manager.start();
+ logger.debug("Getting auth tokens..");
+ try {
+ Transport transport = manager.getTransport();
+
+ UDDISecurityPortType security = transport.getUDDISecurityService();
+ authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+ authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
+ //Assert.assertNotNull(authInfoJoe);
+ //Assert.assertNotNull(authInfoSam);
+
+
+ UDDIPublicationPortType publication = transport.getUDDIPublishService();
+ UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
+ if (!TckPublisher.isUDDIAuthMode()) {
+ TckSecurity.setCredentials((BindingProvider) publication, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+ TckSecurity.setCredentials((BindingProvider) inquiry, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+ }
+ tckTModelJoe = new TckTModel(publication, inquiry);
+
+ transport = manager.getTransport();
+ publication = transport.getUDDIPublishService();
+ inquiry = transport.getUDDIInquiryService();
+ if (!TckPublisher.isUDDIAuthMode()) {
+ TckSecurity.setCredentials((BindingProvider) publication, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
+ TckSecurity.setCredentials((BindingProvider) inquiry, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
+ }
+ tckTModelSam = new TckTModel(publication, inquiry);
+
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ Assert.fail("Could not obtain authInfo token.");
+ }
+ }
+
+ @AfterClass
+ public static void stopManager() throws ConfigurationException {
+ tckTModelJoe.deleteCreatedTModels(authInfoJoe);
+ tckTModelSam.deleteCreatedTModels(authInfoSam);
+ manager.stop();
+ }
+
+ @Test
+ public void testJoePublisherTmodel() {
+ tckTModelJoe.saveJoePublisherTmodel(authInfoJoe, true);
+
+ //Now if we use a finder it should be found.
+ TModelList tModelList = tckTModelJoe.findJoeTModelDetail();
+ Assert.assertNotNull(tModelList.getTModelInfos());
+
+ tckTModelJoe.deleteJoePublisherTmodel(authInfoJoe);
+
+ //Even if it deleted you should still be able to access it through a getTModelDetail
+ TModelDetail detail = tckTModelJoe.getJoePublisherTmodel(authInfoJoe);
+ Assert.assertNotNull(detail.getTModel());
+
+ //However if we use a finder it should not be found.
+ TModelList tModelList2 = tckTModelJoe.findJoeTModelDetail();
+ Assert.assertNull(tModelList2.getTModelInfos());
+
+ //Make sure none of the found key generators is Joe's key generator
+ TModelList tModelList3 = tckTModelJoe.findJoeTModelDetailByCategoryBag();
+ for (TModelInfo tModelInfo : tModelList3.getTModelInfos().getTModelInfo()) {
+ Assert.assertFalse("uddi:uddi.joepublisher.com:keygenerator".equals(tModelInfo.getTModelKey()));
+ }
+ }
+
+ @Test
+ public void testSamSyndicatorTmodelTest() {
+ tckTModelSam.saveSamSyndicatorTmodel(authInfoSam);
+ tckTModelSam.deleteSamSyndicatorTmodel(authInfoSam);
+ }
}
Modified: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_030_BusinessEntityIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_030_BusinessEntityIntegrationTest.java?rev=1555648&r1=1555647&r2=1555648&view=diff
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_030_BusinessEntityIntegrationTest.java (original)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_030_BusinessEntityIntegrationTest.java Mon Jan 6 02:18:37 2014
@@ -14,6 +14,7 @@
*/
package org.apache.juddi.v3.tck;
+import javax.xml.ws.BindingProvider;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -30,85 +31,119 @@ import org.uddi.v3_service.UDDISecurityP
/**
* @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
* @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
*/
public class UDDI_030_BusinessEntityIntegrationTest {
-
- private static Log logger = LogFactory.getLog(UDDI_030_BusinessEntityIntegrationTest.class);
-
- protected static TckTModel tckTModel = null;
- protected static TckBusiness tckBusiness = null;
- protected static TckFindEntity tckFindEntity = null;
- protected static String authInfoJoe = null;
- protected static String authInfoSam = null;
- private static UDDIClient manager;
-
- @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();
- UDDISecurityPortType security = transport.getUDDISecurityService();
- authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
- authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
- Assert.assertNotNull(authInfoJoe);
- Assert.assertNotNull(authInfoSam);
-
- UDDIPublicationPortType publication = transport.getUDDIPublishService();
- UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
- tckTModel = new TckTModel(publication, inquiry);
- tckBusiness = new TckBusiness(publication, inquiry);
- tckFindEntity = new TckFindEntity(inquiry);
- String authInfoUDDI = TckSecurity.getAuthToken(security, TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword());
- tckTModel.saveUDDIPublisherTmodel(authInfoUDDI);
- tckTModel.saveTModels(authInfoUDDI, TckTModel.TMODELS_XML);
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- Assert.fail("Could not obtain authInfo token.");
- }
- }
-
- @Test
- public void testJoePublisherBusinessEntitySignature() {
- try {
- tckTModel.saveJoePublisherTmodel(authInfoJoe);
- tckBusiness.saveJoePublisherBusinessX509Signature(authInfoJoe);
- tckFindEntity.findAllBusiness();
- tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
- } finally {
- tckTModel.deleteJoePublisherTmodel(authInfoJoe);
- }
- }
-
- @Test
- public void testJoePublisherBusinessEntity() {
- try {
- tckTModel.saveJoePublisherTmodel(authInfoJoe);
- tckBusiness.saveJoePublisherBusiness(authInfoJoe);
- tckFindEntity.findAllBusiness();
- tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
- } finally {
- tckTModel.deleteJoePublisherTmodel(authInfoJoe);
- }
- }
-
- @Test
- public void testSamSyndicatorBusiness() {
- try {
- tckTModel.saveSamSyndicatorTmodel(authInfoSam);
- tckBusiness.saveSamSyndicatorBusiness(authInfoSam);
- tckBusiness.deleteSamSyndicatorBusiness(authInfoSam);
- } finally {
- tckTModel.deleteSamSyndicatorTmodel(authInfoSam);
- }
- }
-
-
+
+ protected static Log logger = LogFactory.getLog(UDDI_030_BusinessEntityIntegrationTest.class);
+ protected static TckTModel tckTModelJoe = null;
+ protected static TckBusiness tckBusinessJoe = null;
+ protected static TckFindEntity tckFindEntityJoe = null;
+ protected static TckTModel tckTModelSam = null;
+ protected static TckBusiness tckBusinessSam = null;
+ protected static TckFindEntity tckFindEntitySam = null;
+ protected static UDDIInquiryPortType inquiryJoe = null;
+ protected static UDDIInquiryPortType inquirySam = null;
+ protected static String authInfoJoe = null;
+ protected static String authInfoSam = null;
+ private static UDDIClient manager;
+
+ @AfterClass
+ public static void stopManager() throws ConfigurationException {
+ tckTModelJoe.deleteCreatedTModels(authInfoJoe);
+ tckTModelSam.deleteCreatedTModels(authInfoSam);
+ manager.stop();
+ }
+
+ @BeforeClass
+ public static void startManager() throws ConfigurationException {
+ manager = new UDDIClient();
+ manager.start();
+ logger.info("UDDI_030_BusinessEntityIntegrationTest");
+ logger.debug("Getting auth tokens..");
+ try {
+ Transport transport = manager.getTransport();
+ UDDISecurityPortType security = transport.getUDDISecurityService();
+
+ authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+ authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
+ //Assert.assertNotNull(authInfoJoe);
+ //Assert.assertNotNull(authInfoSam);
+
+ UDDIPublicationPortType publication = transport.getUDDIPublishService();
+ UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
+ if (!TckPublisher.isUDDIAuthMode()) {
+ TckSecurity.setCredentials((BindingProvider) publication, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+ TckSecurity.setCredentials((BindingProvider) inquiry, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+ }
+ tckTModelJoe = new TckTModel(publication, inquiry);
+ tckBusinessJoe = new TckBusiness(publication, inquiry);
+ tckFindEntityJoe = new TckFindEntity(inquiry);
+ inquiryJoe = inquiry;
+
+ transport = manager.getTransport();
+ publication = transport.getUDDIPublishService();
+ inquiry = transport.getUDDIInquiryService();
+ if (!TckPublisher.isUDDIAuthMode()) {
+ TckSecurity.setCredentials((BindingProvider) publication, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
+ TckSecurity.setCredentials((BindingProvider) inquiry, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
+ }
+ tckTModelSam = new TckTModel(publication, inquiry);
+ tckBusinessSam = new TckBusiness(publication, inquiry);
+ tckFindEntitySam = new TckFindEntity(inquiry);
+ inquirySam = inquiry;
+
+ String authInfoUDDI = TckSecurity.getAuthToken(security, TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword());
+ transport = manager.getTransport();
+ publication = transport.getUDDIPublishService();
+ inquiry = transport.getUDDIInquiryService();
+ if (!TckPublisher.isUDDIAuthMode()) {
+ TckSecurity.setCredentials((BindingProvider) publication, TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword());
+ TckSecurity.setCredentials((BindingProvider) inquiry, TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword());
+ }
+ TckTModel tckTModelUddi = new TckTModel(publication, inquiry);
+ tckTModelUddi.saveUDDIPublisherTmodel(authInfoUDDI);
+ tckTModelUddi.saveTModels(authInfoUDDI, TckTModel.TMODELS_XML);
+
+
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ Assert.fail("Could not obtain authInfo token.");
+ }
+ }
+
+ @Test
+ public void testJoePublisherBusinessEntitySignature() {
+ try {
+ tckTModelJoe.saveJoePublisherTmodel(authInfoJoe);
+ tckBusinessJoe.saveJoePublisherBusinessX509Signature(authInfoJoe);
+ tckFindEntityJoe.findAllBusiness();
+ tckBusinessJoe.deleteJoePublisherBusiness(authInfoJoe);
+ } finally {
+ tckTModelJoe.deleteJoePublisherTmodel(authInfoJoe);
+ }
+ }
+
+ @Test
+ public void testJoePublisherBusinessEntity() throws Exception{
+ try {
+ tckTModelJoe.saveJoePublisherTmodel(authInfoJoe);
+ tckBusinessJoe.saveJoePublisherBusiness(authInfoJoe);
+ tckFindEntityJoe.findAllBusiness();
+ tckBusinessJoe.deleteJoePublisherBusiness(authInfoJoe);
+ } finally {
+ tckTModelJoe.deleteJoePublisherTmodel(authInfoJoe);
+ }
+ }
+
+ @Test
+ public void testSamSyndicatorBusiness() throws Exception{
+ try {
+ tckTModelSam.saveSamSyndicatorTmodel(authInfoSam);
+ tckBusinessSam.saveSamSyndicatorBusiness(authInfoSam);
+ tckBusinessSam.deleteSamSyndicatorBusiness(authInfoSam);
+ } finally {
+ tckTModelSam.deleteSamSyndicatorTmodel(authInfoSam);
+ }
+ }
}
Added: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_030_BusinessEntityLoadIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_030_BusinessEntityLoadIntegrationTest.java?rev=1555648&view=auto
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_030_BusinessEntityLoadIntegrationTest.java (added)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_030_BusinessEntityLoadIntegrationTest.java Mon Jan 6 02:18:37 2014
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2001-2009 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juddi.v3.tck;
+
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.juddi.v3.client.UDDIConstants;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.uddi.api_v3.FindBusiness;
+import org.uddi.api_v3.FindQualifiers;
+import org.uddi.api_v3.Name;
+
+/**
+ * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
+ */
+public class UDDI_030_BusinessEntityLoadIntegrationTest extends UDDI_030_BusinessEntityIntegrationTest {
+
+ int numberOfBusinesses = 1100;
+
+ @BeforeClass
+ public static void setup() throws ConfigurationException {
+ UDDI_030_BusinessEntityIntegrationTest.startManager();
+ }
+
+ @Test
+ @Override
+ public void testJoePublisherBusinessEntity() throws Exception {
+ Assume.assumeTrue(TckPublisher.isLoadTest());
+
+ numberOfBusinesses = TckPublisher.getMaxLoadServices();
+ logger.info("UDDI_030_BusinessEntityLoadIntegrationTest testJoePublisherBusinessEntity Load test " + numberOfBusinesses);
+ tckTModelJoe.saveJoePublisherTmodel(authInfoJoe);
+ long startSave = System.currentTimeMillis();
+ tckBusinessJoe.saveJoePublisherBusinesses(authInfoJoe, numberOfBusinesses);
+ long saveDuration = System.currentTimeMillis() - startSave;
+ System.out.println("****************** Save " + numberOfBusinesses + " Joes Duration=" + saveDuration);
+
+ long startFind = System.currentTimeMillis();
+ FindBusiness fs = new FindBusiness();
+ fs.setAuthInfo(authInfoJoe);
+ fs.getName().add(new Name(UDDIConstants.WILDCARD, null));
+ fs.setFindQualifiers(new FindQualifiers());
+ fs.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
+ inquiryJoe.findBusiness(fs);
+ long endFind = System.currentTimeMillis() - startFind;
+ logger.info("****************** Find " + numberOfBusinesses + " Joes Business Duration= " + endFind);
+
+ long startDelete = System.currentTimeMillis();
+ tckBusinessJoe.deleteJoePublisherBusinesses(authInfoJoe, numberOfBusinesses);
+ long deleteDuration = System.currentTimeMillis() - startDelete;
+ logger.info("****************** Delete " + numberOfBusinesses + " Joes Duration= " + deleteDuration);
+ tckTModelJoe.deleteJoePublisherTmodel(authInfoJoe);
+ Assert.assertTrue("That took way too long at " + endFind, endFind < (5*60*1000));
+ }
+
+ @Test
+ @Override
+ public void testSamSyndicatorBusiness() throws Exception {
+ Assume.assumeTrue(TckPublisher.isLoadTest());
+ logger.info("UDDI_030_BusinessEntityLoadIntegrationTest testSamSyndicatorBusiness Load test " + numberOfBusinesses);
+ numberOfBusinesses = TckPublisher.getMaxLoadServices();
+ tckTModelSam.saveSamSyndicatorTmodel(authInfoSam);
+ long startSave = System.currentTimeMillis();
+ tckBusinessSam.saveSamSyndicatorBusinesses(authInfoSam, numberOfBusinesses);
+ long saveDuration = System.currentTimeMillis() - startSave;
+ logger.info("****************** Save " + numberOfBusinesses + " Sams Duration=" + saveDuration);
+
+ long startFind = System.currentTimeMillis();
+ FindBusiness fs = new FindBusiness();
+ fs.setAuthInfo(authInfoSam);
+ fs.getName().add(new Name(UDDIConstants.WILDCARD, null));
+ fs.setFindQualifiers(new FindQualifiers());
+ fs.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
+ inquirySam.findBusiness(fs);
+ long endFind = System.currentTimeMillis() - startFind;
+ logger.info("****************** Find " + numberOfBusinesses + " Sams Business Duration= " + endFind);
+
+
+
+
+ long startDelete = System.currentTimeMillis();
+ tckBusinessSam.deleteSamSyndicatorBusinesses(authInfoSam, numberOfBusinesses);
+ long deleteDuration = System.currentTimeMillis() - startDelete;
+ logger.info("****************** Delete " + numberOfBusinesses + " Sams Duration= " + deleteDuration);
+ tckTModelSam.deleteSamSyndicatorTmodel(authInfoSam);
+ Assert.assertTrue("That took way too long at " + endFind, endFind < (5*60*1000));
+ }
+}
Modified: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_040_BusinessServiceIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_040_BusinessServiceIntegrationTest.java?rev=1555648&r1=1555647&r2=1555648&view=diff
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_040_BusinessServiceIntegrationTest.java (original)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_040_BusinessServiceIntegrationTest.java Mon Jan 6 02:18:37 2014
@@ -14,6 +14,7 @@
*/
package org.apache.juddi.v3.tck;
+import javax.xml.ws.BindingProvider;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -30,119 +31,149 @@ import org.uddi.v3_service.UDDISecurityP
/**
* @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
* @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
*/
-public class UDDI_040_BusinessServiceIntegrationTest
-{
-
- private static Log logger = LogFactory.getLog(UDDI_040_BusinessServiceIntegrationTest.class);
-
- protected static TckTModel tckTModel = null;
- protected static TckBusiness tckBusiness = null;
- protected static TckBusinessService tckBusinessService = null;
-
- protected static String authInfoJoe = null;
- protected static String authInfoSam = null;
- private static UDDIClient manager;
-
- @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();
- UDDISecurityPortType security = transport.getUDDISecurityService();
- authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
- authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
- Assert.assertNotNull(authInfoJoe);
- Assert.assertNotNull(authInfoSam);
-
- UDDIPublicationPortType publication = transport.getUDDIPublishService();
- UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
- tckTModel = new TckTModel(publication, inquiry);
- tckBusiness = new TckBusiness(publication, inquiry);
- tckBusinessService = new TckBusinessService(publication, inquiry);
- String authInfoUDDI = TckSecurity.getAuthToken(security, TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword());
- tckTModel.saveUDDIPublisherTmodel(authInfoUDDI);
- tckTModel.saveTModels(authInfoUDDI, TckTModel.TMODELS_XML);
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- Assert.fail("Could not obtain authInfo token.");
- }
- }
-
- @Test
- public void joepublisher() {
- try {
- tckTModel.saveJoePublisherTmodel(authInfoJoe);
- tckBusiness.saveJoePublisherBusiness(authInfoJoe);
- tckBusinessService.saveJoePublisherService(authInfoJoe);
- tckBusinessService.deleteJoePublisherService(authInfoJoe);
- } finally {
- tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
- tckTModel.deleteJoePublisherTmodel(authInfoJoe);
- }
- }
-
- @Test
- public void samsyndicator() {
- try {
-
- tckTModel.saveSamSyndicatorTmodel(authInfoSam);
- tckBusiness.saveSamSyndicatorBusiness(authInfoSam);
- tckBusinessService.saveSamSyndicatorService(authInfoSam);
- tckBusinessService.deleteSamSyndicatorService(authInfoSam);
- } finally {
- tckBusiness.deleteSamSyndicatorBusiness(authInfoSam);
- tckTModel.deleteSamSyndicatorTmodel(authInfoSam);
- }
- }
-
- /**
- * 5.2.16.3 paragraph 4
- * Data contained within businessEntity structures can be rearranged with
- * this API call. This can be done by redefining parent container relationships
- * for other registered information. For instance, if a new businessEntity
- * is saved with information about a businessService that is registered
- * already as part of a different businessEntity, this results in the
- * businessService being moved from its current container to the new businessEntity.
- * This condition occurs when the businessKey of the businessService being
- * saved matches the businessKey of the businessEntity being saved.
- * An attempt to delete or move a businessService in this manner by
- * a party who is not the publisher of the businessService MUST be
- * rejected with an error E_userMismatch.
- */
- @Test
- public void joepublisherMoveBusinessService() {
- try {
- tckTModel.saveJoePublisherTmodel(authInfoJoe);
- tckBusiness.saveJoePublisherBusiness(authInfoJoe);
- tckBusinessService.saveJoePublisherService(authInfoJoe);
- tckBusiness.checkServicesBusinessOne(1);
- tckBusiness.saveJoePublisherBusiness3(authInfoJoe);
- //check that this business has no services
- tckBusiness.checkServicesBusinessThree(0);
- //Now move the service from one to three
- tckBusiness.saveJoePublisherBusiness1to3(authInfoJoe);
- tckBusiness.checkServicesBusinessOne(0);
- tckBusiness.checkServicesBusinessThree(1);
- } catch (Exception e) {
- e.printStackTrace();
- Assert.fail(e.getMessage());
- } finally {
- tckBusinessService.deleteJoePublisherService(authInfoJoe);
- tckBusiness.deleteJoePublisherBusiness3(authInfoJoe);
- tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
- tckTModel.deleteJoePublisherTmodel(authInfoJoe);
- }
- }
-
-
+public class UDDI_040_BusinessServiceIntegrationTest {
+ protected static Log logger = LogFactory.getLog(UDDI_040_BusinessServiceIntegrationTest.class);
+ protected static TckTModel tckTModelJoe = null;
+ protected static TckBusiness tckBusinessJoe = null;
+ protected static TckBusinessService tckBusinessServiceJoe = null;
+ protected static TckTModel tckTModelSam = null;
+ protected static TckBusiness tckBusinessSam = null;
+ protected static TckBusinessService tckBusinessServiceSam = null;
+ protected static UDDIInquiryPortType inquiryJoe=null;
+ protected static UDDIInquiryPortType inquirySam=null;
+ protected static String authInfoJoe = null;
+ protected static String authInfoSam = null;
+ private static UDDIClient manager;
+
+ @AfterClass
+ public static void stopManager() throws ConfigurationException {
+ tckTModelJoe.deleteCreatedTModels(authInfoJoe);
+ tckTModelSam.deleteCreatedTModels(authInfoSam);
+ manager.stop();
+ }
+
+ @BeforeClass
+ public static void startManager() throws ConfigurationException {
+ manager = new UDDIClient();
+ manager.start();
+
+ logger.debug("Getting auth tokens..");
+ try {
+ Transport transport = manager.getTransport();
+ UDDISecurityPortType security = transport.getUDDISecurityService();
+ authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+ authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
+ //Assert.assertNotNull(authInfoJoe);
+ //Assert.assertNotNull(authInfoSam);
+
+
+ UDDIPublicationPortType publication = transport.getUDDIPublishService();
+ UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
+ if (!TckPublisher.isUDDIAuthMode()) {
+ TckSecurity.setCredentials((BindingProvider) publication, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+ TckSecurity.setCredentials((BindingProvider) inquiry, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+ }
+ tckTModelJoe = new TckTModel(publication, inquiry);
+ tckBusinessJoe = new TckBusiness(publication, inquiry);
+ tckBusinessServiceJoe = new TckBusinessService(publication, inquiry);
+ inquiryJoe = inquiry;
+
+ transport = manager.getTransport();
+ publication = transport.getUDDIPublishService();
+ inquiry = transport.getUDDIInquiryService();
+ if (!TckPublisher.isUDDIAuthMode()) {
+ TckSecurity.setCredentials((BindingProvider) publication, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
+ TckSecurity.setCredentials((BindingProvider) inquiry, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
+ }
+ tckTModelSam = new TckTModel(publication, inquiry);
+ tckBusinessSam = new TckBusiness(publication, inquiry);
+ tckBusinessServiceSam = new TckBusinessService(publication, inquiry);
+ inquirySam = inquiry;
+
+ transport = manager.getTransport();
+ publication = transport.getUDDIPublishService();
+ inquiry = transport.getUDDIInquiryService();
+ String authInfoUDDI = TckSecurity.getAuthToken(security, TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword());
+ if (!TckPublisher.isUDDIAuthMode()) {
+ TckSecurity.setCredentials((BindingProvider) publication, TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword());
+ TckSecurity.setCredentials((BindingProvider) inquiry, TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword());
+ }
+
+ TckTModel tckTModel = new TckTModel(publication, inquiry);
+ tckTModel.saveUDDIPublisherTmodel(authInfoUDDI);
+ tckTModel.saveTModels(authInfoUDDI, TckTModel.TMODELS_XML);
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ Assert.fail("Could not obtain authInfo token.");
+ }
+ }
+
+ @Test
+ public void joepublisher() throws Exception {
+ try {
+ tckTModelJoe.saveJoePublisherTmodel(authInfoJoe);
+ tckBusinessJoe.saveJoePublisherBusiness(authInfoJoe);
+ tckBusinessServiceJoe.saveJoePublisherService(authInfoJoe);
+ tckBusinessServiceJoe.deleteJoePublisherService(authInfoJoe);
+ } finally {
+ tckBusinessJoe.deleteJoePublisherBusiness(authInfoJoe);
+ tckTModelJoe.deleteJoePublisherTmodel(authInfoJoe);
+ }
+ }
+
+ @Test
+ public void samsyndicator() throws Exception {
+ try {
+
+ tckTModelSam.saveSamSyndicatorTmodel(authInfoSam);
+ tckBusinessSam.saveSamSyndicatorBusiness(authInfoSam);
+ tckBusinessServiceSam.saveSamSyndicatorService(authInfoSam);
+ tckBusinessServiceSam.deleteSamSyndicatorService(authInfoSam);
+ } finally {
+ tckBusinessSam.deleteSamSyndicatorBusiness(authInfoSam);
+ tckTModelSam.deleteSamSyndicatorTmodel(authInfoSam);
+ }
+ }
+
+ /**
+ * 5.2.16.3 paragraph 4 Data contained within businessEntity structures
+ * can be rearranged with this API call. This can be done by redefining
+ * parent container relationships for other registered information. For
+ * instance, if a new businessEntity is saved with information about a
+ * businessService that is registered already as part of a different
+ * businessEntity, this results in the businessService being moved from
+ * its current container to the new businessEntity. This condition
+ * occurs when the businessKey of the businessService being saved
+ * matches the businessKey of the businessEntity being saved. An attempt
+ * to delete or move a businessService in this manner by a party who is
+ * not the publisher of the businessService MUST be rejected with an
+ * error E_userMismatch.
+ */
+ @Test
+ public void joepublisherMoveBusinessService() {
+ try {
+ tckTModelJoe.saveJoePublisherTmodel(authInfoJoe);
+ tckBusinessJoe.saveJoePublisherBusiness(authInfoJoe);
+ tckBusinessServiceJoe.saveJoePublisherService(authInfoJoe);
+ tckBusinessJoe.checkServicesBusinessOne(1);
+ tckBusinessJoe.saveJoePublisherBusiness3(authInfoJoe);
+ //check that this business has no services
+ tckBusinessJoe.checkServicesBusinessThree(0);
+ //Now move the service from one to three
+ tckBusinessJoe.saveJoePublisherBusiness1to3(authInfoJoe);
+ tckBusinessJoe.checkServicesBusinessOne(0);
+ tckBusinessJoe.checkServicesBusinessThree(1);
+ } catch (Exception e) {
+ logger.error(e);
+ Assert.fail(e.getMessage());
+ } finally {
+ tckBusinessServiceJoe.deleteJoePublisherService(authInfoJoe);
+ tckBusinessJoe.deleteJoePublisherBusiness3(authInfoJoe);
+ tckBusinessJoe.deleteJoePublisherBusiness(authInfoJoe);
+ tckTModelJoe.deleteJoePublisherTmodel(authInfoJoe);
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org