1 19 package org.netbeans.jmi.javamodel.codegen; 20 21 import java.io.IOException ; 22 import org.netbeans.junit.NbTestCase; 23 import org.openide.filesystems.FileStateInvalidException; 24 25 30 public abstract class CodegenTestCase extends NbTestCase { 31 32 String testClassName; 33 34 public CodegenTestCase(String name, String testClassName) { 35 super(name); 36 this.testClassName = testClassName; 37 } 38 39 static void sleep(int mills) { 40 try { 41 Thread.sleep(mills); 42 } 43 catch (InterruptedException ie) { 44 ie.printStackTrace(); 45 } 46 } 47 48 53 protected void makeDiff(String passfileName) { 54 try { 55 assertFile(testClassName + " is not correctly generated.", 56 getGoldenFile(passfileName + ".pass"), 57 Utility.getFile(getDataDir(), "org/netbeans/test/codegen/" + testClassName + ".java"), 58 getWorkDir() 59 ); 60 } 61 catch (FileStateInvalidException e) { 62 assertTrue(e.toString(), false); 63 } 64 catch (IOException e) { 65 assertTrue(e.toString(), false); 66 } 67 } 68 69 } 70 | Popular Tags |