1 19 20 27 28 package DataLoaderTests.DataObjectTest; 29 30 import junit.framework.*; 31 import org.netbeans.junit.*; 32 import org.openide.loaders.DataObject; 33 34 public class DataObjectTest_others extends NbTestCase { 35 36 37 public DataObjectTest_others(java.lang.String testName) { 38 super(testName); 39 } 40 41 42 public static void main(java.lang.String [] args) { 43 junit.textui.TestRunner.run(suite()); 44 } 45 46 47 public static Test suite() { 48 NbTestSuite suite = new NbTestSuite(DataObjectTest_others.class); 49 return suite; 50 } 51 52 DataObjectTest DOT = null; 54 55 56 59 void prepare() { 60 try { 61 if (Manager.getWorkDirPath()==null) System.setProperty("nbjunit.workdir",System.getProperty("netbeans.user")); 63 String newname = NAME.substring(NAME.lastIndexOf('/')+1,((NAME.lastIndexOf('.')==-1)?NAME.length():NAME.lastIndexOf('.'))); 65 DOT = new DataObjectTest(getName()); 66 System.out.println("Name: " + DOT.getName()); 67 if (NAME.endsWith(".")) NAME = NAME.substring(0,NAME.length()-1); 70 DOT.prepare(); 71 } catch (Exception e) { 72 e.printStackTrace(); 73 e.printStackTrace(getRef()); 74 assertTrue("Initialization of test failed! ->" + e,false); 75 } 76 } 77 78 81 void clean() { 82 DOT.clean(); 83 } 84 85 89 void dummyWait(int millis) { 90 try { 91 Thread.sleep(millis); 92 } catch (Exception ex) { 93 DOT.printException(ex); 94 } 95 } 96 97 100 public void testDOOthers() throws Exception { 101 102 prepare(); 104 DataObject testedDO = DataObjectTest.findResource(NAME ); 108 DOT.shadowMe(testedDO).delete(); 110 DOT.checkTemplate(testedDO); 116 DOT.testHelpCtx(testedDO); 117 clean(); 118 System.out.println("\n" + DOT.successful ); 121 assertTrue("Others test failed!",DOT.successful); 127 } 128 129 public static final boolean PRINT_EXCEPTIONS = true; 131 132 public static final String PASSED = "passed.\n"; 133 public static final String FAILED = "failed.\n"; 134 135 protected String NAME = null;} 137 | Popular Tags |