carbidecpp22devenv/plugins/org.eclipse.test.source_3.5.0.r20080925/src/org.junit4_4.5.0.v20090423/junitsrc/org/junit/internal/runners/TestMethod.java
changeset 636 3ef299ba838f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/carbidecpp22devenv/plugins/org.eclipse.test.source_3.5.0.r20080925/src/org.junit4_4.5.0.v20090423/junitsrc/org/junit/internal/runners/TestMethod.java	Fri Dec 04 11:49:54 2009 -0600
@@ -0,0 +1,69 @@
+package org.junit.internal.runners;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.Test.None;
+import org.junit.runners.BlockJUnit4ClassRunner;
+
+/**
+ * @deprecated Included for backwards compatibility with JUnit 4.4. Will be
+ *             removed in the next release. Please use
+ *             {@link BlockJUnit4ClassRunner} in place of {@link JUnit4ClassRunner}.
+ */
+@Deprecated
+public class TestMethod {
+	private final Method fMethod;
+	private TestClass fTestClass;
+
+	public TestMethod(Method method, TestClass testClass) {
+		fMethod= method;
+		fTestClass= testClass;
+	}
+
+	public boolean isIgnored() {
+		return fMethod.getAnnotation(Ignore.class) != null;
+	}
+
+	public long getTimeout() {
+		Test annotation= fMethod.getAnnotation(Test.class);
+		if (annotation == null)
+			return 0;
+		long timeout= annotation.timeout();
+		return timeout;
+	}
+
+	protected Class<? extends Throwable> getExpectedException() {
+		Test annotation= fMethod.getAnnotation(Test.class);
+		if (annotation == null || annotation.expected() == None.class)
+			return null;
+		else
+			return annotation.expected();
+	}
+
+	boolean isUnexpected(Throwable exception) {
+		return ! getExpectedException().isAssignableFrom(exception.getClass());
+	}
+
+	boolean expectsException() {
+		return getExpectedException() != null;
+	}
+
+	List<Method> getBefores() {
+		return fTestClass.getAnnotatedMethods(Before.class);
+	}
+
+	List<Method> getAfters() {
+		return fTestClass.getAnnotatedMethods(After.class);
+	}
+
+	public void invoke(Object test) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
+		fMethod.invoke(test);
+	}
+
+}