01: /*
02: * Created on Jan 26, 2004
03: *
04: * To change the template for this generated file go to
05: * Window - Preferences - Java - Code Generation - Code and Comments
06: */
07: package org.vfny.geoserver.config;
08:
09: import java.beans.PropertyDescriptor;
10:
11: import junit.framework.TestCase;
12:
13: import org.geotools.validation.attributes.GazetteerNameValidation;
14: import org.vfny.geoserver.config.validation.ArgumentConfig;
15: import org.vfny.geoserver.config.validation.PlugInConfig;
16: import org.vfny.geoserver.config.validation.TestConfig;
17:
18: /**
19: * ValidationTest purpose.
20: * <p>
21: * Description of ValidationTest ...
22: * </p>
23: *
24: * @author dzwiers, Refractions Research, Inc.
25: * @author $Author: jive $ (last modification)
26: * @version $Id: ValidationTest.java 6177 2007-02-19 10:11:27Z aaime $
27: */
28: public class ValidationTest extends TestCase {
29:
30: // public static void main(String[] args) {
31: public void test() {
32: TestConfig testConfig = new TestConfig();
33: PlugInConfig pluginConfig = new PlugInConfig();
34: // the plugin to test the bean info for.
35: //pluginConfig.setClassName(PolygonBoundaryCoveredByPolygonValidation.class.getName());
36: pluginConfig.setClassName(GazetteerNameValidation.class
37: .getName());
38: testConfig.setPlugIn(pluginConfig);
39:
40: System.out.println(testConfig.toString());
41: System.out.println("--------------------------------------");
42: for (int i = 0; i < testConfig.getPropertyDescriptors().length; i++) {
43:
44: System.out.println(testConfig.getPropertyDescriptors()[i]
45: .getClass().getName());
46: System.out.println(testConfig.getPropertyDescriptors()[i]
47: .getDisplayName());
48: System.out.println(testConfig.getPropertyDescriptors()[i]
49: .getShortDescription());
50:
51: System.out.println(testConfig.getPropertyDescriptors()[i]
52: .attributeNames());
53: System.out
54: .println("--------------------------------------");
55: }
56:
57: System.out.println("--------------------------------------");
58: System.out.println("--------------------------------------");
59: System.out.println("--------------------------------------");
60:
61: testConfig = new TestConfig();
62: pluginConfig = new PlugInConfig();
63: // the plugin to test the bean info for.
64: //pluginConfig.setClassName(PolygonBoundaryCoveredByPolygonValidation.class.getName());
65: pluginConfig.setClassName(GazetteerNameValidation.class
66: .getName());
67: testConfig.setPlugIn(pluginConfig);
68:
69: PropertyDescriptor[] pd = pluginConfig.getPropertyDescriptors();
70:
71: System.out.println(pluginConfig.toString());
72: System.out.println("--------------------------------------");
73: for (int i = 0; i < pluginConfig.getPropertyDescriptors().length; i++) {
74:
75: System.out.println(pd[i].getClass().getName());
76: System.out.println(ArgumentConfig.getDisplayName(pd[i]));
77: System.out.println(ArgumentConfig.getDescription(pd[i]));
78:
79: System.out
80: .println("--------------------------------------");
81: }
82:
83: /*System.out.println(pluginConfig.toString());
84: System.out.println("--------------------------------------");
85: for (int i = 0; i < pluginConfig.getPropertyDescriptors().length; i++) {
86:
87: System.out.println(pluginConfig.getPropertyDescriptors()[i].getDisplayName());
88: System.out.println(pluginConfig.getPropertyDescriptors()[i].getShortDescription());
89:
90: System.out.println(pluginConfig.getPropertyDescriptors()[i].attributeNames());
91: System.out.println("--------------------------------------");
92: }*/
93: }
94: }
|