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

                TryIllegalArgument(() => stageA.Stage(null));
                TryOp(() => stageA.Stage(EmptyList <string> .Instance));
                TryIllegalArgument(() => stageA.Stage(Arrays.AsList(new string[] { null })));
                TryIllegalArgument(() => stageA.Stage(Arrays.AsList(new string[] { "a", null })));

                TryIllegalArgument(() => stageA.Unstage(null));
                TryOp(() => stageA.Unstage(EmptyList <string> .Instance));
                TryIllegalArgument(() => stageA.Unstage(Arrays.AsList(new string[] { null })));
                TryIllegalArgument(() => stageA.Unstage(Arrays.AsList(new string[] { "a", null })));

                TryDeploymentNotFound(() => stageA.Stage(Arrays.AsList(new string[] { "x" })), "Deployment 'x' was not found");
                TryDeploymentNotFound(() => stageA.Unstage(Arrays.AsList(new string[] { "x" })), "Deployment 'x' was not found");
            }
Exemple #2
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();
            }