KickJava   Java API By Example, From Geeks To Geeks.

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


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

25
26 package org.netbeans.test.java.sourceexception.InitializerChanged;
27
28 import org.openide.loaders.DataObject;
29 //import org.openide.src.SourceException;
30

31 /**
32  * @author Jan Becicka <Jan.Becicka@sun.com>
33  */

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

60     public boolean go(Object JavaDoc o, java.io.PrintWriter JavaDoc log) throws Exception JavaDoc {
61         
62 // org.openide.src.ClassElement clazz = ((org.openide.src.SourceElement) o).getClasses()[0];
63
// System.setProperty(org.netbeans.test.java.eventfiring.MyListener.RESULT_KEY,"");
64
boolean passed = true;
65 //
66
// org.openide.src.InitializerElement ie = org.netbeans.test.java.Common.createInitializer();
67
// clazz.addInitializer(ie);
68
// ie = clazz.getInitializers()[0];
69
// clazz.removeInitializer(ie);
70
//
71
// try {
72
// ie.setBody("//blah\n");
73
// } catch (SourceException e){
74
// ref("setBody succesfully throws "+e);
75
// }
76
//
77
// try {
78
// ie.setStatic(false);
79
// } catch (SourceException e){
80
// ref("setStatic succesfully throws "+e);
81
// }
82
return passed;
83     }
84     
85     protected boolean writeResult(DataObject DO) {
86         return true;
87     }
88     
89     /**
90      */

91     protected void setUp() {
92         super.setUp();
93         name = "JavaTestSourceExceptionThrowingInitializerChanged";
94         packageName = "org.netbeans.test.java.testsources";
95     }
96 }
97
Popular Tags