public String deployGetId(EPCompiled compiled) { try { return runtime().getDeploymentService().deploy(compiled).getDeploymentId(); } catch (EPDeployException ex) { throw notExpected(ex); } }
public void run(RegressionEnvironment env) { EPCompiled compiled = env.readCompile("regression/test_module_9.epl"); EPDeployment result; try { result = env.runtime().getDeploymentService().deploy(compiled); } catch (EPDeployException ex) { throw new RuntimeException(ex); } assertTrue(env.runtime().getDeploymentService().isDeployed(result.getDeploymentId())); assertNotNull(result.getDeploymentId()); assertEquals(2, result.getStatements().length); assertEquals(1, env.deployment().getDeployments().length); assertEquals("@Name(\"StmtOne\")" + NEWLINE + "create schema MyEvent(id String, val1 int, val2 int)", env.statement("StmtOne").getProperty(StatementProperty.EPL)); assertEquals("@Name(\"StmtTwo\")" + NEWLINE + "select * from MyEvent", env.statement("StmtTwo").getProperty(StatementProperty.EPL)); assertEquals(0, result.getDeploymentIdDependencies().length); env.undeployAll(); assertFalse(env.runtime().getDeploymentService().isDeployed(result.getDeploymentId())); } }
EPDeployment deployed = env.deployment().deploy(compiledTwo); SupportCompileDeployUtil.threadSleep(200); env.undeploy(deployed.getDeploymentId()); } catch (Throwable ex) { throw new RuntimeException(ex);
EsperIOHTTPUpdateListener subs = new EsperIOHTTPUpdateListener(request.getStream(), request.getUri()); EPDeployment deployment = compileDeploySubscription(runtime, request.getStream(), request.getUri()); deployments.add(deployment.getDeploymentId()); deployment.getStatements()[0].addListener(subs); } catch (Throwable t) {
EPStatement stmtCount = runtime.getDeploymentService().getStatement(deployed.getDeploymentId(), "count"); stmtCount.addListener(new UpdateListener() { public void update(EventBean[] newEvents, EventBean[] oldEvents, EPStatement statement, EPRuntime runtime) { EPStatement stmtAlert = runtime.getDeploymentService().getStatement(deployed.getDeploymentId(), "out"); stmtAlert.addListener(listener);
public void update(EventBean[] newEvents, EventBean[] oldEvents, EPStatement statement, EPRuntime runtime) { isCalled = true; try { // create statement for thread - this can be called multiple times as other threads send SupportBean EPDeployment deployment; try { deployment = env.runtime().getDeploymentService().deploy(compiled); } catch (EPDeployException e) { throw new RuntimeException(e); } SupportMTUpdateListener listener = new SupportMTUpdateListener(); deployment.getStatements()[0].addListener(listener); Object theEvent = new SupportMarketDataBean("", 0, (long) numThread, null); env.sendEventBean(theEvent, theEvent.getClass().getSimpleName()); env.runtime().getDeploymentService().undeploy(deployment.getDeploymentId()); EventBean[] eventsReceived = listener.getNewDataListFlattened(); boolean found = false; for (int i = 0; i < eventsReceived.length; i++) { if (eventsReceived[i].getUnderlying() == theEvent) { found = true; } } Assert.assertTrue(found); } catch (Throwable t) { lastException = t; } }
EsperIODBUpdateListener subs = new EsperIODBUpdateListener(upsertFactory, executorFactory.getConfiguredExecutor(upsert.getExecutorName())); EPDeployment deployment = compileDeploySubscription(runtime, upsert.getStream(), upsertFactory.getContext().getName()); deployments.add(deployment.getDeploymentId()); deployment.getStatements()[0].addListener(subs); } catch (Throwable t) { EsperIODBUpdateListener subs = new EsperIODBUpdateListener(dmlFactory, executorFactory.getConfiguredExecutor(dml.getExecutorName())); EPDeployment deployment = compileDeploySubscription(runtime, dml.getStream(), dmlFactory.getContext().getName()); deployments.add(deployment.getDeploymentId()); deployment.getStatements()[0].addListener(subs); } catch (Throwable t) {
env.undeploy(deploymentResult.getDeploymentId());
EPDeployment deplomentInfo = env.deployment().getDeployment(deployed.getDeploymentId()); assertEquals("regression.test", deplomentInfo.getModuleName()); assertEquals(2, deplomentInfo.getStatements().length);
assertEquals(runtime.getURI(), ehc.getRuntimeURI()); assertEquals(epl, ehc.getEpl()); assertEquals(deployment.getDeploymentId(), ehc.getDeploymentId()); assertEquals("ABCName", ehc.getStatementName()); assertEquals("Sample exception", ehc.getThrowable().getMessage());
runtime.getDeploymentService().undeploy(deployed.getDeploymentId()); theEvent = makeEvent(); ThreadLogUtil.trace("send non-matching event ", theEvent);
runtime.getDeploymentService().getStatement(deployed.getDeploymentId(), "out").addListener(listener);