Package org.jboss.services.binding

Examples of org.jboss.services.binding.ServiceBindingMetadata


      store.start();
     
      Set<ServiceBindingMetadata> updatedSet =
         new HashSet<ServiceBindingMetadata>(store.getStandardBindings());
      assertEquals(3, updatedSet.size());
      ServiceBindingMetadata updated = new ServiceBindingMetadata(AA);
      updated.setPort(9999);
      updated.setDescription("updated");
      updatedSet.remove(AA);
      updatedSet.add(updated);
      updatedSet.add(BA);
      assertEquals(4, updatedSet.size());
     
      store.setStandardBindings(updatedSet);
     
      Set<ServiceBindingMetadata> result = store.getStandardBindings();
      assertNotNull(result);
      assertTrue("has updated", result.contains(updated));
      assertTrue("has AB", result.contains(AB));
      assertTrue("has Anull", result.contains(Anull));
      assertTrue("has BA", result.contains(BA));
     
      for (ServiceBindingSet bindingSet : sbs)
      {
         String setName = bindingSet.getName();
         Set<ServiceBinding> bindings = store.getServiceBindings(setName);
         assertNotNull(bindings);
         assertEquals(4, bindings.size());
         Map<String, ServiceBinding> byFQN = new HashMap<String, ServiceBinding>();
         for (ServiceBinding binding : bindings)
         {
            byFQN.put(binding.getFullyQualifiedName(), binding);
         }
        
         ServiceBinding aa = byFQN.get(updated.getFullyQualifiedName());
         assertNotNull(aa);
         assertEquals(setName + "/updated/serviceName", updated.getServiceName(), aa.getServiceName());
         assertEquals(setName + "/updated/bindingName", updated.getBindingName(), aa.getBindingName());
         assertEquals(setName + "/updated/description", updated.getDescription(), aa.getDescription());
         assertEquals(setName + "/updated/hostName", bindingSet.getDefaultHostName(), aa.getHostName());
         assertEquals(setName + "/updated/port", updated.getPort() + bindingSet.getPortOffset(), aa.getPort());
        
         ServiceBinding ab = byFQN.get(AB.getFullyQualifiedName());
         assertNotNull(aa);
         assertEquals(setName + "/AB/serviceName", AB.getServiceName(), ab.getServiceName());
         assertEquals(setName + "/AB/bindingName", AB.getBindingName(), ab.getBindingName());
View Full Code Here


   protected void setUp() throws Exception
   {
      super.setUp();
     
      AA = new ServiceBindingMetadata(A, A, "localhost", 1, false, false);
      AB = new ServiceBindingMetadata(A, B, "localhost", 1, false, false);
      Anull = new ServiceBindingMetadata(A, null, "localhost", 1, false, false);
     
      bindings.addAll(Arrays.asList(AA, AB, Anull));
   }
View Full Code Here

TOP

Related Classes of org.jboss.services.binding.ServiceBindingMetadata

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.