예제 #1
0
            public void Run(RegressionEnvironment env)
            {
                EPStage stageA = env.StageService.GetStage("ST");

                env.CompileDeploy("@Name('s0') select * from SupportBean");
                string deploymentId = env.DeploymentId("s0");

                StageIt(env, "ST", deploymentId);
                try {
                    stageA.Destroy();
                    Assert.Fail();
                }
                catch (EPException ex) {
                    Assert.AreEqual("Failed to destroy stage 'ST': The stage has existing deployments", ex.Message);
                }

                UnstageIt(env, "ST", deploymentId);

                stageA.Destroy();
                Assert.AreEqual("ST", stageA.URI);

                TryInvalidDestroyed(() => Noop(stageA.EventService));
                TryInvalidDestroyed(() => Noop(stageA.DeploymentService));

                TryInvalidDestroyed(
                    () => {
                    try {
                        stageA.Stage(Collections.SingletonList(deploymentId));
                    }
                    catch (EPStageException ex) {
                        throw new EPRuntimeException(ex);
                    }
                });

                TryInvalidDestroyed(
                    () => {
                    try {
                        stageA.Unstage(Collections.SingletonList(deploymentId));
                    }
                    catch (EPStageException ex) {
                        throw new EPRuntimeException(ex);
                    }
                });

                env.UndeployAll();
            }
예제 #2
0
        public RegressionEnvironment UndeployAll()
        {
            Runtime.DeploymentService.UndeployAll();

            string[] stageURIs = Runtime.StageService.StageURIs;
            foreach (string uri in stageURIs) {
                EPStage stage = Runtime.StageService.GetExistingStage(uri);
                stage.Destroy();
            }

            return this;
        }