Search in sources :

Example 1 with Blob

use of com.ibm.streams.operator.types.Blob in project streamsx.topology by IBMStreams.

the class PublishSubscribeTest method testFilterOnBlob.

@Test(expected = IllegalArgumentException.class)
public void testFilterOnBlob() throws Exception {
    final Topology t = new Topology();
    TStream<Blob> blobs = t.constants(Collections.<Blob>emptyList()).asType(Blob.class);
    blobs.publish("sometopic", true);
}
Also used : Blob(com.ibm.streams.operator.types.Blob) Topology(com.ibm.streamsx.topology.Topology) TestTopology(com.ibm.streamsx.topology.test.TestTopology) Test(org.junit.Test)

Example 2 with Blob

use of com.ibm.streams.operator.types.Blob in project streamsx.topology by IBMStreams.

the class BlobTupleTest method testConstant.

@Test
public void testConstant() throws Exception {
    final Topology topology = newTopology();
    String sdata = "YY" + BlobTupleTest.class.getName();
    byte[] data = sdata.getBytes(StandardCharsets.UTF_8);
    Blob blob = ValueFactory.newBlob(data, 0, data.length);
    TStream<Blob> source = topology.constants(Collections.singletonList(blob)).asType(Blob.class);
    assertNotNull(source);
    assertEquals(Blob.class, source.getTupleClass());
    assertEquals(Blob.class, source.getTupleType());
    TStream<String> out = convertBlobToString(source);
    completeAndValidate(out, 10, sdata);
}
Also used : Blob(com.ibm.streams.operator.types.Blob) Topology(com.ibm.streamsx.topology.Topology) TestTopology(com.ibm.streamsx.topology.test.TestTopology) Test(org.junit.Test)

Aggregations

Blob (com.ibm.streams.operator.types.Blob)2 Topology (com.ibm.streamsx.topology.Topology)2 TestTopology (com.ibm.streamsx.topology.test.TestTopology)2 Test (org.junit.Test)2