예제 #1
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();
        }
예제 #2
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);
        }