Package org.apache.ace.client.repository.object

Examples of org.apache.ace.client.repository.object.Distribution2TargetAssociation


    final DistributionObject l1 = createBasicDistributionObject("thedistribution");
   
    assertTrue("We just created a Staful GW object, is should not be registered", !sgo1.isRegistered());
   
    // register sgo1 again and create an association in 1 go
    Distribution2TargetAssociation lgw1 = runAndWaitForEvent(new Callable<Distribution2TargetAssociation>() {
        public Distribution2TargetAssociation call() throws Exception {
            sgo1.register();
            return m_distribution2targetRepository.create(l1, sgo1.getTargetObject());
        }
    }, false, Distribution2TargetAssociation.TOPIC_ADDED, TargetObject.TOPIC_ADDED, TOPIC_STATUS_CHANGED);
   
    // checks
    nrRegistered =
        m_statefulTargetRepository.get(
            m_bundleContext.createFilter("(" + KEY_REGISTRATION_STATE + "=" + RegistrationState.Registered + ")"))
            .size();
    assert nrRegistered == 2 : "We expect to filter out two registered targets, but we find " + nrRegistered;
    assertTrue("A stateful gw object should be registered", sgo1.isRegistered());
    assertTrue("The stateful gw object should be associated to thedistribution.", sgo1.isAssociated(l1, DistributionObject.class));
    assertTrue("Both ends of distribution - stateful gw should be satisfied.", lgw1.isSatisfied());
   
    cleanUp();
    }
View Full Code Here


        final DistributionObject l1 = createBasicDistributionObject("thedistribution");

        assertTrue("We just created a Stateful target object, is should not be registered", !sgo1.isRegistered());

        // register sgo1 again and create an association in 1 go
        Distribution2TargetAssociation lgw1 = runAndWaitForEvent(new Callable<Distribution2TargetAssociation>() {
            public Distribution2TargetAssociation call() throws Exception {
                sgo1.register();
                return m_distribution2targetRepository.create(l1, sgo1.getTargetObject());
            }
        }, false, Distribution2TargetAssociation.TOPIC_ADDED, TargetObject.TOPIC_ADDED, TOPIC_STATUS_CHANGED);

        // checks
        nrRegistered =
            m_statefulTargetRepository.get(
                m_bundleContext.createFilter("(" + KEY_REGISTRATION_STATE + "=" + RegistrationState.Registered + ")"))
                .size();
        assert nrRegistered == 2 : "We expect to filter out two registered targets, but we find " + nrRegistered;
        assertTrue("A stateful target object should be registered", sgo1.isRegistered());
        assertTrue("The stateful target object should be associated to the distribution.", sgo1.isAssociated(l1, DistributionObject.class));
        assertTrue("Both ends of distribution - stateful target should be satisfied.", lgw1.isSatisfied());

        cleanUp();
    }
View Full Code Here

TOP

Related Classes of org.apache.ace.client.repository.object.Distribution2TargetAssociation

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.