1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.surefire.group.match;
20
21 import junit.framework.TestCase;
22
23
24
25
26 public class SingleGroupMatcherTest extends TestCase {
27
28 public void testMatchExactClassName() {
29 SingleGroupMatcher matcher = new SingleGroupMatcher(SingleGroupMatcher.class.getName());
30 assertTrue(matcher.enabled(SingleGroupMatcher.class));
31 }
32
33 public void testMatchLoadedClass() {
34 SingleGroupMatcher matcher = new SingleGroupMatcher(SingleGroupMatcher.class.getName());
35 matcher.loadGroupClasses(Thread.currentThread().getContextClassLoader());
36 assertTrue(matcher.enabled(SingleGroupMatcher.class));
37 }
38
39 public void testMatchUnknownClass() {
40 SingleGroupMatcher matcher = new SingleGroupMatcher("BadClass");
41 matcher.loadGroupClasses(Thread.currentThread().getContextClassLoader());
42 assertTrue(matcher.enabled("BadClass"));
43 }
44
45 public void testMatchClassNameWithoutPackage() {
46 SingleGroupMatcher matcher = new SingleGroupMatcher(SingleGroupMatcher.class.getSimpleName());
47 assertTrue(matcher.enabled(SingleGroupMatcher.class));
48 }
49 }