KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > test > editor > indentation > programmatic > IndentCorePerformer


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.test.editor.indentation.programmatic;
20 import java.io.*;
21 import java.util.*;
22 import org.netbeans.junit.NbTestCase;
23 import org.netbeans.junit.NbTestSuite;
24 import java.io.File JavaDoc;
25 public class IndentCorePerformer extends NbTestCase {
26     public IndentCorePerformer(String JavaDoc testCase) {
27         super(testCase);
28     }
29     public void tearDown() throws Exception JavaDoc {
30         assertFile("Output does not match golden file.", getGoldenFile(),
31         new File JavaDoc(getWorkDir(), this.getName() + ".ref"), new File JavaDoc(getWorkDir(),
32         this.getName() + ".diff"), new org.netbeans.test.editor.LineDiff(false));
33     }
34     public void testwholeClass() throws Exception JavaDoc {
35         PrintWriter log = null;
36         PrintWriter ref = null;
37         try {
38             log = new PrintWriter(getLog());
39             ref = new PrintWriter(getRef());
40             Map indentationProperties = new HashMap();
41             new IndentCore().run(log, ref, "data/testfiles/IndentCorePerformer/wholeClass.txt", "text/x-java", indentationProperties);
42         } finally {
43             log.flush();
44             ref.flush();
45         }
46     }
47     public void testcomplexMethod() throws Exception JavaDoc {
48         PrintWriter log = null;
49         PrintWriter ref = null;
50         try {
51             log = new PrintWriter(getLog());
52             ref = new PrintWriter(getRef());
53             Map indentationProperties = new HashMap();
54             new IndentCore().run(log, ref, "data/testfiles/IndentCorePerformer/complexMethod.txt", "text/x-java", indentationProperties);
55         } finally {
56             log.flush();
57             ref.flush();
58         }
59     }
60     public void testcomplexClass() throws Exception JavaDoc {
61         PrintWriter log = null;
62         PrintWriter ref = null;
63         try {
64             log = new PrintWriter(getLog());
65             ref = new PrintWriter(getRef());
66             Map indentationProperties = new HashMap();
67             new IndentCore().run(log, ref, "data/testfiles/IndentCorePerformer/complexClass.txt", "text/x-java", indentationProperties);
68         } finally {
69             log.flush();
70             ref.flush();
71         }
72     }
73     public void testwholeMethod() throws Exception JavaDoc {
74         PrintWriter log = null;
75         PrintWriter ref = null;
76         try {
77             log = new PrintWriter(getLog());
78             ref = new PrintWriter(getRef());
79             Map indentationProperties = new HashMap();
80             new IndentCore().run(log, ref, "data/testfiles/IndentCorePerformer/wholeMethod.txt", "text/x-java", indentationProperties);
81         } finally {
82             log.flush();
83             ref.flush();
84         }
85     }
86     public void testEngine() throws Exception JavaDoc {
87         PrintWriter log = null;
88         PrintWriter ref = null;
89         try {
90             log = new PrintWriter(getLog());
91             ref = new PrintWriter(getRef());
92             Map indentationProperties = new HashMap();
93             new IndentCore().run(log, ref, "data/testfiles/IndentCorePerformer/Engine.txt", "text/x-java", indentationProperties);
94         } finally {
95             log.flush();
96             ref.flush();
97         }
98     }
99 }
100
Popular Tags