Commits

Jan Lahoda committed d83d77a

Show correct display names for categories.

  • Participants
  • Parent commits 50fa233

Comments (0)

Files changed (2)

cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java

 import org.netbeans.spi.editor.mimelookup.MimeDataProvider;
 import org.netbeans.spi.java.hints.Hint;
 import org.openide.filesystems.MIMEResolver;
+import org.openide.util.NbCollections;
 import org.openide.util.NbPreferences.Provider;
 import org.openide.xml.EntityCatalog;
 import org.openide.xml.XMLUtil;
         }
 
         bundlesToCopy.addAll(RESOURCES);
+        bundlesToCopy.addAll(info.additionalResources);
         copyResources(out, info, bundlesToCopy);
 
         //generated-layer.xml:
-        Enumeration<URL> resources = this.getClass().getClassLoader().getResources("META-INF/generated-layer.xml");
+        List<URL> layers2Merge = new ArrayList<URL>();
+        List<String> layerNames = new ArrayList<String>();
+
+        layerNames.add("META-INF/generated-layer.xml");
+        layerNames.addAll(info.additionalLayers);
+
+        for (String layerName : layerNames) {
+            for (URL layerURL : NbCollections.iterable(this.getClass().getClassLoader().getResources(layerName))) {
+                layers2Merge.add(layerURL);
+            }
+        }
+
         Document main = null;
 
-        while (resources.hasMoreElements()) {
-            URL res = resources.nextElement();
+        for (URL res : layers2Merge) {
             Document current = XMLUtil.parse(new InputSource(res.openStream()), false, false, null, new EntityCatalog() {
                 @Override
                 public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
 
     public static final class Info {
         private final Set<String> additionalRoots = new HashSet<String>();
+        private final Set<String> additionalResources = new HashSet<String>();
+        private final Set<String> additionalLayers = new HashSet<String>();
         private final List<MetaInfRegistration> metaInf = new LinkedList<MetaInfRegistration>();
         private final Set<String> copyMetaInfRegistration = new HashSet<String>();
         private       boolean escapeJavaxLang;
             additionalRoots.addAll(Arrays.asList(fqns));
             return this;
         }
+        public Info addAdditionalResources(String... paths) {
+            additionalResources.addAll(Arrays.asList(paths));
+            return this;
+        }
+        public Info addAdditionalLayers(String... paths) {
+            additionalLayers.addAll(Arrays.asList(paths));
+            return this;
+        }
         public Info addMetaInfRegistrations(MetaInfRegistration... registrations) {
             metaInf.addAll(Arrays.asList(registrations));
             return this;

cmdline/tool/test/unit/src/org/netbeans/modules/jackpot30/cmdline/CreateTool.java

     @Override
     protected Info computeInfo() {
         return new Info().addAdditionalRoots(Main.class.getName(), DeclarativeHintsTestBase.class.getName(), OpenProjectsTrampolineImpl.class.getName(), J2SEProject.class.getName(), DefaultJavaPlatformProvider.class.getName())
+                         .addAdditionalResources("org/netbeans/modules/java/hints/resources/Bundle.properties")
+                         .addAdditionalLayers("org/netbeans/modules/java/hints/resources/layer.xml")
                          .addMetaInfRegistrations(new MetaInfRegistration(org.netbeans.modules.project.uiapi.OpenProjectsTrampoline.class, OpenProjectsTrampolineImpl.class))
                          .addExcludePattern(Pattern.compile("junit\\.framework\\..*"))
                          .setEscapeJavaxLang();