KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > share > MockDeployableObject


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  * MockDeployableObject.java
21  *
22  * Created on March 3, 2004, 9:59 PM
23  */

24
25 package org.netbeans.modules.j2ee.sun.share;
26
27 import javax.enterprise.deploy.model.DDBeanRoot JavaDoc;
28 //import org.netbeans.modules.j2ee.sun.share.configbean.MockDDBeanRoot;
29

30 //import java.lang.UnsupportedOperationException
31

32 /**
33  *
34  * @author vkraemer
35  */

36 public class MockDeployableObject implements javax.enterprise.deploy.model.DeployableObject JavaDoc {
37
38     DDBeanRoot JavaDoc ddroot;
39
40     /** Creates a new instance of MockDeployableObject */
41 // public MockDeployableObject() {
42
// }
43

44     public java.util.Enumeration JavaDoc entries() {
45         throw new UnsupportedOperationException JavaDoc();
46     }
47     
48     public javax.enterprise.deploy.model.DDBean JavaDoc[] getChildBean(String JavaDoc str) {
49         throw new UnsupportedOperationException JavaDoc();
50     }
51     
52     public Class JavaDoc getClassFromScope(String JavaDoc str) {
53         throw new UnsupportedOperationException JavaDoc();
54     }
55     
56     public javax.enterprise.deploy.model.DDBeanRoot JavaDoc getDDBeanRoot() {
57         return ddroot;
58     }
59         
60     public javax.enterprise.deploy.model.DDBeanRoot JavaDoc getDDBeanRoot(String JavaDoc str) {
61         if(str.equals("WEB-INF/webservices.xml") || str.equals("WEB-INF/web.xml")){ //NOI18N
62
// TODO Extend to test ServletRef DConfigBean
63
//later we need to return DDBeanRoot with some values and write more
64
//tests to make sure sun-web.xml getting the required default values
65
//from ServletRef DConfigBean in case this ServletRef represents a
66
//web services.
67
return null;
68         }else{
69             throw new UnsupportedOperationException JavaDoc();
70         }
71     }
72
73     public java.io.InputStream JavaDoc getEntry(String JavaDoc str) {
74         throw new UnsupportedOperationException JavaDoc();
75     }
76     
77     public String JavaDoc getModuleDTDVersion() {
78         throw new UnsupportedOperationException JavaDoc() ;
79     }
80     
81     public String JavaDoc[] getText(String JavaDoc str) {
82         throw new UnsupportedOperationException JavaDoc();
83     }
84     
85     public javax.enterprise.deploy.shared.ModuleType JavaDoc getType() {
86         if (null != ddroot) {
87             if (ddroot.getXpath().startsWith("/web-app")) {
88                 return javax.enterprise.deploy.shared.ModuleType.WAR;
89             }
90             if (ddroot.getXpath().startsWith("/ejb-jar")) {
91                 return javax.enterprise.deploy.shared.ModuleType.EJB;
92             }
93         }
94         throw new UnsupportedOperationException JavaDoc();
95     }
96     
97     public void setDDBeanRoot(javax.enterprise.deploy.model.DDBeanRoot JavaDoc ddroot) {
98         this.ddroot = ddroot;
99     }
100 }
101
Popular Tags