Home | History | Annotate | Download | only in junit
      1 package org.testng.junit;
      2 
      3 import java.lang.reflect.Method;
      4 import org.testng.ITestNGMethod;
      5 import org.testng.internal.BaseTestMethod;
      6 
      7 /**
      8  *
      9  * @author lukas
     10  */
     11 //NO JUnit specific code here to avoid runtime errors
     12 public abstract class JUnitTestMethod extends BaseTestMethod {
     13 
     14     protected JUnitTestMethod(JUnitTestClass owner, Method method, Object instance) {
     15         this(owner, method.getName(), method, instance);
     16     }
     17 
     18     protected JUnitTestMethod(JUnitTestClass owner, String methodName, Method method, Object instance) {
     19         super(methodName, method, null, instance);
     20         setTestClass(owner);
     21         owner.getTestMethodList().add(this);
     22     }
     23 
     24     @Override
     25     public boolean isTest() {
     26         return true;
     27     }
     28 
     29     @Override
     30     public ITestNGMethod clone() {
     31         throw new IllegalStateException("clone is not supported for JUnit");
     32     }
     33 
     34 }
     35