1 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 ; 25 public class IndentCorePerformer extends NbTestCase { 26 public IndentCorePerformer(String testCase) { 27 super(testCase); 28 } 29 public void tearDown() throws Exception { 30 assertFile("Output does not match golden file.", getGoldenFile(), 31 new File (getWorkDir(), this.getName() + ".ref"), new File (getWorkDir(), 32 this.getName() + ".diff"), new org.netbeans.test.editor.LineDiff(false)); 33 } 34 public void testwholeClass() throws Exception { 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 { 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 { 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 { 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 { 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 |