KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > xml > test > core > Fail


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 package org.netbeans.xml.test.core;
20
21 import junit.framework.Test;
22 import junit.framework.TestSuite;
23 import junit.textui.TestRunner;
24 import org.netbeans.junit.NbTestCase;
25 import org.netbeans.junit.NbTestSuite;
26 import org.openide.ErrorManager;
27 /**
28  * <P>
29  * <P>
30  * <FONT COLOR="#CC3333" FACE="Courier New, Monospaced" SIZE="+1">
31  * <B>
32  * <BR> XML Module Jemmy Test: NewFromTemplate
33  * </B>
34  * </FONT>
35  * <BR><BR><B>What it tests:</B><BR>
36  *
37  * This test tests New From Template action on all XML's templates.
38  *
39  * <BR><BR><B>How it works:</B><BR>
40  *
41  * 1) create new documents from template<BR>
42  * 2) write the created documents to output<BR>
43  * 3) close source editor<BR>
44  *
45  * <BR><BR><B>Settings:</B><BR>
46  * none<BR>
47  *
48  * <BR><BR><B>Output (Golden file):</B><BR>
49  * Set XML documents.<BR>
50  *
51  * <BR><B>To Do:</B><BR>
52  * none<BR>
53  *
54  * <P>Created on Januar 09, 2001, 12:33 PM
55  * <P>
56  */

57
58 public class Fail extends NbTestCase {
59     public Fail(String JavaDoc testName) {
60     super(testName);
61     }
62     
63 // ----------------------- MAIN ---------------------------//
64

65     public static Test suite() {
66     TestSuite suite = new NbTestSuite();
67     System.out.println("");
68     System.out.println("SUIT, ktera nahlasi exception");
69     int i = 1;
70     while (i-- > 0){
71         try {
72         Thread.currentThread().sleep(3000);
73         } catch (InterruptedException JavaDoc ex) {
74         ex.printStackTrace();
75         }
76         System.out.print("jeste zbyva");
77         System.out.println(Integer.toString(i));
78     }
79     System.out.println("");
80     ErrorManager errMan = ErrorManager.getDefault();
81     errMan.notify(errMan.USER,new NullPointerException JavaDoc("MOJE EXCEPTION"));
82     try {
83         Thread.currentThread().sleep(10000);
84     } catch (InterruptedException JavaDoc ex) {
85         ex.printStackTrace();
86     }
87 // suite.addTest(new CoreTemplatesTest("testNewXMLFromTemplate"));
88
return suite;
89     }
90     
91     public static void main(String JavaDoc[] args) throws Exception JavaDoc {
92     //DEBUG = true;
93
//JemmyProperties.getCurrentTimeouts().loadDebugTimeouts();
94
TestRunner.run(suite());
95     }
96     
97 }
98
99
100
101
Popular Tags