1 19 20 package org.netbeans.modules.web.freeform; 21 22 import java.net.URL ; 23 import java.util.Arrays ; 24 import java.util.Collections ; 25 import org.netbeans.api.java.queries.SourceForBinaryQuery; 26 import org.openide.filesystems.FileObject; 27 import org.openide.modules.ModuleInfo; 28 import org.openide.util.Lookup; 29 30 34 public class SourceForBinaryQueryImplWebTest extends TestBaseWeb { 35 36 public SourceForBinaryQueryImplWebTest (String name) { 37 super(name); 38 } 39 40 public void testFindSourcesForBinaries() throws Exception { 41 FileObject srcroot = jakarta.getProjectDirectory().getFileObject("src"); 42 URL binroot = new URL (jakarta.getProjectDirectory().getURL(), "build/WEB-INF/classes/"); 43 assertEquals("correct source root for " + binroot, Collections.singletonList(srcroot), Arrays.asList(SourceForBinaryQuery.findSourceRoots(binroot).getRoots())); 44 binroot = new URL (jakarta.getProjectDirectory().getURL(), "build/nonsense/"); 45 assertEquals("no source root for " + binroot, Collections.EMPTY_LIST, Arrays.asList(SourceForBinaryQuery.findSourceRoots(binroot).getRoots())); 46 } 47 48 } 49 | Popular Tags |