Package org.apache.ivory.entity.store

Examples of org.apache.ivory.entity.store.ConfigurationStore


        assertEquals("${"+process.getOutputs().getOutputs().get(0).getInstance()+"}", coord.getOutputEvents().getDataOut().get(0).getInstance());
        assertEquals(process.getOutputs().getOutputs().get(0).getName(), coord.getOutputEvents().getDataOut().get(0).getDataset());

        assertEquals(6, coord.getDatasets().getDatasetOrAsyncDataset().size());
       
        ConfigurationStore store = ConfigurationStore.get();
        Feed feed = store.get(EntityType.FEED, process.getInputs().getInputs().get(0).getFeed());
        SYNCDATASET ds = (SYNCDATASET) coord.getDatasets().getDatasetOrAsyncDataset().get(0);
        assertEquals(SchemaHelper.formatDateUTC(feed.getClusters().getClusters().get(0).getValidity().getStart()), ds.getInitialInstance());
        assertEquals(feed.getTimezone().getID(), ds.getTimezone());
        assertEquals("${coord:"+feed.getFrequency().toString()+"}", ds.getFrequency());
        assertEquals("", ds.getDoneFlag());
View Full Code Here


    private static final String CLUSTER_XML = "/config/cluster/cluster-0.1.xml";
   
   
    private void storeEntity(EntityType type, String name) throws Exception {
        Unmarshaller unmarshaller = type.getUnmarshaller();
        ConfigurationStore store = ConfigurationStore.get();
        store.remove(type, name);
        switch(type) {
            case CLUSTER:
                Cluster cluster = (Cluster) unmarshaller.unmarshal(this.getClass().getResource(CLUSTER_XML));
                cluster.setName(name);
                store.publish(type, cluster);
                break;
               
            case FEED:
                Feed feed = (Feed) unmarshaller.unmarshal(this.getClass().getResource(FEED_XML));
                feed.setName(name);
                store.publish(type, feed);
                break;
               
            case PROCESS:
                Process process = (Process) unmarshaller.unmarshal(this.getClass().getResource(PROCESS_XML));
                process.setName(name);
                store.publish(type, process);
                break;
        }
    }
View Full Code Here

        storeEntity(EntityType.FEED, "clicksummary");
        storeEntity(EntityType.PROCESS, "clicksummary");
    }   
   
    public void cleanup() throws Exception {
        ConfigurationStore store = ConfigurationStore.get();
        store.remove(EntityType.PROCESS, "clicksummary");
        store.remove(EntityType.FEED, "clicksummary");
        store.remove(EntityType.FEED, "impressions");
        store.remove(EntityType.FEED, "clicks");
        store.remove(EntityType.CLUSTER, "corp");
    }
View Full Code Here

    @Test
    public void testMapping() throws Exception {
        Cluster cluster1 = newCluster("cluster1", "colo1");
        Cluster cluster2 = newCluster("cluster2", "colo1");
        Cluster cluster3 = newCluster("cluster3", "colo2");
        ConfigurationStore store = ConfigurationStore.get();
        store.publish(EntityType.CLUSTER, cluster1);
        store.publish(EntityType.CLUSTER, cluster2);
        store.publish(EntityType.CLUSTER, cluster3);
       
        ColoClusterRelation relation = ColoClusterRelation.get();
        Set<String> clusters = relation.getClusters("colo1");
        Assert.assertNotNull(clusters);
        Assert.assertEquals(2, clusters.size());
        Assert.assertTrue(clusters.contains(cluster1.getName()));
        Assert.assertTrue(clusters.contains(cluster2.getName()));
       
        clusters = relation.getClusters("colo2");
        Assert.assertNotNull(clusters);
        Assert.assertEquals(1, clusters.size());
        Assert.assertTrue(clusters.contains(cluster3.getName()));

        store.remove(EntityType.CLUSTER, cluster1.getName());
        clusters = relation.getClusters("colo1");
        Assert.assertNotNull(clusters);
        Assert.assertEquals(1, clusters.size());
        Assert.assertTrue(clusters.contains(cluster2.getName()));
       
        store.remove(EntityType.CLUSTER, cluster2.getName());
        clusters = relation.getClusters("colo1");
        Assert.assertNotNull(clusters);
        Assert.assertEquals(0, clusters.size());
    }
View Full Code Here

  private Feed modifiableFeed;

  @BeforeMethod
  public void setUp() throws Exception {
      cleanupStore();
      ConfigurationStore store = ConfigurationStore.get();
     
    Unmarshaller unmarshaller = EntityType.CLUSTER.getUnmarshaller();
    Cluster cluster = (Cluster) unmarshaller.unmarshal(this.getClass()
        .getResourceAsStream(CLUSTER_XML));
    cluster.setName("testCluster");
    store.publish(EntityType.CLUSTER, cluster);

    cluster = (Cluster) unmarshaller.unmarshal(this.getClass()
        .getResourceAsStream(CLUSTER_XML));
    cluster.setName("backupCluster");
    store.publish(EntityType.CLUSTER, cluster);

    modifiableFeed = (Feed) parser.parseAndValidate(this.getClass()
        .getResourceAsStream(FEED_XML));
  }
View Full Code Here

TOP

Related Classes of org.apache.ivory.entity.store.ConfigurationStore

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.