1 19 20 package org.netbeans.modules.web.freeform; 21 22 import java.util.ArrayList ; 23 import java.util.Arrays ; 24 import java.util.Collections ; 25 import java.util.List ; 26 import org.netbeans.api.project.ProjectInformation; 27 import org.netbeans.api.project.ProjectUtils; 28 import org.netbeans.api.project.SourceGroup; 29 import org.netbeans.api.project.Sources; 30 import org.netbeans.junit.NbTestCase; 31 import org.netbeans.spi.project.ActionProvider; 32 import org.netbeans.spi.project.support.ant.PropertyEvaluator; 33 import org.openide.util.Lookup; 34 35 42 47 public class FreeformProjectWebTest extends TestBaseWeb { 48 49 public FreeformProjectWebTest (String name) { 50 super(name); 51 } 52 53 public void testPropertyEvaluation() throws Exception { 54 PropertyEvaluator eval = jakarta.evaluator(); 55 assertEquals("right src.home", "src", eval.getProperty("src.home")); 56 } 57 58 public void testProjectInformation() throws Exception { 59 ProjectInformation info = ProjectUtils.getInformation(jakarta); 60 assertEquals("correct name", "My_App", info.getName()); 61 assertEquals("same display name", "My App", info.getDisplayName()); 62 } 63 64 public void testSources() throws Exception { 65 Sources s = ProjectUtils.getSources(jakarta); 66 SourceGroup[] groups = s.getSourceGroups(Sources.TYPE_GENERIC); 67 assertEquals("one generic group", 1, groups.length); 68 assertEquals("right root folder", jakarta.getProjectDirectory(), groups[0].getRootFolder()); 69 assertEquals("right display name", "My App", groups[0].getDisplayName()); 70 groups = s.getSourceGroups("java"); 71 assertEquals("one Java group", 1, groups.length); 72 assertEquals("right root folder #1", jakarta.getProjectDirectory().getFileObject("src"), groups[0].getRootFolder()); 73 assertEquals("right display name #1", "Web Module Sources", groups[0].getDisplayName()); 74 groups = s.getSourceGroups("doc_root"); 75 assertEquals("one doc root group", 1, groups.length); 76 assertEquals("right root folder #1", jakarta.getProjectDirectory().getFileObject("web"), groups[0].getRootFolder()); 77 assertEquals("right display name #1", "Web Pages", groups[0].getDisplayName()); 78 } 79 80 } 81 | Popular Tags |