Package org.jboss.services.binding.impl

Examples of org.jboss.services.binding.impl.ServiceBindingSet


   {
      Set<ServiceBindingMetadata> set = new HashSet<ServiceBindingMetadata>();
      set.addAll(Arrays.asList(AA, AB, Anull));
     
      Set<ServiceBindingSet> sbs = new HashSet<ServiceBindingSet>();
      sbs.add(new ServiceBindingSet(A, null, 10, set));
      sbs.add(new ServiceBindingSet(B, "localhost", 20, set));     
      sbs.add(new ServiceBindingSet(C, "192.168.0.10", 30, set));
     
      PojoServiceBindingStore store = new PojoServiceBindingStore();
      store.setServiceBindingSets(sbs);
      store.start();
     
View Full Code Here


   {
      Set<ServiceBindingMetadata> set = new HashSet<ServiceBindingMetadata>();
      set.addAll(Arrays.asList(AA, AB, Anull));
     
      Set<ServiceBindingSet> sbs = new HashSet<ServiceBindingSet>();
      ServiceBindingSet setB = new ServiceBindingSet(B, "localhost", 20);     
      sbs.add(setB);    
      ServiceBindingSet setC = new ServiceBindingSet(C, "192.168.0.10", 30);
      sbs.add(setC);
     
      PojoServiceBindingStore store = new PojoServiceBindingStore(sbs, set);
      store.start();
     
View Full Code Here

   {
      Set<ServiceBindingMetadata> set = new HashSet<ServiceBindingMetadata>();
      set.addAll(Arrays.asList(AA, AB, Anull));
     
      Set<ServiceBindingSet> sbs = new HashSet<ServiceBindingSet>();
      ServiceBindingSet setA = new ServiceBindingSet(A, null, 10);
      sbs.add(setA);
      ServiceBindingSet setB = new ServiceBindingSet(B, "localhost", 20);     
      sbs.add(setB);
     
      PojoServiceBindingStore store = new PojoServiceBindingStore(sbs, set);
      store.start();
     
      Set<ServiceBindingSet> updated = new HashSet<ServiceBindingSet>(store.getServiceBindingSets());
     
      Set<ServiceBindingMetadata> overrides = new HashSet<ServiceBindingMetadata>();
      overrides.add(BA);
      ServiceBindingSet newSet = new ServiceBindingSet(C, "192.168.0.10", 30, overrides);
      updated.add(newSet);
      ServiceBindingSet replaced = new ServiceBindingSet(B, "localhost", 50);
      updated.remove(setB);
      updated.add(replaced);
      assertEquals(3, updated.size());
     
      store.setServiceBindingSets(updated);
View Full Code Here

      bindings.addAll(Arrays.asList(AA, AB, Anull));
   }
  
   public void testBasicConstructor() throws UnknownHostException
   {
      ServiceBindingSet set = new ServiceBindingSet(A, new HashSet<ServiceBindingMetadata>(bindings));
     
      assertEquals(A, set.getName());
     
      for (ServiceBindingMetadata binding : set.getOverrideBindings())
      {
         assertEquals(1, binding.getPort());
         assertTrue(bindings.remove(binding));
      }
     
      assertEquals(0, bindings.size());
     
      assertNull(set.getDefaultHostName());
      assertEquals(0, set.getPortOffset());
   }
View Full Code Here

    * Test method for {@link org.jboss.services.binding.impl.ServiceBindingSet#PortOffsetServiceBindingSet(java.util.Set, int)}.
    * @throws UnknownHostException
    */
   public void testOffsetConstructor() throws UnknownHostException
   {
      ServiceBindingSet set = new ServiceBindingSet(A, 5);
     
      assertEquals(A, set.getName());
     
      assertEquals(0, set.getOverrideBindings().size());
     
      assertNull(set.getDefaultHostName());
      assertEquals(5, set.getPortOffset());
   }
View Full Code Here

      assertEquals(5, set.getPortOffset());
   }
  
   public void testOffsetConstructorWithDefaultHost() throws UnknownHostException
   {
      ServiceBindingSet set = new ServiceBindingSet(A, "192.168.0.10", 5, new HashSet<ServiceBindingMetadata>(bindings));
     
      assertEquals(A, set.getName());
     
      for (ServiceBindingMetadata binding : set.getOverrideBindings())
      {
         assertEquals(1, binding.getPort());
         assertTrue(bindings.remove(binding));
      }
     
      assertEquals(0, bindings.size());
     
      assertEquals("192.168.0.10", set.getDefaultHostName());
      assertEquals(5, set.getPortOffset());
   }
View Full Code Here

TOP

Related Classes of org.jboss.services.binding.impl.ServiceBindingSet

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.