KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > test > java > sourceexception > ConstructorChanged


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 /*
21  * ConstructorChanged.java
22  *
23  * Created on June 26, 2000, 9:29 AM
24  */

25
26 package org.netbeans.test.java.sourceexception.ConstructorChanged;
27
28 //import org.openide.src.Identifier;
29
//import org.openide.src.SourceException;
30
import org.netbeans.test.java.Common;
31 import org.openide.loaders.DataObject;
32
33 /**
34  * @author Jan Becicka <Jan.Becicka@sun.com>
35  */

36
37 public class ConstructorChanged extends org.netbeans.test.java.XRunner {
38
39     public static void main(java.lang.String JavaDoc[] args) {
40         junit.textui.TestRunner.run(suite());
41     }
42
43     public ConstructorChanged() {
44         super("");
45     }
46     
47     public ConstructorChanged(java.lang.String JavaDoc testName) {
48         super(testName);
49     }
50     
51     public static org.netbeans.junit.NbTest suite() {
52         return new org.netbeans.junit.NbTestSuite(ConstructorChanged.class);
53     }
54     
55     /** "body" of this TestCase
56      * @param o SourceElement - target for generating
57      * @param log log is used for logging StackTraces
58      * @throws Exception
59      * @return true if test passed
60      * false if failed
61      */

62     public boolean go(Object JavaDoc o, java.io.PrintWriter JavaDoc log) throws Exception JavaDoc {
63         
64 // org.openide.src.ClassElement clazz = ((org.openide.src.SourceElement) o).getClasses()[0];
65
// System.setProperty(org.netbeans.test.java.eventfiring.MyListener.RESULT_KEY,"");
66
boolean passed = true;
67         
68 // org.openide.src.ConstructorElement ce = Common.createConstructor(null,Common.PARS1);
69
// clazz.addConstructor(ce);
70
// ce = clazz.getConstructor(Common.TPARS1);
71
// clazz.removeConstructor(ce);
72
//
73
// try {
74
// ce.setBody("//blah\n");
75
// } catch (SourceException e){
76
// ref("setBody succesfully throws "+e);
77
// }
78
//
79
// try {
80
// ce.setExceptions(new Identifier[]{Identifier.create("java.lang.Exception","Exception")});
81
// } catch (SourceException e){
82
// ref("setExceptions succesfully throws "+e);
83
// }
84
//
85
// try {
86
// ce.setModifiers(java.lang.reflect.Modifier.PROTECTED);
87
// } catch (SourceException e){
88
// ref("setModifiers succesfully throws "+e);
89
// }
90
//
91
// try {
92
// ce.setParameters(Common.PARS2);
93
// } catch (SourceException e){
94
// ref("setParameters succesfully throws "+e);
95
// }
96
//
97
// try {
98
// ce.setName(Identifier.create("ranamedConstructor"));
99
// } catch (SourceException e){
100
// ref("setName succesfully throws "+e);
101
// }
102

103         return passed;
104     }
105     
106     protected boolean writeResult(DataObject DO) {
107         return true;
108     }
109     
110     /**
111      */

112     protected void setUp() {
113         super.setUp();
114         name = "JavaTestSourceExceptionThrowingConstructorsChanged";
115         packageName = "org.netbeans.test.java.testsources";
116     }
117     
118 }
119
Popular Tags