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

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


        return result;
    }

    @Override
    public Distribution2TargetAssociation createDistribution2TargetAssociation(String distributionId, String targetId) {
        DistributionObject distribution = m_distributionRepository.get(distributionId);
        StatefulTargetObject target = m_statefulTargetRepository.get(targetId);
        if (!target.isRegistered()) {
            target.register();
            target.setAutoApprove(true);
        }
View Full Code Here


    }

    @Override
    public Feature2DistributionAssociation createFeature2DistributionAssociation(String featureId, String distributionId) {
        FeatureObject feature = m_featureRepository.get(featureId);
        DistributionObject distribution = m_distributionRepository.get(distributionId);
        return m_feature2distributionAssociationRepository.create(feature, distribution);
    }
View Full Code Here

        return object.getName();
    }

    @Override
    protected void handleEvent(String topic, RepositoryObject entity, org.osgi.service.event.Event event) {
        DistributionObject distribution = (DistributionObject) entity;
        if (DistributionObject.TOPIC_ADDED.equals(topic)) {
            addToTable(distribution);
        }
        if (DistributionObject.TOPIC_REMOVED.equals(topic)) {
            removeFromTable(distribution);
View Full Code Here

     * tested by TestAssociations.
     */
    @Test(groups = { TestUtils.UNIT })
    public void testDistribution2TargetAssociations() {
        initializeRepositoryAdmin();
        DistributionObject d1 = createBasicDistributionObject("distribution1");
        TargetObject t1 = createBasicTargetObject("target1");
        m_distribution2TargetRepository.create(d1, t1);

        assert d1.getFeatures().size() == 0 : "Distribution 1 should not be associated with any features; it is associated with " + d1.getFeatures().size() + ".";
        assert d1.getTargets().size() == 1 : "Distribution 1 should be associated with exactly one target; it is associated with " + d1.getTargets().size() + ".";

        assert t1.getDistributions().size() == 1 : "Target 1 should be associated with exactly one distribution; it is associated with " + t1.getDistributions().size() + ".";
    }
View Full Code Here

     */
    @Test(groups = { TestUtils.UNIT })
    public void TestFeature2DistributionAssociations() {
        initializeRepositoryAdmin();
        FeatureObject f1 = createBasicFeatureObject("feature1");
        DistributionObject d1 = createBasicDistributionObject("distribution1");
        Feature2DistributionAssociation f2d1 = m_feature2DistributionRepository.create(f1, d1);

        assert (f2d1.getLeft().size() == 1) && f2d1.getLeft().contains(f1) : "Left side of the association should be our feature.";
        assert (f2d1.getRight().size() == 1) && f2d1.getRight().contains(d1) : "Right side of the association should be our distribution.";

        assert f1.getArtifacts().size() == 0 : "Feature 1 should not be associated with any artifacts; it is associated with " + f1.getArtifacts().size() + ".";
        assert f1.getDistributions().size() == 1 : "Feature 1 should be associated with exactly one distribution; it is associated with " + f1.getDistributions().size() + ".";

        assert d1.getFeatures().size() == 1 : "Distribution 1 should be associated with exactly one feature; it is associated with " + d1.getFeatures().size() + ".";
        assert d1.getTargets().size() == 0 : "Distribution 1 should not be associated with any targets; it is associated with " + d1.getTargets().size() + ".";
    }
View Full Code Here

TOP

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

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.