1 11 12 package org.eclipse.jdt.internal.junit.model; 13 14 import org.eclipse.core.runtime.Assert; 15 16 import org.eclipse.jdt.junit.model.ITestCaseElement; 17 18 19 public class TestCaseElement extends TestElement implements ITestCaseElement { 20 21 private boolean fIgnored; 22 23 public TestCaseElement(TestSuiteElement parent, String id, String testName) { 24 super(parent, id, testName); 25 Assert.isNotNull(parent); 26 } 27 28 34 public String getTestMethodName() { 35 String testName= getTestName(); 36 int index= testName.indexOf('('); 37 if (index > 0) 38 return testName.substring(0, index); 39 index= testName.indexOf('@'); 40 if (index > 0) 41 return testName.substring(0, index); 42 return testName; 43 } 44 45 49 public String getTestClassName() { 50 return getClassName(); 51 } 52 53 public void setIgnored(boolean ignored) { 54 fIgnored= ignored; 55 } 56 57 public boolean isIgnored() { 58 return fIgnored; 59 } 60 61 public String toString() { 62 return "TestCase: " + getTestClassName() + "." + getTestMethodName() + " : " + super.toString(); } 64 } 65 | Popular Tags |