@@ -0,0 +1,1929 @@
+/*%0A# Licensed Materials - Property of IBM%0A# Copyright IBM Corp. 2015  %0A */%0Apackage com.ibm.streamsx.topology.test.jcp;%0A%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.junit.Assume.assumeTrue;%0A%0Aimport java.util.Collections;%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport com.ibm.streamsx.topology.TStream;%0Aimport com.ibm.streamsx.topology.Topology;%0Aimport com.ibm.streamsx.topology.context.StreamsContext;%0Aimport com.ibm.streamsx.topology.test.TestTopology;%0Aimport com.ibm.streamsx.topology.tester.Condition;%0A%0Apublic class JCPTest extends TestTopology %7B%0A    %0A    @Before%0A    public void ensureDistributed() %7B%0A        assumeTrue(getTesterType() == StreamsContext.Type.DISTRIBUTED_TESTER);%0A        assumeTrue(SC_OK);%0A    %7D%0A    %0A    @Test%0A    public void testJCP() throws Exception %7B%0A        %0A        Topology topology = newTopology(%22testSingleJCP%22);%0A        topology.addJobControlPlane();%0A        %0A        submitAndCheckJCPIsThere(topology);        %0A    %7D%0A    %0A    /**%0A     * TODO - Add some mechanism to check that the JCP is indeed there!%0A     */%0A    private void submitAndCheckJCPIsThere(Topology topology) throws Exception %7B%0A        %0A        TStream%3CString%3E strings = topology.constants(Collections.singletonList(%22Hello JCP!%22));%0A        %0A        Condition%3CLong%3E end = topology.getTester().tupleCount(strings, 1);%0A        complete(topology.getTester(), end, 10, TimeUnit.SECONDS);      %0A    %7D%0A    %0A    /**%0A     * Test that calling addJobControlPlane doesn't result%0A     * in multiple invocations of the SPL JobControlPlane operator.%0A     * @throws Exception%0A     */%0A    @Test%0A    public void testMultiJCPCalls() throws Exception %7B%0A        %0A        Topology topology = newTopology(%22testMultiJCPCalls%22);%0A        %0A        for (int i = 0 ; i %3C 10; i++)%0A            topology.addJobControlPlane();%0A              %0A        submitAndCheckJCPIsThere(topology);        %0A    %7D%0A%7D%0A

Add (minimal) testing of JCP