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 AndGroupMatcherTest
24 extends TestCase
25 {
26
27 public void testDontMatchOneInGroup()
28 {
29 AndGroupMatcher matcher = new AndGroupMatcher( new SingleGroupMatcher( SingleGroupMatcher.class.getName() ),
30 new SingleGroupMatcher( InverseGroupMatcher.class.getName() ) );
31
32 assertFalse( matcher.enabled( InverseGroupMatcher.class, AndGroupMatcher.class ) );
33 }
34
35 public void testMatchBothInGroup()
36 {
37 AndGroupMatcher matcher = new AndGroupMatcher( new SingleGroupMatcher( SingleGroupMatcher.class.getName() ),
38 new SingleGroupMatcher( InverseGroupMatcher.class.getName() ) );
39
40 assertTrue( matcher.enabled( InverseGroupMatcher.class, SingleGroupMatcher.class ) );
41 }
42
43 public void testDontMatchAnyInGroup()
44 {
45 AndGroupMatcher matcher = new AndGroupMatcher( new SingleGroupMatcher( SingleGroupMatcher.class.getName() ),
46 new SingleGroupMatcher( InverseGroupMatcher.class.getName() ) );
47
48 assertFalse( matcher.enabled( OrGroupMatcher.class, AndGroupMatcher.class ) );
49 }
50
51 }