Esempio n. 1
0
        public void TestGetterSpecial()
        {
            Type      clazz     = typeof(SupportBeanComplexProps);
            FastClass fastClass = FastClass.Create(clazz);

            // set up bean
            SupportBeanComplexProps bean = SupportBeanComplexProps.MakeDefaultBean();

            // try mapped property
            MethodInfo method     = clazz.GetMethod("GetMapped", new Type[] { typeof(string) });
            FastMethod fastMethod = fastClass.GetMethod(method);
            Object     result     = fastMethod.Invoke(bean, new Object[] { "keyOne" });

            Assert.AreEqual("valueOne", result);
            result = fastMethod.Invoke(bean, new Object[] { "keyTwo" });
            Assert.AreEqual("valueTwo", result);

            // try index property
            method     = clazz.GetMethod("GetIndexed", new Type[] { typeof(int) });
            fastMethod = fastClass.GetMethod(method);
            result     = fastMethod.Invoke(bean, new Object[] { 0 });
            Assert.AreEqual(1, result);
            result = fastMethod.Invoke(bean, new Object[] { 1 });
            Assert.AreEqual(2, result);

            // try nested property
            method     = clazz.GetMethod("_GetNested", new Type[] {});
            fastMethod = fastClass.GetMethod(method);
            SupportBeanComplexProps.SupportBeanSpecialGetterNested nested = (SupportBeanComplexProps.SupportBeanSpecialGetterNested)fastMethod.Invoke(bean, new Object[] {});

            Type       nestedClazz     = typeof(SupportBeanComplexProps.SupportBeanSpecialGetterNested);
            MethodInfo methodNested    = nestedClazz.GetMethod("_GetNestedValue", new Type[] {});
            FastClass  fastClassNested = FastClass.Create(nestedClazz);

            fastClassNested.GetMethod(methodNested);
        }
Esempio n. 2
0
 public void Update(EPStatement statement, SupportBeanComplexProps.SupportBeanSpecialGetterNested n, SupportBeanComplexProps.SupportBeanSpecialGetterNestedNested nn)
 {
     AddIndication(statement, new object[] { n, nn });
 }
 public void Update(SupportBeanComplexProps.SupportBeanSpecialGetterNested n,
                    SupportBeanComplexProps.SupportBeanSpecialGetterNestedNested nn)
 {
     indicate.Add(new Object[] { n, nn });
 }