Ejemplo n.º 1
0
        static JavaVMFixture()
        {
            var c = new TestJVM(
                );

            JniRuntime.SetCurrent(c);
        }
Ejemplo n.º 2
0
        static JavaVMFixture()
        {
            var c = new TestJVM(
                jars:           new[] { "export-test.jar" }
                );

            JniRuntime.SetCurrent(c);
        }
Ejemplo n.º 3
0
        static JavaVMFixture()
        {
            var c = new TestJVM(
                jars:           new[] { "performance-test.jar" }
                );

            JniRuntime.SetCurrent(c);
        }
Ejemplo n.º 4
0
        static partial void CreateJavaVM()
        {
            var c = new TestJVM(
                jars:           new[] { "interop-test.jar" },
                typeMappings:   new Dictionary <string, Type> ()
            {
                { TestType.JniTypeName, typeof(TestType) },
                { GenericHolder <int> .JniTypeName, typeof(GenericHolder <>) },
            }
                );

            JniRuntime.SetCurrent(c);
        }
Ejemplo n.º 5
0
        static partial void CreateJavaVM()
        {
            var c = new TestJVM(
                jars:           new[] { "interop-test.jar" },
                typeMappings:   new Dictionary <string, Type> ()
            {
#if !NO_MARSHAL_MEMBER_BUILDER_SUPPORT
                { TestType.JniTypeName, typeof(TestType) },
#endif  // !NO_MARSHAL_MEMBER_BUILDER_SUPPORT
                { GenericHolder <int> .JniTypeName, typeof(GenericHolder <>) },
            }
                );

            JniRuntime.SetCurrent(c);
        }
Ejemplo n.º 6
0
        public void Dispose_ClearsJniEnvironment()
        {
            var        c = JniRuntime.CurrentRuntime;
            JniRuntime r = null;
            var        t = new Thread(() => {
                r = new JniProxyRuntime(c);
                JniRuntime.SetCurrent(r);
                Assert.AreEqual(r, JniEnvironment.Runtime);
                r.Dispose();
                Assert.Throws <NotSupportedException>(() => {
                    var env = JniEnvironment.Runtime;
                });
            });

            t.Start();
            t.Join();
            Assert.IsNotNull(r);
            JniRuntime.SetCurrent(c);
        }