Examples of MBBService


Examples of org.corrib.s3b.mbb.service.MBBService

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

Examples of org.corrib.s3b.mbb.service.MBBService

        tmpmatchedService = MBBServices.matchMeta((baseUrl != null)?baseUrl:ConfigKeeper.getServiceUrl(), previousCall, soaCall, params, true);
      }
     
      if(tmpmatchedService != null && tmpmatchedService.getImplementation() != null) {

        MBBService mbbService;
        try {
          if(tmpmatchedService.isMeta()) {
            if(tmpmatchedService.getImplementation().equals(StatsMetaService.class) && params.size() > 7) {
              tmpmetaservice = StatsMetaService.get(params.get(7));
              tmpmetaservice.setParams(params);
            }else {
              try {
                Method get = tmpmatchedService.getImplementation().getMethod("get", String.class);
 
                if(params.size() > 1)
                  tmpmetaservice = (MBBMetaService)get.invoke(null, params.get(1));
                else
                  tmpmetaservice = (MBBMetaService)get.invoke(null, (String)null);

                tmpmetaservice.setParams(params);
              } catch (SecurityException e) {
                logger.severe("Something is wrong with the setup of MBB: "+e);
              } catch (NoSuchMethodException e) {
                logger.severe("Something is wrong with the setup of MBB: "+e);
              } catch (IllegalArgumentException e) {
                logger.severe("Something is wrong with the setup of MBB: "+e);
              } catch (InvocationTargetException e) {
                logger.severe("Something is wrong with the setup of MBB: "+e);
              }
             
            }
            break;
          }

          mbbService = tmpmatchedService.getImplementation().newInstance();
          mbbService.setParams(params);
         
          tmpchain.add(mbbService);
          try {
            if(mbbService instanceof AccessResourceService) {
              previousCall += params.get(1);
              mbbService.setUri(params.get(0));
              mbbService.setId(MBBService.getServiceId(params.get(0)));
            }else {
              previousCall += params.get(0);
              mbbService.setUri(baseUrl+previousCall);

              if(mbbService instanceof ServiceById)
                mbbService.setId(previousCall);
              else
                mbbService.setId(MBBService.getServiceId(previousCall));
            }
           
          }catch(IndexOutOfBoundsException ex) {
            logger.log(Level.SEVERE, "no previous call information set", ex);
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.