Search in sources :

Example 1 with MkClusterParam

use of org.apache.storm.testing.MkClusterParam in project open-kilda by telstra.

the class StableAbstractStormTest method setupOnce.

@BeforeClass
public static void setupOnce() throws Exception {
    System.out.println("------> Creating Sheep \uD83D\uDC11\n");
    clusterParam = new MkClusterParam();
    clusterParam.setSupervisors(1);
    Config daemonConfig = new Config();
    daemonConfig.put(Config.STORM_LOCAL_MODE_ZMQ, false);
    clusterParam.setDaemonConf(daemonConfig);
    makeConfigFile();
    Config conf = new Config();
    conf.setNumWorkers(1);
    completeTopologyParam = new CompleteTopologyParam();
    completeTopologyParam.setStormConf(conf);
}
Also used : Config(org.apache.storm.Config) CompleteTopologyParam(org.apache.storm.testing.CompleteTopologyParam) MkClusterParam(org.apache.storm.testing.MkClusterParam) BeforeClass(org.junit.BeforeClass)

Example 2 with MkClusterParam

use of org.apache.storm.testing.MkClusterParam in project open-kilda by telstra.

the class TopologyTest method verifyEmittedValues.

@Test
public void verifyEmittedValues() {
    MkClusterParam clusterParam = new MkClusterParam();
    clusterParam.setSupervisors(1);
    withSimulatedTimeLocalCluster(clusterParam, new TestJob() {

        @Override
        public void run(ILocalCluster cluster) throws JsonProcessingException {
            MockedSources mockedSources = new MockedSources();
            mockedSources.addMockData(builder.getSpoutId(), new Values(SWITCH_ID));
            Config config = new Config();
            config.setDebug(true);
            CompleteTopologyParam topologyParam = new CompleteTopologyParam();
            topologyParam.setMockedSources(mockedSources);
            topologyParam.setStormConf(config);
            Map<?, ?> result = completeTopology(cluster, builder.build(), topologyParam);
            assertTrue(multiseteq(new Values(new Values(SWITCH_ID)), readTuples(result, builder.getSpoutId())));
            assertTrue(multiseteq(new Values(new Values(SWITCH_ID)), readTuples(result, builder.getConfirmationBoltId())));
        }
    });
}
Also used : ILocalCluster(org.apache.storm.ILocalCluster) MockedSources(org.apache.storm.testing.MockedSources) TestJob(org.apache.storm.testing.TestJob) Config(org.apache.storm.Config) CompleteTopologyParam(org.apache.storm.testing.CompleteTopologyParam) Values(org.apache.storm.tuple.Values) MkClusterParam(org.apache.storm.testing.MkClusterParam) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) Map(java.util.Map) Test(org.junit.Test)

Example 3 with MkClusterParam

use of org.apache.storm.testing.MkClusterParam in project storm by apache.

the class TestingTest method testCompleteTopologyNetty.

@Test
public void testCompleteTopologyNetty() throws Exception {
    Config daemonConf = new Config();
    daemonConf.put(Config.STORM_LOCAL_MODE_ZMQ, true);
    MkClusterParam param = new MkClusterParam();
    param.setSupervisors(4);
    param.setDaemonConf(daemonConf);
    Testing.withLocalCluster(param, COMPLETE_TOPOLOGY_TESTJOB);
}
Also used : MkClusterParam(org.apache.storm.testing.MkClusterParam) IntegrationTest(org.apache.storm.testing.IntegrationTest) Test(org.junit.jupiter.api.Test)

Example 4 with MkClusterParam

use of org.apache.storm.testing.MkClusterParam in project storm by apache.

the class TestingTest method testCompleteTopologyLocal.

@Test
public void testCompleteTopologyLocal() throws Exception {
    MkClusterParam param = new MkClusterParam();
    param.setSupervisors(4);
    Testing.withLocalCluster(param, COMPLETE_TOPOLOGY_TESTJOB);
}
Also used : MkClusterParam(org.apache.storm.testing.MkClusterParam) IntegrationTest(org.apache.storm.testing.IntegrationTest) Test(org.junit.jupiter.api.Test)

Example 5 with MkClusterParam

use of org.apache.storm.testing.MkClusterParam in project storm by apache.

the class TestingTest method testCompleteTopologyNettySimulated.

@Test
public void testCompleteTopologyNettySimulated() throws Exception {
    Config daemonConf = new Config();
    daemonConf.put(Config.STORM_LOCAL_MODE_ZMQ, true);
    MkClusterParam param = new MkClusterParam();
    param.setSupervisors(4);
    param.setDaemonConf(daemonConf);
    Testing.withSimulatedTimeLocalCluster(param, COMPLETE_TOPOLOGY_TESTJOB);
}
Also used : MkClusterParam(org.apache.storm.testing.MkClusterParam) IntegrationTest(org.apache.storm.testing.IntegrationTest) Test(org.junit.jupiter.api.Test)

Aggregations

MkClusterParam (org.apache.storm.testing.MkClusterParam)8 Config (org.apache.storm.Config)4 CompleteTopologyParam (org.apache.storm.testing.CompleteTopologyParam)4 IntegrationTest (org.apache.storm.testing.IntegrationTest)4 Test (org.junit.jupiter.api.Test)4 ILocalCluster (org.apache.storm.ILocalCluster)2 MockedSources (org.apache.storm.testing.MockedSources)2 TestJob (org.apache.storm.testing.TestJob)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 IOException (java.io.IOException)1 Map (java.util.Map)1 UUID (java.util.UUID)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 IgniteCache (org.apache.ignite.IgniteCache)1 CacheEvent (org.apache.ignite.events.CacheEvent)1 IgniteBiPredicate (org.apache.ignite.lang.IgniteBiPredicate)1 StormTopology (org.apache.storm.generated.StormTopology)1 TopologyBuilder (org.apache.storm.topology.TopologyBuilder)1 Values (org.apache.storm.tuple.Values)1 BeforeClass (org.junit.BeforeClass)1