Search in sources :

Example 81 with Topology

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

the class PublishSubscribeTopicNames method testEmptyTopicName.

@Test(expected = IllegalArgumentException.class)
public void testEmptyTopicName() throws Exception {
    final Topology t = new Topology();
    t.strings().publish("", true);
}
Also used : Topology(com.ibm.streamsx.topology.Topology) TestTopology(com.ibm.streamsx.topology.test.TestTopology) Test(org.junit.Test)

Example 82 with Topology

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

the class PublishSubscribeTopicNames method testWildcardHash1TopicName.

@Test(expected = IllegalArgumentException.class)
public void testWildcardHash1TopicName() throws Exception {
    final Topology t = new Topology();
    t.strings().publish("engine/#", true);
}
Also used : Topology(com.ibm.streamsx.topology.Topology) TestTopology(com.ibm.streamsx.topology.test.TestTopology) Test(org.junit.Test)

Example 83 with Topology

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

the class PublishSubscribeWildcard method wildcardSingle.

/**
 * Tests subscribing to a single stream with a wildcard filter.
 * @param topicName
 * @param topicFilter
 * @throws Exception
 */
private void wildcardSingle(String topicName, String topicFilter, String... nonMatchTopics) throws Exception {
    Topology t = new Topology();
    List<String> data = publish(t, topicName, "P", nonMatchTopics.length);
    for (String nonMatchTopic : nonMatchTopics) {
        publishPoll(t, nonMatchTopic);
    }
    TStream<String> subscribe = t.subscribe(topicFilter, String.class);
    completeAndValidate(subscribe, 30, data.toArray(new String[0]));
}
Also used : Topology(com.ibm.streamsx.topology.Topology) TestTopology(com.ibm.streamsx.topology.test.TestTopology)

Example 84 with Topology

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

the class FileStreamsTest method testDirectoryWatcherOrder.

/**
 * Test that directory watcher creates the correct output.
 */
@Test
public void testDirectoryWatcherOrder() throws Exception {
    assumeTrue(this.getTesterType() == Type.STANDALONE_TESTER);
    final Topology t = newTopology("testDirectoryWatcherOrder");
    runDirectoryWatcher(t, 20, 1);
}
Also used : Topology(com.ibm.streamsx.topology.Topology) TestTopology(com.ibm.streamsx.topology.test.TestTopology) Test(org.junit.Test)

Example 85 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 {
    assumeTrue(this.getTesterType() == Type.STANDALONE_TESTER);
    final Topology t = newTopology("testDirectoryWatcherOrderWithDelete");
    runDirectoryWatcher(t, 20, 3);
}
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)372 TestTopology (com.ibm.streamsx.topology.test.TestTopology)315 Test (org.junit.Test)301 List (java.util.List)116 Tester (com.ibm.streamsx.topology.tester.Tester)115 ArrayList (java.util.ArrayList)70 SPLStream (com.ibm.streamsx.topology.spl.SPLStream)68 HashMap (java.util.HashMap)49 TStream (com.ibm.streamsx.topology.TStream)42 Condition (com.ibm.streamsx.topology.tester.Condition)28 File (java.io.File)27 TimeUnit (java.util.concurrent.TimeUnit)27 StreamSchema (com.ibm.streams.operator.StreamSchema)26 Random (java.util.Random)26 JSONObject (com.ibm.json.java.JSONObject)23 HashSet (java.util.HashSet)23 RString (com.ibm.streams.operator.types.RString)21 StreamsContext (com.ibm.streamsx.topology.context.StreamsContext)21 Message (com.ibm.streamsx.topology.tuple.Message)20 SimpleMessage (com.ibm.streamsx.topology.tuple.SimpleMessage)20