01: package net.xoetrope.xui.test;
02:
03: import junit.framework.TestCase;
04: import net.xoetrope.xui.XProjectManager;
05: import net.xoetrope.xui.style.XStyle;
06: import net.xoetrope.xui.style.XStyleManager;
07:
08: /**
09: * Title: Xui
10: * Description:
11: * Copyright: Copyright (c) Xoetrope Ltd., 1998-2003
12: * Company: Xoetrope Ltd.
13: * @author Xoetrope Ltd.
14: * @version 1.0
15: */
16:
17: public class TestStyles extends TestCase {
18:
19: public TestStyles() {
20: }
21:
22: public void testStyles() {
23: XStyleManager style = getStyles();
24: assertTrue(style.getStyle("base").getStyleAsString(
25: XStyle.FONT_FACE).compareTo("arial") == 0);
26: assertTrue(style.getStyle("base").getStyleAsInt(
27: XStyle.FONT_SIZE) == 12);
28: assertTrue(style.getStyle("base/bold/XLabel").getStyleAsInt(
29: XStyle.FONT_SIZE) == 16);
30:
31: // style = getStylesWithoutBase();
32: assertTrue(style.getStyle("base/bold/XLabel").getStyleAsInt(
33: XStyle.FONT_SIZE) == 16);
34:
35: // XStyleManager style = getStyles();
36: // assertTrue( style.getStyle("base").getStyleAsString(XStyle.FONT_FACE).compareTo("arial")==0 );
37: // assertTrue( style.getStyle("base").getStyleAsInt(XStyle.FONT_SIZE)==12 );
38: }
39:
40: public static XStyleManager getStyles() {
41: // XResourceManager.getInstance();
42: // XResourceManager.setDefaultFile("startup.properties");
43: XStyleManager manager = XProjectManager.getStyleManager();
44: // XStyleFactory styleFactory = new XStyleFactory();
45: manager.load("configurator.txt");
46: return XProjectManager.getStyleManager();
47: }
48: }
|