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