1 19 20 package org.netbeans.modules.j2ee.earproject; 21 22 import java.io.File ; 23 import org.netbeans.junit.NbTestCase; 24 import org.netbeans.spi.project.support.ant.AntProjectHelper; 25 import org.netbeans.spi.project.support.ant.ProjectGenerator; 26 import org.openide.filesystems.FileObject; 27 import org.openide.filesystems.FileUtil; 28 29 32 public final class EarProjectTypeTest extends NbTestCase { 33 34 private EarProjectType prjType; 35 36 public EarProjectTypeTest(String testName) { 37 super(testName); 38 } 39 40 protected void setUp() throws Exception { 41 clearWorkDir(); 42 prjType = new EarProjectType(); 43 } 44 45 public void testCreateProject() throws Exception { 46 File prjDirF = new File (getWorkDir(), "EarProjectTypeTest.testCreatProject"); 47 prjDirF.mkdirs(); 48 FileObject prjDirFO = FileUtil.toFileObject(prjDirF); 49 AntProjectHelper tmp = ProjectGenerator.createProject(prjDirFO, prjType.getType()); 50 prjType.createProject(tmp); 51 } 52 53 public void testCreateProjectNullArg() throws Exception { 54 try { 55 prjType.createProject(null); 56 fail("null is an invalid argument"); 57 } catch (IllegalArgumentException ex) { 58 } 60 } 61 62 public void testGetType() { 63 assertEquals(prjType.getType(), "org.netbeans.modules.j2ee.earproject"); 64 } 65 66 } 67 | Popular Tags |