Menu

[r8]: / trunk / tests / unit / DiffFrameTest.java  Maximize  Restore  History

Download this file

40 lines (27 with data), 896 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package unit;
import static org.junit.Assert.assertEquals;
import java.lang.reflect.Field;
import org.junit.After;
import org.junit.Test;
import diffstats.ButtonPanel;
import diffstats.DiffFrame;
import diffstats.TextPanel;
public class DiffFrameTest {
DiffFrame diffFrame = new DiffFrame(null);
@After
public void tearDown(){
diffFrame.dispose();
}
@Test
public void testDiffFrame() throws IllegalArgumentException, IllegalAccessException {
Field fields[] = diffFrame.getClass().getDeclaredFields();
fields[0].setAccessible(true);
assertEquals(TextPanel.class, fields[0].get(diffFrame).getClass());
fields[1].setAccessible(true);
assertEquals(ButtonPanel.class, fields[1].get(diffFrame).getClass());
}
@Test
public void testGetResultsPanel() {
assertEquals(TextPanel.class, diffFrame.getTextPanel().getClass());
}
}