Examples of EPR


Examples of org.jboss.soa.esb.addressing.EPR

    public void testCaching()
        throws Exception
    {
        final String category = "category" ;
        final String name = "name" ;
        final EPR epr1 = new EPR() ;
        final EPR epr2 = new EPR() ;
        final EPR epr3 = new EPR(URI.create("urn:test")) ;
       
        final CachingRegistryInterceptor interceptor = new CachingRegistryInterceptor() ;
        final RegistryStatsInterceptor stats = new RegistryStatsInterceptor() ;
        final MockRegistry registry = new MockRegistry() ;
        stats.setRegistry(registry) ;
        interceptor.setRegistry(stats) ;

        registry.registerEPR(category, name, "Description", epr1, "EPR description") ;
       
        // findAllServices passes through to registry
        assertEquals("findAllServices count", 0, stats.getFindAllServicesCount()) ;
        interceptor.findAllServices() ;
        assertEquals("findAllServices count", 1, stats.getFindAllServicesCount()) ;
        interceptor.findAllServices() ;
        assertEquals("findAllServices count", 2, stats.getFindAllServicesCount()) ;

        // findServices passes through to registry
        assertEquals("findServices count", 0, stats.getFindServicesCount()) ;
        interceptor.findServices(category) ;
        assertEquals("findServices count", 1, stats.getFindServicesCount()) ;
        interceptor.findServices(category) ;
        assertEquals("findServices count", 2, stats.getFindServicesCount()) ;

        // findEPR/findEPRs go to registry on first call, then cache.
        assertEquals("findEPRs count", 0, stats.getFindEPRsCount()) ;
        interceptor.findEPRs(category, name) ;
        assertEquals("findEPRs count", 1, stats.getFindEPRsCount()) ;
        interceptor.findEPRs(category, name) ;
        assertEquals("findEPRs count", 1, stats.getFindEPRsCount()) ;
        interceptor.findEPR(category, name) ;
        assertEquals("findEPRs count", 1, stats.getFindEPRsCount()) ;
        assertEquals("findEPR count", 0, stats.getFindEPRCount()) ;

        // registerEPR goes to registry and adds to cache
        assertEquals("findEPRs count", 1, stats.getFindEPRsCount()) ;
        assertEquals("registerEPR count", 0, stats.getRegisterEPRCount()) ;
        final List<EPR> registerOrigEPRs = interceptor.findEPRs(category, name) ;
        assertEquals("findEPRs count", 1, stats.getFindEPRsCount()) ;
        assertNotNull("Original EPRs", registerOrigEPRs) ;
        assertEquals("Original EPR count", 1, registerOrigEPRs.size()) ;
        interceptor.registerEPR(category, name, "Description", epr2, "EPR description") ;
        assertEquals("registerEPR count", 1, stats.getRegisterEPRCount()) ;
        final List<EPR> duplicateEPRs = interceptor.findEPRs(category, name) ;
        assertEquals("findEPRs count", 1, stats.getFindEPRsCount()) ;
        assertNotNull("Duplicate EPRs", duplicateEPRs) ;
        assertEquals("Duplicate EPR count", 1, duplicateEPRs.size()) ;
        interceptor.registerEPR(category, name, "Description", epr3, "EPR description") ;
        assertEquals("registerEPR count", 2, stats.getRegisterEPRCount()) ;
        final List<EPR> registerNewEPRs = interceptor.findEPRs(category, name) ;
        assertEquals("findEPRs count", 1, stats.getFindEPRsCount()) ;
        assertNotNull("New EPRs", registerNewEPRs) ;
        assertEquals("New EPR count", 2, registerNewEPRs.size()) ;

        // unRegister goes to registry and removes from cache
        assertEquals("findEPRs count", 1, stats.getFindEPRsCount()) ;
        assertEquals("unRegisterEPR count", 0, stats.getUnRegisterEPRCount()) ;
        final List<EPR> unRegisterOrigEPRs = interceptor.findEPRs(category, name) ;
        assertEquals("findEPRs count", 1, stats.getFindEPRsCount()) ;
        assertNotNull("Original EPRs", unRegisterOrigEPRs) ;
        assertEquals("Original EPR count", 2, unRegisterOrigEPRs.size()) ;
        interceptor.unRegisterEPR(category, name, epr3) ;
        assertEquals("unRegisterEPR count", 1, stats.getUnRegisterEPRCount()) ;
        final List<EPR> unRegisterNewEPRs = interceptor.findEPRs(category, name) ;
        assertEquals("findEPRs count", 1, stats.getFindEPRsCount()) ;
        assertNotNull("New EPRs", unRegisterNewEPRs) ;
        assertEquals("New EPR count", 1, unRegisterNewEPRs.size()) ;
        interceptor.unRegisterEPR(category, name, epr2) ;
        assertEquals("unRegisterEPR count", 2, stats.getUnRegisterEPRCount()) ;
        final List<EPR> unRegisterDuplicateEPRs = interceptor.findEPRs(category, name) ;
        assertEquals("findEPRs count", 1, stats.getFindEPRsCount()) ;
        assertNotNull("Duplicate EPRs", unRegisterDuplicateEPRs) ;
        assertEquals("Duplicate EPR count", 1, unRegisterDuplicateEPRs.size()) ;
        interceptor.unRegisterEPR(category, name, epr1) ;
        assertEquals("unRegisterEPR count", 3, stats.getUnRegisterEPRCount()) ;
        final List<EPR> finalEPRs = interceptor.findEPRs(category, name) ;
        assertEquals("findEPRs count", 1, stats.getFindEPRsCount()) ;
        assertNotNull("Final EPRs", finalEPRs) ;
        assertEquals("Final EPR count", 0, finalEPRs.size()) ;
        final EPR finalEPR = interceptor.findEPR(category, name) ;
        assertNull("Final EPR", finalEPR) ;
        assertEquals("findEPR count", 0, stats.getFindEPRCount()) ;
        assertEquals("findEPRs count", 1, stats.getFindEPRsCount()) ;

        // Test unregistering of service
View Full Code Here

Examples of org.jboss.soa.esb.addressing.EPR

       
        final String[] names = new String[numServices] ;
        for (int count = 0 ; count < numServices ; count++)
        {
            names[count] = name + count ;
            registry.registerEPR(category, names[count], "description", new EPR(), "EPR description") ;
        }
        final int numThreads = numServices*2 ;
       
        final CyclicBarrier barrier = new CyclicBarrier(numThreads) ;
        final ConcurrencyTest[] tests = new ConcurrencyTest[numThreads] ;
View Full Code Here

Examples of org.jboss.soa.esb.addressing.EPR

    assertNotSame(MockRegistry.class.getName(), MockRegistry.regPropManager.getProperty(Environment.REGISTRY_IMPEMENTATION_CLASS));
  }

  public void test_features() throws RegistryException, ServiceNotFoundException {
    MockRegistry registry = new MockRegistry();
    EPR epr = new EPR();
    List<String> services = new ArrayList<String>();
    List<EPR> eprs = new ArrayList<EPR>();
   
    registry.registerEPR("cat1", "cat1-service1", "service-desc", epr, "epr-desc");
    registry.registerEPR("cat1", "cat1-service2", "service-desc", epr, "epr-desc");
View Full Code Here

Examples of org.jboss.soa.esb.addressing.EPR

        InVMRegistryInterceptor reg = new InVMRegistryInterceptor();
        try
        {
            reg.setRegistry(new MockRegistry()) ;
   
            reg.registerEPR("x", "y", "blah", new InVMEpr(new EPR(URI.create("x://123"))), "blah");
   
            EPR eprFromReg = reg.findEPR("x", "y");
            Assert.assertEquals("InVM EPR count", 1, InVMTransport.getInstance().findEPRs("x", "y").size()) ;
   
            // Register the EPR again...
            reg.registerEPR("x", "y", "blah", new InVMEpr(new EPR(URI.create("x://123"))), "blah");
            Assert.assertEquals("InVM EPR count", 2, InVMTransport.getInstance().findEPRs("x", "y").size()) ;
   
            // Unregister it once...
            reg.unRegisterEPR("x", "y", new InVMEpr(new EPR(URI.create("x://123"))));
   
            // Should still be able to find it...
            reg.findEPR("x", "y");
            Assert.assertEquals("InVM EPR count", 1, InVMTransport.getInstance().findEPRs("x", "y").size()) ;
   
            // Unregister it again...
            reg.unRegisterEPR("x", "y", new InVMEpr(new EPR(URI.create("x://123"))));
   
            Assert.assertEquals("InVM EPR count", 0, InVMTransport.getInstance().findEPRs("x", "y").size()) ;
        }
        finally
        {
View Full Code Here

Examples of org.jboss.soa.esb.addressing.EPR

        InVMRegistryInterceptor reg = new InVMRegistryInterceptor();
        try
        {
            reg.setRegistry(new MockRegistry()) ;
   
            reg.registerEPR("xy", "z", "blah", new InVMEpr(new EPR(URI.create("x://123"))), "blah");
            try {
                reg.registerEPR("x", "yz", "blah", new InVMEpr(new EPR(URI.create("x://123"))), "blah");
                Assert.fail("Expected RegistryException");
            } catch (RegistryException e) {} // expected
        }
        finally
        {
View Full Code Here

Examples of org.jboss.soa.esb.addressing.EPR

    @Test
    public void test_JBESB_2108_03() throws ServiceNotFoundException, RegistryException {
        InVMRegistryInterceptor reg = new InVMRegistryInterceptor();
        try
        {
            EPR xy_z = new InVMEpr(new EPR(URI.create("x://123")));
            EPR x_yz = new InVMEpr(new EPR(URI.create("x://1234")));
            reg.setRegistry(new MockRegistry()) ;
   
            // Register "xy:z"...
            reg.registerEPR("xy", "z", "blah", xy_z, "blah");
            Assert.assertEquals(xy_z, reg.findEPR("xy", "z"));
View Full Code Here

Examples of org.jboss.soa.esb.addressing.EPR

        generator.generate();
        List<WebserviceInfo> webservices = generator.getModel().getWebserviceServices();
        final WebserviceInfo webservice = webservices.get(0) ;
        final ESBServiceEndpointInfo endpointInfo = new ESBServiceEndpointInfo(webservice) ;
       
        final EPR deliverEPR = new EPR(new URI("test:deliver")) ;
        final MockCourier deliverCourier = new MockCourier(true);
        final Service service = webservice.getService() ;
        final String category = service.getCategory() ;
        final String name = service.getName() ;
        TestRegistry.register(category, name, deliverEPR, deliverCourier);
View Full Code Here

Examples of org.jboss.soa.esb.addressing.EPR

    if (callDetails == null)
    {
      return null ;
    }
   
    final EPR replyTo = callDetails.getReplyTo() ;
    if (replyTo != null)
    {
      return replyTo ;
    }
    else
View Full Code Here

Examples of org.jboss.soa.esb.addressing.EPR

    if (callDetails == null)
    {
      return null ;
    }
   
    final EPR faultTo = callDetails.getFaultTo() ;
    if (faultTo != null)
    {
      return faultTo ;
    }
    else if (!oneWay)
View Full Code Here

Examples of org.jboss.soa.esb.addressing.EPR

      sendToDLQ(callDetails, message, MessageType.reply) ;
        }
    }
    else
    {
      final EPR replyToEPR = message.getHeader().getCall().getTo() ;
      messageTo(replyToEPR, message, MessageType.reply);
    }
  }
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.