KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > share > configbean > customizers > webapp > WebAppRootCustomizerTest


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 /*
20  * WebAppRootCustomizerTest.java
21  * JUnit based test
22  *
23  * Created on March 11, 2004, 3:32 PM
24  */

25
26 package org.netbeans.modules.j2ee.sun.share.configbean.customizers.webapp;
27
28 import org.netbeans.modules.j2ee.sun.share.SunDeploymentFactory;
29 import org.netbeans.modules.j2ee.sun.share.MockDeployableObject;
30 import org.netbeans.modules.j2ee.sun.share.configbean.MockDDBeanRoot;
31 import javax.enterprise.deploy.spi.DeploymentManager JavaDoc;
32 import org.netbeans.modules.j2ee.sun.share.SunDeploymentManager;
33 import javax.enterprise.deploy.spi.DeploymentConfiguration JavaDoc;
34 import org.netbeans.modules.j2ee.sun.share.configbean.SunONEDeploymentConfiguration;
35 import javax.enterprise.deploy.spi.DConfigBeanRoot JavaDoc;
36 import javax.enterprise.deploy.spi.DConfigBean JavaDoc;
37
38 import javax.enterprise.deploy.spi.exceptions.ConfigurationException JavaDoc;
39
40
41 /*import java.util.ResourceBundle;
42 import java.util.Set;
43 import java.util.Iterator;
44 import java.beans.Customizer;
45 import java.beans.PropertyVetoException;
46 import java.awt.GridBagConstraints;
47 import java.awt.Insets;
48 import javax.swing.JPanel;
49 import org.netbeans.modules.j2ee.sun.share.configbean.WebAppRoot;
50 import org.netbeans.modules.j2ee.sun.share.configbean.ServletVersion;
51 import org.netbeans.modules.j2ee.sun.share.configbean.ErrorMessageDB;
52 import org.netbeans.modules.j2ee.sun.share.configbean.ValidationError;
53 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.BaseCustomizer;
54 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.CustomizerTitlePanel;*/

55 import junit.framework.*;
56
57 import org.netbeans.modules.j2ee.sun.share.configbean.WebAppRoot;
58
59
60 /**
61  *
62  * @author vkraemer
63  */

64 public class WebAppRootCustomizerTest extends TestCase {
65     
66     public void testCreate() {
67         WebAppRootCustomizer warc = new WebAppRootCustomizer();
68         assertNotNull(warc);
69         //WebAppRoot war = new WebAppRoot();
70
// it is never this easy!!!
71
MockDDBeanRoot waddbean = new MockDDBeanRoot();
72         waddbean.setXpath("/web-app");
73         waddbean.setRoot(waddbean);
74         WebAppRoot war = null;
75         try {
76             war = (WebAppRoot) DC.getDConfigBeanRoot(waddbean);
77             assertNotNull(war);
78         }
79         catch (ConfigurationException JavaDoc ce) {
80             fail("this should not fail");
81         }
82        warc.setBean(war);
83         warc.initFields();
84     }
85
86     static SunDeploymentFactory DF = new SunDeploymentFactory();
87     static DeploymentManager JavaDoc DM = null;
88     static DeploymentConfiguration JavaDoc DC = null;
89     static DConfigBeanRoot JavaDoc WAR = null;
90     static {
91         try {
92             DM = DF.getDisconnectedDeploymentManager("deployer:Sun:AppServer::localhost:4848");
93             DC = DM.createConfiguration(new MockDeployableObject());
94 // WAR = DC.getDConfigBeanRoot(new MockDDBeanRoot());
95
}
96         catch (Throwable JavaDoc t) {
97             fail(t.getMessage());
98         }
99     }
100     
101     public WebAppRootCustomizerTest(java.lang.String JavaDoc testName) {
102         super(testName);
103     }
104     
105 }
106
Popular Tags