01: package de.java2html.options.test;
02:
03: import junit.framework.TestCase;
04: import de.java2html.javasource.JavaSourceType;
05: import de.java2html.options.JavaSourceStyleEntry;
06: import de.java2html.options.JavaSourceStyleTable;
07: import de.java2html.util.RGB;
08:
09: /**
10: * @author Markus Gebhard
11: */
12: public class JavaSourceStyleTableTest extends TestCase {
13: public void testEqualEquals() {
14: assertEquals(JavaSourceStyleTable.getDefault(),
15: JavaSourceStyleTable.getDefault());
16: }
17:
18: public void testDifferentNotEquals() {
19: assertFalse(JavaSourceStyleTable
20: .getDefaultEclipseStyleTable()
21: .equals(JavaSourceStyleTable.getDefaultKawaStyleTable()));
22: }
23:
24: /** @deprecated */
25: public void testDifferentNameNotEquals() {
26: JavaSourceStyleTable modifiedTable = JavaSourceStyleTable
27: .getDefaultEclipseStyleTable();
28: modifiedTable.setName(modifiedTable.getName() + "*");
29: assertFalse(modifiedTable.equals(JavaSourceStyleTable
30: .getDefaultEclipseStyleTable()));
31: }
32:
33: public void testAdditionalEntryNotEquals() {
34: JavaSourceStyleTable modifiedTable = JavaSourceStyleTable
35: .getDefaultEclipseStyleTable();
36: modifiedTable.put("kkkkkkk", new JavaSourceStyleEntry(RGB.RED));
37: assertFalse(modifiedTable.equals(JavaSourceStyleTable
38: .getDefaultEclipseStyleTable()));
39: }
40:
41: public void testModifiedEntryNotEquals() {
42: JavaSourceStyleTable modifiedTable = JavaSourceStyleTable
43: .getDefaultEclipseStyleTable();
44: JavaSourceStyleEntry entry = modifiedTable
45: .get(JavaSourceType.CODE);
46: modifiedTable.put(JavaSourceType.CODE,
47: new JavaSourceStyleEntry(entry.getColor(), !entry
48: .isBold(), entry.isItalic()));
49: assertFalse(modifiedTable.equals(JavaSourceStyleTable
50: .getDefaultEclipseStyleTable()));
51: }
52: }
|