Examples of AssociationManagement


Examples of org.rioproject.associations.AssociationManagement

        Assert.assertTrue("Expected \'His Brother Darrel\', got " + dummy.getName(), "His Brother Darrel".equals(dummy.getName()));
    }

    @Test
    public void testVersionedAssociationRange() throws ExecutionException, InterruptedException, IOException {
        AssociationManagement aMgr = new DefaultAssociationManagement();
        AssociationDescriptor descriptor = AssociationDescriptor.create("Dummy", Dummy.class, System.getProperty("org.rioproject.groups"));
        descriptor.setMatchOnName(false);
        descriptor.setVersion("2.8");
        Association<Dummy> association = aMgr.addAssociationDescriptor(descriptor);
        Dummy dummy = association.getServiceFuture().get();
        Assert.assertNotNull(dummy);
        Assert.assertEquals("Expected 1 got "+association.getServiceCount(), 1, association.getServiceCount());
        Assert.assertTrue("Expected \'His Other Brother Darrel\', got "+dummy.getName(), "His Other Brother Darrel".equals(dummy.getName()));
    }
View Full Code Here

Examples of org.rioproject.associations.AssociationManagement

        Assert.assertTrue("Expected \'His Other Brother Darrel\', got "+dummy.getName(), "His Other Brother Darrel".equals(dummy.getName()));
    }

    @Test
    public void testVersionedAssociationNoMatches() throws ExecutionException, InterruptedException, IOException {
        AssociationManagement aMgr = new DefaultAssociationManagement();
        AssociationDescriptor descriptor = AssociationDescriptor.create("Dummy", Dummy.class, System.getProperty("org.rioproject.groups"));
        descriptor.setMatchOnName(false);
        descriptor.setVersion("1.0");
        Association<Dummy> association = aMgr.addAssociationDescriptor(descriptor);
        Dummy dummy = null;
        try {
            dummy = association.getServiceFuture().get(5, TimeUnit.SECONDS);
        } catch (TimeoutException e) {
            System.out.println("Received expected TimeoutException");
View Full Code Here

Examples of org.rioproject.associations.AssociationManagement

        Assert.assertEquals("Expected 0 got "+association.getServiceCount(), 0, association.getServiceCount());
    }

    @Test
    public void testVersionedAssociationMatchesAll() throws ExecutionException, InterruptedException, IOException {
        AssociationManagement aMgr = new DefaultAssociationManagement();
        AssociationDescriptor descriptor = AssociationDescriptor.create("Dummy", Dummy.class, System.getProperty("org.rioproject.groups"));
        descriptor.setMatchOnName(false);
        Association<Dummy> association = aMgr.addAssociationDescriptor(descriptor);
        Dummy dummy = null;
        TimeoutException timeoutException = null;
        try {
            dummy = association.getServiceFuture().get(5, TimeUnit.SECONDS);
        } catch (TimeoutException e) {
View Full Code Here

Examples of org.rioproject.associations.AssociationManagement

@RunWith(RioTestRunner.class)
public class AssociationVersionTest {

    @Test
    public void testVersionedAssociations() throws ExecutionException, InterruptedException, IOException {
        AssociationManagement aMgr = new DefaultAssociationManagement();
        AssociationDescriptor descriptor = AssociationDescriptor.create("Dummy", Dummy.class, System.getProperty("org.rioproject.groups"));
        descriptor.setMatchOnName(false);
        descriptor.setVersion("2.1");
        Association<Dummy> association = aMgr.addAssociationDescriptor(descriptor);
        Dummy dummy = association.getServiceFuture().get();
        Assert.assertNotNull(dummy);
        Assert.assertEquals("Expected 1 got " + association.getServiceCount(), 1, association.getServiceCount());
        Assert.assertTrue("Expected \'His Brother Darrel\', got " + dummy.getName(), "His Brother Darrel".equals(dummy.getName()));
    }
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.