1 | package de.ugoe.cs.quest.windows.data;
|
---|
2 |
|
---|
3 | import org.junit.*;
|
---|
4 |
|
---|
5 | import de.ugoe.cs.quest.windows.data.MFCTargetComparator;
|
---|
6 | import de.ugoe.cs.quest.windows.data.WindowsEvent;
|
---|
7 |
|
---|
8 | import static org.junit.Assert.*;
|
---|
9 |
|
---|
10 | /**
|
---|
11 | * The class <code>WindowsEventTest</code> contains tests for the class <code>{@link WindowsEvent}</code>.
|
---|
12 | *
|
---|
13 | * @author Steffen Herbold
|
---|
14 | * @version 1.0
|
---|
15 | */
|
---|
16 | public class WindowsEventTest {
|
---|
17 |
|
---|
18 | @Test
|
---|
19 | public void testTargetEquals_1() throws Exception {
|
---|
20 | WindowsEvent event = new WindowsEvent("type");
|
---|
21 | String target1 = "<window name=\"name1\" class=\"class1\" resourceId=\"id1\" isModal=\"modal1\" hwnd=\"111\"/>";
|
---|
22 | String target2 = "<window name=\"name1\" class=\"class1\" resourceId=\"id1\" isModal=\"modal1\" hwnd=\"111\"/>";
|
---|
23 | event.setTarget(target1);
|
---|
24 | boolean expected = true;
|
---|
25 |
|
---|
26 | boolean result = event.targetEquals(target2);
|
---|
27 |
|
---|
28 | assertEquals(expected, result);
|
---|
29 | }
|
---|
30 |
|
---|
31 | @Test
|
---|
32 | public void testTargetEquals_2() throws Exception {
|
---|
33 | WindowsEvent event = new WindowsEvent("type");
|
---|
34 | String target1 = "<window name=\"Messplatz\" class=\"#32770\" resourceId=\"0\" isModal=\"true\" hwnd=\"1770138\"/><window name=\"Messplatz im Einstellmodus\" class=\"#32770\" resourceId=\"0\" isModal=\"true\" hwnd=\"2032262\"/><window name=\"\" class=\"#32770\" resourceId=\"0\" isModal=\"false\" hwnd=\"459658\"/><window name=\"\" class=\"SysTabControl32\" resourceId=\"12320\" isModal=\"false\" hwnd=\"983734\"/>";
|
---|
35 | String target2 = "<window name=\"Messplatz\" class=\"#32770\" resourceId=\"0\" isModal=\"true\" hwnd=\"1770138\"/><window name=\"Messplatz im Einstellmodus\" class=\"#32770\" resourceId=\"0\" isModal=\"true\" hwnd=\"2032262\"/><window name=\"\" class=\"#32770\" resourceId=\"0\" isModal=\"false\" hwnd=\"459658\"/><window name=\"\" class=\"SysTabControl32\" resourceId=\"12320\" isModal=\"false\" hwnd=\"983734\"/>";
|
---|
36 | event.setTarget(target1);
|
---|
37 | boolean expected = true;
|
---|
38 |
|
---|
39 | boolean result = event.targetEquals(target2);
|
---|
40 |
|
---|
41 | assertEquals(expected, result);
|
---|
42 |
|
---|
43 | MFCTargetComparator.setMutable(false);
|
---|
44 |
|
---|
45 | result = event.targetEquals(target2);
|
---|
46 |
|
---|
47 | assertEquals(expected, result);
|
---|
48 | }
|
---|
49 |
|
---|
50 | }
|
---|