KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > ide > j2ee > incrdeploy > DirectoryDeploymentTest


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  * DirectoryDeploymentTest.java
21  * JUnit based test
22  *
23  * Created on May 27, 2004, 2:26 PM
24  */

25
26 package org.netbeans.modules.j2ee.sun.ide.j2ee.incrdeploy;
27
28 import junit.framework.*;
29
30 import javax.enterprise.deploy.shared.ModuleType JavaDoc;
31 import javax.enterprise.deploy.spi.exceptions.ConfigurationException JavaDoc;
32 import org.netbeans.modules.j2ee.sun.bridge.DirectoryDeployment;
33
34 /*import java.io.FileInputStream;
35 import java.io.PrintWriter;
36 import java.io.ByteArrayOutputStream;
37 import java.net.URL;
38 import java.io.File;
39 import junit.framework.*;
40 import org.netbeans.modules.j2ee.deployment.plugins.api.IncrementalDeployment;
41 import org.netbeans.modules.j2ee.deployment.plugins.api.DeploymentPlanSplitter;
42 import org.netbeans.modules.j2ee.deployment.plugins.api.AppChangeDescriptor;
43 import org.openide.util.RequestProcessor;
44 import org.openide.util.Task;
45 import javax.enterprise.deploy.spi.Target;
46 import javax.enterprise.deploy.spi.TargetModuleID;
47 import javax.enterprise.deploy.spi.DeploymentManager;
48 import javax.enterprise.deploy.spi.DeploymentConfiguration;
49 import javax.enterprise.deploy.spi.status.ProgressObject;
50 import javax.enterprise.deploy.model.DeployableObject;
51 import javax.enterprise.deploy.spi.exceptions.ConfigurationException;
52 import javax.enterprise.deploy.shared.ModuleType;
53 import javax.enterprise.deploy.shared.CommandType;
54 import javax.enterprise.deploy.shared.StateType;
55 import javax.enterprise.deploy.shared.ActionType;
56 import javax.enterprise.deploy.spi.status.ProgressObject;
57 import javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException;
58 import org.netbeans.modules.j2ee.sun.ide.j2ee.Constants;
59 import org.netbeans.modules.j2ee.sun.ide.j2ee.Status;
60 import org.netbeans.modules.j2ee.sun.share.configbean.SunONEDeploymentConfiguration;
61 import com.sun.enterprise.deployapi.SunTargetModuleID;
62 import org.netbeans.modules.j2ee.sun.common.dd.webapp.SunWebApp;
63 import javax.management.MBeanServerConnection;
64 import javax.management.ObjectName;
65 import org.netbeans.modules.j2ee.sun.ide.j2ee.ProgressEventSupport;
66  **/

67
68 /**
69  *
70  * @author vkraemer
71  */

72 public class DirectoryDeploymentTest extends TestCase {
73     
74     public void testCoverage() {
75         DirectoryDeployment foo = new DirectoryDeployment();
76         try {
77             foo.setDeploymentManager(null);
78             fail("null is an IllegalArgument");
79         } catch (IllegalArgumentException JavaDoc iae) {
80         }
81         try {
82             foo = new DirectoryDeployment(null);
83             fail("null is an IllegalArgument");
84         } catch (IllegalArgumentException JavaDoc iae) {
85         }
86         boolean ret = foo.canFileDeploy(null,null);
87         //assertFalse("the null target cannot file deploy a null module", ret);
88
assertTrue("the null target cannot file deploy a null module", !ret);
89         foo.getDeploymentPlanFileNames(ModuleType.EAR);
90         foo.getDeploymentPlanFileNames(ModuleType.WAR);
91         foo.getDeploymentPlanFileNames(ModuleType.EJB);
92         foo.getDeploymentPlanFileNames(ModuleType.CAR);
93         foo.getDeploymentPlanFileNames(ModuleType.RAR);
94         /*java.io.File f = foo.getDirectoryForModule(null);
95         assertNull("a null TMID deploys to the null directory",f);
96         f = foo.getDirectoryForNewApplication(null, null,null);
97         assertNull(f);
98         f = foo.getDirectoryForNewModule(null, null, null, null);
99         assertNull(f);
100         String s = foo.getModuleUrl(null);
101         assertNull(s);
102          **/

103         try {
104             foo.readDeploymentPlanFiles(null, null, null);
105             fail("I shouldn't get here: readDeploymentPlanFiles(null,null,null)");
106         } catch (ConfigurationException JavaDoc ce) {
107         }
108         try {
109             foo.writeDeploymentPlanFiles(null, null, null);
110             fail("I shouldn't get here: readDeploymentPlanFiles(null,null,null)");
111         } catch (ConfigurationException JavaDoc ce) {
112             
113         }
114     }
115     
116     public DirectoryDeploymentTest(java.lang.String JavaDoc testName) {
117         super(testName);
118     }
119     
120 }
121
Popular Tags