KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > share > configbean > customizers > ejbmodule > EjbJarRootCustomizerTest


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  * EjbJarRootCustomizerTest.java
21  * JUnit based test
22  *
23  * Created on March 11, 2004, 12:12 PM
24  */

25
26 package org.netbeans.modules.j2ee.sun.share.configbean.customizers.ejbmodule;
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 import org.netbeans.modules.j2ee.sun.share.configbean.EjbJarRoot;
41 /*import java.util.ArrayList;
42 import java.util.Collection;
43 import java.util.ResourceBundle;
44 import java.awt.event.ActionListener;
45 import javax.enterprise.deploy.spi.DConfigBean;
46 import javax.swing.event.TableModelListener;
47 import org.netbeans.modules.j2ee.sun.common.dd.DefaultResourcePrincipal;
48 import org.netbeans.modules.j2ee.sun.common.dd.ejb.CmpResource;
49 import org.netbeans.modules.j2ee.sun.common.dd.ejb.PmDescriptor;
50 import org.netbeans.modules.j2ee.sun.common.dd.ejb.PmDescriptors;
51 import org.netbeans.modules.j2ee.sun.common.dd.ejb.PmInuse;
52 import org.netbeans.modules.j2ee.sun.common.dd.ejb.SchemaGeneratorProperties;
53 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.BeanCustomizer;
54 //import org.netbeans.modules.j2ee.sun.share.configbean.customizers.MessageDestinationPanel;
55 //import org.netbeans.modules.j2ee.sun.share.configbean.customizers.WebserviceDescriptionPanel;
56 //import org.netbeans.modules.j2ee.sun.share.configbean.customizers.PmDescriptorPanel;
57 import org.netbeans.modules.j2ee.sun.share.configbean.EjbJarRoot;
58 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.CustomizerTitlePanel;*/

59
60 import junit.framework.*;
61
62 /**
63  *
64  * @author vkraemer
65  */

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