Package org.corrib.s3b.mbb.beans

Examples of org.corrib.s3b.mbb.beans.ServiceChain


        return lr;//it means that we already invoked this query
    } catch (AccessDeniedException e) {
      Repository.logger.warning(e.toString());
    }
   
    ServiceChain chain = ServiceChain.decode(uri, ConfigKeeper.getServiceUrl());//TODO get base URI from config
    lr = Repository.MAIN_REPOSITORY.getLocalRepository();

    for(MBBService service : chain.getServices()) {
      //execute each service
      lr = service.execute(lr);
    }
   
    return lr;
View Full Code Here


   * Test method for {@link org.corrib.s3b.mbb.beans.ServiceChain#decode(java.lang.String)}.
   */
  @Test
  public final void testDecode() {
    for(CallChainTest cct : this.tests) {
      ServiceChain chain = ServiceChain.decode(cct.getCall(), cct.getBaseUrl());
     
      System.out.println(chain);

      if(cct.getCalls().size() != chain.getServices().size())
        failNotEquals("Service test failed ["+cct.getId()+"]\n - number of resulted services in a chain does not equal\n", cct.getCalls().size(), chain.getServices().size());
     
      for(int i = 0; i < cct.getCalls().size(); i++) {
        CallTest ct = cct.getCalls().get(i);
        MBBService service = chain.getServices().get(i);
       
        if(!ct.getMatchedService().getImplementation().equals(service.getClass()))
            failNotEquals("Results implmentation test failed ["+cct.getId()+"]", ct.getMatchedService().getImplementation(), service.getClass());
         
        if(ct.getResults().size() != service.getParams().size()) {
          failNotEquals("Results size test failed ["+cct.getId()+" : "+i+"]", ct.getResults().size(), service.getParams().size());
        }

        for(int j = 0; j < ct.getResults().size(); j++)
          if(ct.getResults().get(j) != null && !ct.getResults().get(j).equals(service.getParams().get(j)))
            failNotEquals("Expected results test failed ["+cct.getId()+"]", ct.getResults().get(j), service.getParams().get(j));
      }
     
      if(cct.getMetaService() != null || chain.getMetaservice() != null) {
        if(cct.getMetaService() == null || chain.getMetaservice() == null)
          failNotEquals("Results meta test failed ["+cct.getId()+"]", cct.getMetaService(), chain.getMetaservice());
       
        if(!cct.getMetaService().getMatchedService().getImplementation().equals(chain.getMetaservice().getClass()))
          failNotEquals("Results meta class test failed ["+cct.getId()+"]", cct.getMetaService().getMatchedService().getImplementation(), chain.getMetaservice().getClass());
         
        if(cct.getMetaService().getResults()!=null || chain.getMetaservice().getParams()!=null) {
          if(cct.getMetaService().getResults()==null || chain.getMetaservice().getParams()==null)
            failNotEquals("Results meta param test failed ["+cct.getId()+"]", cct.getMetaService().getResults(), chain.getMetaservice().getParams());
       
          if(cct.getMetaService().getResults().size() != chain.getMetaservice().getParams().size()) {
            failNotEquals("Results meta param size test failed ["+cct.getId()+" : meta]", cct.getMetaService().getResults().size(), chain.getMetaservice().getParams().size());
          }
   
          for(int j = 0; j < cct.getMetaService().getResults().size(); j++)
            if(cct.getMetaService().getResults().get(j) != null && !cct.getMetaService().getResults().get(j).equals(chain.getMetaservice().getParams().get(j)))
              failNotEquals("Expected meta results test failed ["+cct.getId()+"]", cct.getMetaService().getResults().get(j), chain.getMetaservice().getParams().get(j));
        }
      }
    }
  }
View Full Code Here

      }

    }else {
      String[] asparams = new String[7];
      BrowseSimilarService similarService = new BrowseSimilarService();
      ServiceChain newchain = null;
      LocalRepository simrepo;
      GraphStatistics graphstats;
      ValueStats aisize;
     
      try {
         newchain = (ServiceChain)this.callBean.getChain().clone();
         newchain.getServices().add(similarService);
      } catch (CloneNotSupportedException e) {
        e.printStackTrace();
      }
     
      similarService.setCallBean(this.getCallBean());
View Full Code Here

      }
     
    }else {
      String[] asprops = new String[6];
      BrowseRelatedService browseService = new BrowseRelatedService();
      ServiceChain newchain = null;
      LocalRepository simrepo;
      GraphStatistics graphstats;
      ValueStats aisize;
     
      try {
         newchain = (ServiceChain)this.callBean.getChain().clone();
         newchain.getServices().add(browseService);
      } catch (CloneNotSupportedException e) {
        e.printStackTrace();
      }
     
      browseService.setCallBean(this.getCallBean());
View Full Code Here

      }
     
    }else {
      BrowseSimilarService similarService = new BrowseSimilarService();
      String[] asparams = new String[7];
      ServiceChain newchain = null;
      LocalRepository simrepo;
      GraphStatistics graphstats;
      String[] aprop = (aproperty != null && aproperty.length > 0)?PredefinedProperty.shortenURI(aproperty[0]):null; //XXX this is a nasty quick hack - to be corrected later
     
      try {
         newchain = (ServiceChain)this.callBean.getChain().clone();
         newchain.getServices().add(similarService);
      } catch (CloneNotSupportedException e) {
        e.printStackTrace();
      }
     
      similarService.setCallBean(this.getCallBean());
View Full Code Here

TOP

Related Classes of org.corrib.s3b.mbb.beans.ServiceChain

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.