1 7 8 package org.netbeans.modules.xml.retriever.catalog.test; 9 10 import java.io.File ; 11 import java.io.IOException ; 12 import junit.framework.*; 13 import org.netbeans.modules.xml.xam.ModelSource; 14 import org.netbeans.modules.xml.xam.locator.CatalogModelException; 15 import org.openide.filesystems.FileObject; 16 import org.openide.filesystems.FileUtil; 17 18 22 public class ModelSourceTest extends TestCase { 23 24 public ModelSourceTest(String testName) { 25 super(testName); 26 } 27 28 protected void setUp() throws Exception { 29 } 30 31 protected void tearDown() throws Exception { 32 } 33 34 public void testModelSource(){ 35 36 41 42 43 44 45 46 47 48 49 50 51 79 80 81 83 85 86 File file = null; 87 try { 88 file = File.createTempFile("modelsource", "deleteme"); 89 file.deleteOnExit(); 90 } catch (IOException ex) { 91 ex.printStackTrace(); 92 } 93 FileObject fo = FileUtil.toFileObject(FileUtil.normalizeFile(file)); 95 ModelSource ms = null; 96 try { 97 ms = TestCatalogModel.getDefault().createTestModelSource(fo, true); 98 } catch (CatalogModelException ex) { 99 ex.printStackTrace(); 100 } 101 102 System.out.println(ms.getLookup().lookup(FileObject.class)); 103 104 } 105 106 } 107 | Popular Tags |