Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testLeaveFilesIfTestFails()
        public virtual void TestLeaveFilesIfTestFails()
        {
            Result r = JUnitCore.runClasses(typeof(Nested1));

            Assert.AreEqual(1, r.FailureCount);
            Assert.IsTrue(Nested1.File != null && Nested1.File.Exists());
            Nested1.File.delete();
        }
Exemple #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testWindowsUnremovableFile() throws java.io.IOException
        public virtual void TestWindowsUnremovableFile()
        {
            RandomizedTest.assumeTrue("Requires Windows.", Constants.WINDOWS);
            RandomizedTest.assumeFalse(LuceneTestCase.LEAVE_TEMPORARY);

            Result r = JUnitCore.runClasses(typeof(Nested2));

            Assert.AreEqual(1, r.FailureCount);

            Nested2.OpenFile.Dispose();
            TestUtil.rm(Nested2.Parent);
        }
        public static void Run()
        {
            List<java.lang.Class> classes = new List<java.lang.Class>();

            foreach( Type type in typeof( org.objectfabric.Transaction ).Assembly.GetTypes() )
            {
                java.lang.Class c = type;

                if( c != null && c.getName().StartsWith( "org.objectfabric" ) )
                    classes.Add( type );
            }

            //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler( CurrentDomain_UnhandledException );

            org.junit.runner.JUnitCore core = new org.junit.runner.JUnitCore();
            core.addListener( new Listener() );
            core.run( classes.ToArray() );

            Console.WriteLine( "Success!" );
        }
        public static void Run()
        {
            List <java.lang.Class> classes = new List <java.lang.Class>();

            foreach (Type type in typeof(org.objectfabric.Transaction).Assembly.GetTypes())
            {
                java.lang.Class c = type;

                if (c != null && c.getName().StartsWith("org.objectfabric"))
                {
                    classes.Add(type);
                }
            }

            //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler( CurrentDomain_UnhandledException );

            org.junit.runner.JUnitCore core = new org.junit.runner.JUnitCore();
            core.addListener(new Listener());
            core.run(classes.ToArray());

            Console.WriteLine("Success!");
        }