JUnit and junit.framework.TestSuite - No runnable methods

后端 未结 4 1242
别跟我提以往
别跟我提以往 2020-12-21 00:46

I\'ve made some unit tests (in test class). The tutorial I\'ve read said that I should make a TestSuite for the unittests.

Odd is that when I\'m running the unit tes

4条回答
  •  心在旅途
    2020-12-21 01:40

    I'm not experienced in ant - so I'm not using it for testing it right now.

    Searching the internet it seems like I'm mixing up the old jUnit 3.8 and jUnit 4.0 behavior. Trying now a way to use the "new behavior"

    edited:
    now it works:

    AllTest changed to:

    import org.junit.runner.RunWith;
    import org.junit.runners.Suite;
    import org.junit.runners.Suite.SuiteClasses;
    
    
    @RunWith(value=Suite.class)
    @SuiteClasses(value={TestCase.class})
    public class AllTests {
    
    }
    

    TestCase changed to:

    import static org.junit.Assert.assertTrue;
    import org.junit.Test;
    
    public class TestCase  {
    @Test
        public void test1 {
            assertTrue (tmp.getTermin().equals(soll));
        }
    }
    

提交回复
热议问题