Search in sources :

Example 41 with StreamManager

use of co.cask.cdap.test.StreamManager in project cdap by caskdata.

the class FlowStreamIntegrationTestRun method testStreamFromOtherNamespaceBatch.

@Test
public void testStreamFromOtherNamespaceBatch() throws Exception {
    NamespaceId streamSpace = new NamespaceId("streamSpace");
    getNamespaceAdmin().create(new NamespaceMeta.Builder().setName(streamSpace).build());
    // Deploy an app to add a stream in streamSpace
    deployApplication(streamSpace, TestFlowStreamIntegrationAcrossNSApp.class);
    ApplicationManager applicationManager = deployApplication(TestFlowStreamIntegrationAcrossNSApp.class);
    StreamManager s1 = getStreamManager(streamSpace.stream("s1"));
    StreamManager s1Default = getStreamManager("s1");
    // Send to both stream
    for (int i = 0; i < 50; i++) {
        s1.send(String.valueOf(i));
        s1Default.send(String.valueOf(i));
    }
    FlowManager flowManager = applicationManager.getFlowManager("StreamAcrossNSTestFlow");
    submitAndVerifyFlowProgram(flowManager);
}
Also used : FlowManager(co.cask.cdap.test.FlowManager) ApplicationManager(co.cask.cdap.test.ApplicationManager) NamespaceMeta(co.cask.cdap.proto.NamespaceMeta) StreamManager(co.cask.cdap.test.StreamManager) NamespaceId(co.cask.cdap.proto.id.NamespaceId) Test(org.junit.Test)

Aggregations

StreamManager (co.cask.cdap.test.StreamManager)41 ApplicationManager (co.cask.cdap.test.ApplicationManager)35 Test (org.junit.Test)33 FlowManager (co.cask.cdap.test.FlowManager)17 ServiceManager (co.cask.cdap.test.ServiceManager)15 KeyValueTable (co.cask.cdap.api.dataset.lib.KeyValueTable)14 SparkManager (co.cask.cdap.test.SparkManager)13 RuntimeMetrics (co.cask.cdap.api.metrics.RuntimeMetrics)12 URL (java.net.URL)12 MapReduceManager (co.cask.cdap.test.MapReduceManager)9 Gson (com.google.gson.Gson)6 HttpURLConnection (java.net.HttpURLConnection)6 Action (co.cask.cdap.proto.security.Action)5 Category (org.junit.experimental.categories.Category)5 NamespaceMeta (co.cask.cdap.proto.NamespaceMeta)4 InMemoryAuthorizer (co.cask.cdap.security.authorization.InMemoryAuthorizer)4 Authorizer (co.cask.cdap.security.spi.authorization.Authorizer)4 Table (co.cask.cdap.api.dataset.table.Table)3 StreamId (co.cask.cdap.proto.id.StreamId)3 HttpRequest (co.cask.common.http.HttpRequest)3