use of com.ibm.streamsx.topology.Topology in project streamsx.topology by IBMStreams.
the class PublishSubscribeSPLTest method testSPLPublishNoFilterWithSubscribe.
/**
* Test that with publish allow filter set to false
* a subscriber without a filter gets the full set of data.
*/
@Test
public void testSPLPublishNoFilterWithSubscribe() throws Exception {
final Topology t = new Topology();
SPLStream source = SPLStreamsTest.testTupleStream(t);
source = addStartupDelay(source);
final String topic = uniqueTopic("SPLNoFilter");
source.publish(topic, false);
SPLStream sub = SPLStreams.subscribe(t, topic, source.getSchema());
TStream<String> subscribe = sub.transform(new GetTupleId());
completeAndValidate(subscribe, 20, "SPL:0", "SPL:1", "SPL:2", "SPL:3");
}
use of com.ibm.streamsx.topology.Topology in project streamsx.topology by IBMStreams.
the class PublishSubscribeTopicNames method testNullTopicNameParam.
@Test(expected = NullPointerException.class)
public void testNullTopicNameParam() throws Exception {
final Topology t = new Topology();
t.strings().publish((Supplier<String>) null);
}
use of com.ibm.streamsx.topology.Topology in project streamsx.topology by IBMStreams.
the class PublishSubscribeTopicNames method testWildcardPlus1TopicName.
@Test(expected = IllegalArgumentException.class)
public void testWildcardPlus1TopicName() throws Exception {
final Topology t = new Topology();
t.strings().publish("+", true);
}
use of com.ibm.streamsx.topology.Topology in project streamsx.topology by IBMStreams.
the class JobConfigOverlaysFileTest method testStandalone.
@Test
public void testStandalone() throws Exception {
// Just a simple graph, which won't be executed.
Topology topology = newTopology("testNoConfig");
topology.constants(Collections.emptyList());
@SuppressWarnings("unchecked") StreamsContext<File> sb = (StreamsContext<File>) StreamsContextFactory.getStreamsContext(Type.STANDALONE_BUNDLE);
sab = sb.submit(topology).get();
String jconame = sab.getName().replace(".sab", "_JobConfig.json");
jcos = new File(sab.getParentFile(), jconame);
assertFalse(jcos.exists());
}
use of com.ibm.streamsx.topology.Topology in project streamsx.topology by IBMStreams.
the class JobConfigOverlaysFileTest method testJobConfigOther.
@Test
public void testJobConfigOther() throws Exception {
// Just a simple graph, which won't be executed.
Topology topology = newTopology("testJobConfigOther");
topology.constants(Collections.emptyList());
Map<String, Object> cfg = new HashMap<>();
{
JobConfig jc = new JobConfig();
jc.addToConfig(cfg);
jc.setDataDirectory("/tmp/abc");
jc.setPreloadApplicationBundles(true);
jc.setTracing(Level.INFO);
assertEquals("info", jc.getStreamsTracing());
}
sab = bundler().submit(topology, cfg).get();
JsonObject jcos = assertSabGetJcos(topology);
assertDefaultDeployment(jcos);
JsonObject jco = jobConfigOverlay(jcos);
assertMissing(jco, "operatorConfigs");
assertMissing(jco, "configInstructions");
assertTrue(jco.has("jobConfig"));
assertTrue(jco.get("jobConfig").isJsonObject());
JsonObject jc = jco.get("jobConfig").getAsJsonObject();
assertMissing(jc, "jobName");
assertMissing(jc, "jobGroup");
assertJsonString(jc, "dataDirectory", "/tmp/abc");
assertJsonBoolean(jc, "preloadApplicationBundles", true);
assertJsonString(jc, "tracing", "info");
assertEquals(3, jc.entrySet().size());
}
Aggregations