示例#1
0
        public void jIface()
        {
            var    cw1   = new CWithJavaInterface(1);
            var    cw2   = new CWithJavaInterface(2);
            Object other = (Object)Bridge.WrapCLR(cw2);

            Assert.AreEqual(1, cw1.compareTo(other));

            cw2.run();
            Assert.AreEqual(3, cw2.Value);
        }
示例#2
0
文件: BTests.cs 项目: gywerd/WinJNI
        public void TypeCbyCLRProxy()
        {
            JInterfacesHelper  h               = new JInterfacesHelper();
            CWithJavaInterface cwc             = h.getCWithJavaInterfaceC(new CWithJavaInterface(0));
            Object             val             = Bridge.WrapCLR(cwc);
            JniGlobalHandle    jniGlobalHandle = ((IClrProxy)val).JvmHandle;
            RegistryRecord     record          = Registry.GetRecord(JNIEnv.ThreadEnv, jniGlobalHandle, val.getClass());

            Assert.IsNotNull(record);
            jniGlobalHandle.HoldThisHandle();
        }
示例#3
0
        public void Interfaces1()
        {
            CWithJavaInterface a   = new CWithJavaInterface(4);
            Runnable           cw  = testInstance.getCWithJavaInterface(a);
            CWithJavaInterface cwi = testInstance.getCWithJavaInterfaceC(a);

            cwi.run();
            cw.run();
            CWithJavaInterface tt = cw as CWithJavaInterface;

            Assert.AreEqual(6, tt.Value);
        }