Search in sources :

Example 36 with Topology

use of com.ibm.streamsx.topology.Topology in project streamsx.topology by IBMStreams.

the class KafkaStreamsTest method testSubscribeNullTopic.

@Test(expected = IllegalArgumentException.class)
public void testSubscribeNullTopic() throws Exception {
    Topology top = new Topology("testSubscribeNullTopic");
    KafkaConsumer consumer = new KafkaConsumer(top, createConsumerConfig("group"));
    // throws IAE
    consumer.subscribe(null);
}
Also used : KafkaConsumer(com.ibm.streamsx.topology.messaging.kafka.KafkaConsumer) Topology(com.ibm.streamsx.topology.Topology) TestTopology(com.ibm.streamsx.topology.test.TestTopology) Test(org.junit.Test)

Example 37 with Topology

use of com.ibm.streamsx.topology.Topology in project streamsx.topology by IBMStreams.

the class KafkaStreamsTest method testSubscribeNegThreadsPerTopic.

@Test(expected = IllegalArgumentException.class)
public void testSubscribeNegThreadsPerTopic() throws Exception {
    Topology top = new Topology("testSubscribeNegThreadsPerTopic");
    KafkaConsumer consumer = new KafkaConsumer(top, createConsumerConfig("group"));
    // throws IAE
    consumer.subscribe(new Value<Integer>(-1), new Value<String>("topic"));
}
Also used : KafkaConsumer(com.ibm.streamsx.topology.messaging.kafka.KafkaConsumer) Topology(com.ibm.streamsx.topology.Topology) TestTopology(com.ibm.streamsx.topology.test.TestTopology) Test(org.junit.Test)

Example 38 with Topology

use of com.ibm.streamsx.topology.Topology in project streamsx.topology by IBMStreams.

the class KafkaStreamsTest method testConfigParams.

@Test
public void testConfigParams() throws Exception {
    Topology top = new Topology("testConfigParams");
    String groupId = newGroupId(top.getName());
    Map<String, Object> producerConfig = createProducerConfig();
    Map<String, Object> consumerConfig = createConsumerConfig(groupId);
    KafkaProducer producer = new KafkaProducer(top, producerConfig);
    Map<String, Object> pcfg = producer.getConfig();
    for (Object o : producerConfig.keySet()) assertEquals("property " + o, producerConfig.get(o), pcfg.get(o));
    KafkaConsumer consumer = new KafkaConsumer(top, consumerConfig);
    Map<String, Object> ccfg = consumer.getConfig();
    for (Object o : consumerConfig.keySet()) assertEquals("property " + o, consumerConfig.get(o), ccfg.get(o));
}
Also used : KafkaProducer(com.ibm.streamsx.topology.messaging.kafka.KafkaProducer) KafkaConsumer(com.ibm.streamsx.topology.messaging.kafka.KafkaConsumer) JSONObject(com.ibm.json.java.JSONObject) Topology(com.ibm.streamsx.topology.Topology) TestTopology(com.ibm.streamsx.topology.test.TestTopology) Test(org.junit.Test)

Example 39 with Topology

use of com.ibm.streamsx.topology.Topology in project streamsx.topology by IBMStreams.

the class FileStreamsTest method testDirectoryWatcherOrderWithDelete.

@Test
public void testDirectoryWatcherOrderWithDelete() throws Exception {
    final Topology t = new Topology("testDirectoryWatcherOrder");
    runDirectoryWatcher(t, 20, 3);
}
Also used : Topology(com.ibm.streamsx.topology.Topology) TestTopology(com.ibm.streamsx.topology.test.TestTopology) Test(org.junit.Test)

Example 40 with Topology

use of com.ibm.streamsx.topology.Topology in project streamsx.topology by IBMStreams.

the class JCPTest method testJCP.

@Test
public void testJCP() throws Exception {
    Topology topology = newTopology("testSingleJCP");
    topology.addJobControlPlane();
    submitAndCheckJCPIsThere(topology);
}
Also used : Topology(com.ibm.streamsx.topology.Topology) TestTopology(com.ibm.streamsx.topology.test.TestTopology) Test(org.junit.Test)

Aggregations

Topology (com.ibm.streamsx.topology.Topology)282 TestTopology (com.ibm.streamsx.topology.test.TestTopology)235 Test (org.junit.Test)227 List (java.util.List)80 Tester (com.ibm.streamsx.topology.tester.Tester)75 SPLStream (com.ibm.streamsx.topology.spl.SPLStream)53 ArrayList (java.util.ArrayList)50 HashMap (java.util.HashMap)33 JSONObject (com.ibm.json.java.JSONObject)25 TStream (com.ibm.streamsx.topology.TStream)23 Message (com.ibm.streamsx.topology.tuple.Message)20 SimpleMessage (com.ibm.streamsx.topology.tuple.SimpleMessage)20 Random (java.util.Random)19 StreamsContext (com.ibm.streamsx.topology.context.StreamsContext)16 File (java.io.File)16 Map (java.util.Map)16 OutputTuple (com.ibm.streams.operator.OutputTuple)14 StreamSchema (com.ibm.streams.operator.StreamSchema)14 Value (com.ibm.streamsx.topology.logic.Value)14 Condition (com.ibm.streamsx.topology.tester.Condition)14