Package org.jboss.resteasy.test.providers.jaxb.regression

Examples of org.jboss.resteasy.test.providers.jaxb.regression.Regression636Test$BusinessEntity


      GetBusinessDetail gb = new GetBusinessDetail();
      gb.getBusinessKey().add(businessKey);
      BusinessDetail bd;
      bd = inquiry.getBusinessDetail(gb);
      List<BusinessEntity> beOutList = bd.getBusinessEntity();
      BusinessEntity beOut = beOutList.get(0);
      if (expectedServices > 0) {
        assertEquals(expectedServices, beOut.getBusinessServices().getBusinessService().size());
      } else {
        Assert.assertNull(beOut.getBusinessServices());
      }
    } catch (RemoteException e) {
      logger.error(e.getMessage(),e);
      Assert.fail("No exception should be thrown");
    }
View Full Code Here


            try {
                GetBusinessDetail gb = new GetBusinessDetail();
                gb.getBusinessKey().add(businessKey);
                BusinessDetail bd = inquiry.getBusinessDetail(gb);
                List<BusinessEntity> beOutList = bd.getBusinessEntity();
                BusinessEntity bizEntity = beOutList.get(0);
                bizEntity.getSignature().clear();
                BusinessEntity bizEntitySigned = signJAXBObject(bizEntity);
                       
                SaveBusiness sb = new SaveBusiness();
                sb.setAuthInfo(authInfo);
                sb.getBusinessEntity().add(bizEntitySigned);
                publication.saveBusiness(sb);
View Full Code Here

            try {
                GetBusinessDetail gb = new GetBusinessDetail();
                gb.getBusinessKey().add(businessKey);
                BusinessDetail bd = inquiry.getBusinessDetail(gb);
                List<BusinessEntity> beOutList = bd.getBusinessEntity();
                BusinessEntity bizEntity = beOutList.get(0);
                       
                boolean sigOk = verifySignedJAXBObject(bizEntity);
                assertTrue("Signature invalid!", sigOk);
            } catch(Throwable e) {
                logger.error(e.getMessage(),e);
View Full Code Here

  public void saveBusiness(String authInfo, String businessXML, String businessKey, boolean serialize) {
    try {
      SaveBusiness sb = new SaveBusiness();
      sb.setAuthInfo(authInfo);

      BusinessEntity beIn = (BusinessEntity)EntityCreator.buildFromDoc(businessXML, "org.uddi.api_v3");
      sb.getBusinessEntity().add(beIn);
     
      publication.saveBusiness(sb);
 
      // Now get the entity and check the values
      GetBusinessDetail gb = new GetBusinessDetail();
      gb.getBusinessKey().add(businessKey);
      BusinessDetail bd = inquiry.getBusinessDetail(gb);
      List<BusinessEntity> beOutList = bd.getBusinessEntity();
      BusinessEntity beOut = beOutList.get(0);

            if (serialize) {
                JAXB.marshal(beOut, new File("target/aftersave.xml"));
            }
           
      assertEquals(beIn.getBusinessKey(), beOut.getBusinessKey());
     
      TckValidator.checkNames(beIn.getName(), beOut.getName());
      TckValidator.checkDescriptions(beIn.getDescription(), beOut.getDescription());
      TckValidator.checkDiscoveryUrls(beIn.getDiscoveryURLs(), beOut.getDiscoveryURLs());
      TckValidator.checkContacts(beIn.getContacts(), beOut.getContacts());
      TckValidator.checkCategories(beIn.getCategoryBag(), beOut.getCategoryBag());
      TckValidator.checkSignatures(beIn.getSignature(), beOut.getSignature());
    } catch(Throwable e) {
      logger.error(e.getMessage(),e);
      Assert.fail("No exception should be thrown");
    }
View Full Code Here

      // Now get the entity and check the values
      GetBusinessDetail gb = new GetBusinessDetail();
      gb.getBusinessKey().add(businessKey);
      BusinessDetail bd = inquiry.getBusinessDetail(gb);
      List<BusinessEntity> beOutList = bd.getBusinessEntity();
      BusinessEntity beOut = beOutList.get(0);
      //We are expecting 2 services
      assertEquals(2,beOut.getBusinessServices().getBusinessService().size());
     
      //Now updating the business by adding another description
      SaveBusiness sb = new SaveBusiness();
      sb.setAuthInfo(authInfo);
      BusinessEntity beIn = beOut;
      Description desc2= new Description();
      desc2.setLang("nl");
      desc2.setValue("Omschrijving");
      beIn.getDescription().add(desc2);
      sb.getBusinessEntity().add(beIn);
      publication.saveBusiness(sb);
 
      // Now get the entity and check the values
      BusinessDetail bdnew = inquiry.getBusinessDetail(gb);
      List<BusinessEntity> beOutListNew = bdnew.getBusinessEntity();
      BusinessEntity beOutNew = beOutListNew.get(0);

      assertEquals(beIn.getBusinessKey(), beOutNew.getBusinessKey());
      // After the update we still are supposed to see two services.
      assertNotNull(beOutNew.getBusinessServices());
      assertEquals(2,beOutNew.getBusinessServices().getBusinessService().size());
     
     
    } catch(Throwable e) {
      logger.error(e.getMessage(),e);
      Assert.fail("No exception should be thrown");
View Full Code Here

    @Test(expected = ValueNotAllowedException.class)
    public void BusinessKeyTooLongTest() throws DispositionReportFaultMessage, RemoteException {
        System.out.println("BusinessKeyTooLongTest");
        SaveBusiness sb = new SaveBusiness();
        sb.setAuthInfo(authInfoJoe);
        BusinessEntity be = new BusinessEntity();
        Name n = new Name();
        n.setValue("Hello Nurse");
        be.getName().add(n);
        be.setBusinessKey(strkey256_1);
        sb.getBusinessEntity().add(be);
        try {
            BusinessDetail saveBusiness = publication.saveBusiness(sb);
            DeleteBusiness db = new DeleteBusiness();
            db.setAuthInfo(authInfoJoe);
View Full Code Here

    @Test(expected = ValueNotAllowedException.class)
    public void BusinessNameTooShortTest() throws DispositionReportFaultMessage, RemoteException {
        System.out.println("BusinessNameTooShortTest");
        SaveBusiness sb = new SaveBusiness();
        sb.setAuthInfo(authInfoJoe);
        BusinessEntity be = new BusinessEntity();
        Name n = new Name();
        n.setValue("");
        be.getName().add(n);
        sb.getBusinessEntity().add(be);
        try {
            BusinessDetail saveBusiness = publication.saveBusiness(sb);
            DeleteBusiness db = new DeleteBusiness();
            db.setAuthInfo(authInfoJoe);
View Full Code Here

    @Test
    public void BusinessNameMinLengthTest() throws DispositionReportFaultMessage, RemoteException {
        System.out.println("BusinessNameMinLengthTest");
        SaveBusiness sb = new SaveBusiness();
        sb.setAuthInfo(authInfoJoe);
        BusinessEntity be = new BusinessEntity();
        Name n = new Name();
        n.setValue("1");
        be.getName().add(n);
        sb.getBusinessEntity().add(be);
        BusinessDetail saveBusiness = publication.saveBusiness(sb);
        DeleteBusiness db = new DeleteBusiness();
        db.setAuthInfo(authInfoJoe);
        db.getBusinessKey().add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
View Full Code Here

    @Test(expected = ValueNotAllowedException.class)
    public void BusinessNameTooLongTest() throws DispositionReportFaultMessage, RemoteException {
        System.out.println("BusinessNameTooLongTest");
        SaveBusiness sb = new SaveBusiness();
        sb.setAuthInfo(authInfoJoe);
        BusinessEntity be = new BusinessEntity();
        Name n = new Name();
        //256 chars
        n.setValue(str256);
        be.getName().add(n);
        sb.getBusinessEntity().add(be);
        try {
            BusinessDetail saveBusiness = publication.saveBusiness(sb);
            DeleteBusiness db = new DeleteBusiness();
            db.setAuthInfo(authInfoJoe);
View Full Code Here

    @Test
    public void BusinessNameMaxLengthTest() throws DispositionReportFaultMessage, RemoteException {
        System.out.println("BusinessNameMaxLengthTest");
        SaveBusiness sb = new SaveBusiness();
        sb.setAuthInfo(authInfoJoe);
        BusinessEntity be = new BusinessEntity();
        Name n = new Name();
        //255 chars
        n.setValue(str255);
        be.getName().add(n);
        sb.getBusinessEntity().add(be);
        BusinessDetail saveBusiness = publication.saveBusiness(sb);
        DeleteBusiness db = new DeleteBusiness();
        db.setAuthInfo(authInfoJoe);
        db.getBusinessKey().add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.test.providers.jaxb.regression.Regression636Test$BusinessEntity

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.