KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > designer > factory > DesignFactoryTest


1 /*
2  * (c) Rob Gordon 2005.
3  */

4 package org.oddjob.designer.factory;
5
6 import junit.framework.TestCase;
7
8 import org.oddjob.designer.elements.ListDE;
9 import org.oddjob.designer.model.DesignElementType;
10
11 /**
12  *
13  */

14 public class DesignFactoryTest extends TestCase {
15
16     public void testLoad() {
17         assertTrue("some defs", DesignFactory.childActions(new Object JavaDoc(), "").size() > 0);
18     }
19     
20     public void testCreateComponent() throws ClassNotFoundException JavaDoc {
21         assertNotNull("Should create something",
22                 DesignFactory.createComponent(DesignFactory.UNKNOWN_TAG));
23     }
24
25     public void testCreateType() throws ClassNotFoundException JavaDoc {
26         DesignElementType list = DesignFactory.createType("list");
27         
28         assertNotNull("Should create something", list);
29         assertTrue(list.supportedTypes().length > 1);
30         
31     }
32     
33     public void testNullCreate() throws ClassNotFoundException JavaDoc {
34         assertNull("Should be null", DesignFactory.createComponent("rubbish"));
35     }
36     
37     public void testActions() {
38         SimpleHierarchy sh = DesignFactory.childActions(this, "whatever");
39         System.out.println(sh.size());
40         assertTrue("Some hierarchy", sh.size() > 0);
41     }
42     
43     public void testSupportedTypes() {
44         assertTrue("some types", DesignFactory.
45                 supportedTypes(ListDE.class).length > 2);
46     }
47 }
48
Popular Tags