• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
JUnitTestMethod(JUnitTestClass owner, Method method, Object instance)14     protected JUnitTestMethod(JUnitTestClass owner, Method method, Object instance) {
15         this(owner, method.getName(), method, instance);
16     }
17 
JUnitTestMethod(JUnitTestClass owner, String methodName, Method method, Object instance)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
isTest()25     public boolean isTest() {
26         return true;
27     }
28 
29     @Override
clone()30     public ITestNGMethod clone() {
31         throw new IllegalStateException("clone is not supported for JUnit");
32     }
33 
34 }
35