コード例 #1
0
        private static void RunAssertionConversionConfiguredType(
            RegressionEnvironment env,
            RegressionPath path,
            string typeNameTarget,
            string functionName,
            string typeNameOrigin,
            Type eventBeanType,
            Type underlyingType,
            object @event,
            FunctionSendEventWType sendEvent,
            string[] propertyName,
            object[] propertyValues)
        {
            // test native
            env.CompileDeploy(
                "@Name('insert') insert into " +
                typeNameTarget +
                " select " +
                typeof(SupportStaticMethodLib).FullName +
                "." +
                functionName +
                "(s0) from " +
                typeNameOrigin +
                " as s0",
                path);
            env.CompileDeploy("@Name('s0') select * from " + typeNameTarget, path).AddListener("s0");

            sendEvent.Invoke(env, @event, typeNameOrigin);

            EventBean eventBean = env.Listener("s0").AssertOneGetNewAndReset();
            Assert.IsTrue(TypeHelper.IsSubclassOrImplementsInterface(eventBean.Underlying.GetType(), underlyingType));
            Assert.IsTrue(TypeHelper.IsSubclassOrImplementsInterface(eventBean.GetType(), eventBeanType));
            EPAssertionUtil.AssertProps(eventBean, propertyName, propertyValues);

            env.UndeployModuleContaining("s0");
            env.UndeployModuleContaining("insert");
        }