Skip to content

Commit

Permalink
Here's what categories would look like
Browse files Browse the repository at this point in the history
  • Loading branch information
David Saff committed Jul 31, 2009
1 parent a8629da commit 7e74bfd
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
#Fri Jul 17 17:27:50 EDT 2009
#Mon Jul 27 22:30:22 EDT 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
Expand Down Expand Up @@ -46,7 +46,7 @@ org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=no_tag
Expand Down
58 changes: 58 additions & 0 deletions src/main/java/CategoryTest.java
@@ -0,0 +1,58 @@
import static org.junit.Assert.fail;
import org.junit.rules.MethodRule;
import org.junit.rules.Timeout;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;


public class CategoryTest {
public static class A {
public void a() {
// pass
}

@Category(SlowTests.class)
public void b() {
fail();
}
}

@Category(SlowTests.class)
public static class B {
public void c() {

}
}

public static class C {
public void d() {

}
}

@RunWith(Suite.class)
@SuiteClasses({A.class, B.class, C.class})
public static class AbcTest {
enum JUnitCategories {
INTEGRATION, UNIT, GOOD, BAD;
}

enum GoogleCategories extends JUnitCategories {
SMALL, MEDIUM, LARGE, ENORMOUS;
}

@SuiteRule public Filter filter = new CategoryFilter(Category.class, SLOW);
@SuiteRule public Filter decimator = new RandomFilter(0.1);

@SuiteRule public SuiteRule globalTimeout = GlobalTimeout.createTimeoutOnEachMethod(1000);

public static MethodRule GOOGLE_DEFAULT_TIMEOUT = new Timeout(1000);

SuiteRule
@SuiteRule public MethodRule timeout = new Timeout(1000);

@SuiteRule public MethodRuleDistributor timeoutDistributer =
new MethodRuleDistributor(new Timeout(1000));
}
}

0 comments on commit 7e74bfd

Please sign in to comment.