Package org.apache.juddi.api_v3

Examples of org.apache.juddi.api_v3.GetPublisherDetailTest


 
      // 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 (InvalidKeyPassedException e) {
        Assert.fail("We expected to find publisher " + publisherXML);
View Full Code Here


      //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.");
      } catch (InvalidKeyPassedException e) {
        Assert.assertNull(pdAfterDelete);
View Full Code Here

   @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();
    }
  }
View Full Code Here

 
      // 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 (InvalidKeyPassedException e) {
        Assert.fail("We expected to find publisher " + publisherXML);
View Full Code Here

      //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) {
View Full Code Here

    JUDDIApiResponse response = new JUDDIApiResponse();
    List<Publisher> publishers = new ArrayList<Publisher>();
    try {
       Transport transport = WebHelper.getTransport(session.getServletContext());
           JUDDIApiPortType apiService = transport.getJUDDIApiService();
           PublisherDetail publisherDetail = apiService.getPublisherDetail(getPublisherDetail);
           //if the publisher is an admin, then return ALL publishers
           if ("true".equalsIgnoreCase(publisherDetail.getPublisher().get(0).getIsAdmin())) {
            
             GetAllPublisherDetail getAllPublisherDetail = new GetAllPublisherDetail();
         getAllPublisherDetail.setAuthInfo(authToken);
         logger.debug("GetAllPublisherDetail " + getAllPublisherDetail + " sending get AllPublisherDetail request..");
         publisherDetail = apiService.getAllPublisherDetail(getAllPublisherDetail);
           }
           for (org.apache.juddi.api_v3.Publisher apiPublisher : publisherDetail.getPublisher()) {
        Publisher publisher = new Publisher();
        BeanUtils.copyProperties(publisher, apiPublisher);
        publishers.add(publisher);
       }
           response.setSuccess(true);
View Full Code Here

            SavePublisher savePublisher = new SavePublisher();
            savePublisher.setAuthInfo(token);
            org.apache.juddi.api_v3.Publisher apiPublisher = new org.apache.juddi.api_v3.Publisher();
            BeanUtils.copyProperties(apiPublisher, publisher);
            savePublisher.getPublisher().add(apiPublisher);
            PublisherDetail publisherDetail = apiService.savePublisher(savePublisher);
            List<Publisher> publishers = new ArrayList<Publisher>();
           for (org.apache.juddi.api_v3.Publisher apiPublisherOut : publisherDetail.getPublisher()) {
        Publisher publisherOut = new Publisher();
        BeanUtils.copyProperties(publisherOut, apiPublisherOut);
        publishers.add(publisher);
       }
           response.setSuccess(true);
View Full Code Here

    getPublisherDetail.getPublisherId().add(username);
   
    try {
       Transport transport = WebHelper.getTransport(session.getServletContext());
           JUDDIApiPortType apiService = transport.getJUDDIApiService();
           PublisherDetail publisherDetail = apiService.getPublisherDetail(getPublisherDetail);
              org.apache.juddi.api_v3.Publisher publisher = publisherDetail.getPublisher().get(0);
              if ("true".equalsIgnoreCase(publisher.getIsAdmin())) {
               UDDIClerkManager manager =  WebHelper.getUDDIClerkManager(session.getServletContext());
               logger.info("managerName=" + manager.getName());
               manager.restart();
               response.setMessage("Successfull manager restart.");
View Full Code Here

 
      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
     
      new ValidatePublish(publisher).validateSavePublisher(em, body);
     
      PublisherDetail result = new PublisherDetail();
 
      List<org.apache.juddi.api_v3.Publisher> apiPublisherList = body.getPublisher();
      for (org.apache.juddi.api_v3.Publisher apiPublisher : apiPublisherList) {
       
        org.apache.juddi.model.Publisher modelPublisher = new org.apache.juddi.model.Publisher();
       
        MappingApiToModel.mapPublisher(apiPublisher, modelPublisher);
       
        Object existingUddiEntity = em.find(modelPublisher.getClass(), modelPublisher.getAuthorizedName());
        if (existingUddiEntity != null)
          em.remove(existingUddiEntity);
       
        em.persist(modelPublisher);
       
        result.getPublisher().add(apiPublisher);
      }
 
      tx.commit();
      return result;
    } finally {
View Full Code Here

    try {
      tx.begin();
 
      this.getEntityPublisher(em, body.getAuthInfo());
     
      PublisherDetail result = new PublisherDetail();
     
      List<String> publisherIdList = body.getPublisherId();
      for (String publisherId : publisherIdList) {
       
        org.apache.juddi.model.Publisher modelPublisher = em.find(org.apache.juddi.model.Publisher.class, publisherId);
        if (modelPublisher == null) {
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.PublisherNotFound", publisherId));
        }
       
        org.apache.juddi.api_v3.Publisher apiPublisher = new org.apache.juddi.api_v3.Publisher();
       
        MappingModelToApi.mapPublisher(modelPublisher, apiPublisher);
       
        result.getPublisher().add(apiPublisher);
      }
 
      tx.commit();
      return result;
    } finally {
View Full Code Here

TOP

Related Classes of org.apache.juddi.api_v3.GetPublisherDetailTest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.