junit etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
junit etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

2 Ağustos 2011 Salı

running ant JUnitTask

message from ant:


BUILD FAILED
.../build.xml:346: Problem: failed to create task or type junit
Cause: the class org.apache.tools.ant.taskdefs.optional.junit.JUnitTask was not found.
        This looks like one of Ant's optional components.
....



this is due to lack of  ant-junit.jar file.

one method is to download ant-junit.jar from here: http://www.java2s.com/Code/Jar/ABC/Downloadantjunitjar.htm
and copy it under $ANT_HOME/lib

another method is to download a newer version of ant (http://ant.apache.org/)
ant 1.8.2 comes with that jar file..

http://ant.apache.org/manual/Tasks/junit.html explains how to run junit task..

6 Kasım 2009 Cuma

testsuite for junit

i used org.junit package for developing unit tests and want to run all my tests in a suite..
in order to do that :

two sample test classes
import org.junit.Test;

public class Test1 {
    @Test
    public void TestCase1() {
   ...
   }
-------------------------------
import org.junit.Test;

public class Test2 {
    @Test
    public void TestCase2() {
   ...
   }

test suite
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)
@SuiteClasses({
    Test1.class,
    Test2.class
    })
public class AllTests {

}

(post by Arne V. at 10-06-2008, 03:18 AM)