This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 54161
Collapse All | Expand All

(-)antsrc/org/netbeans/nbbuild/ModuleListParser.java (-5 / +14 lines)
Lines 562-579 Link Here
562
                throw new IOException("You must declare either <suite-component/> or <standalone/> for an external module in " + new File((String) properties.get("basedir")));
562
                throw new IOException("You must declare either <suite-component/> or <standalone/> for an external module in " + new File((String) properties.get("basedir")));
563
            }
563
            }
564
            // If scan.binaries property is set or it runs from tests we scan binaries otherwise sources.
564
            // If scan.binaries property is set or it runs from tests we scan binaries otherwise sources.
565
            if (properties.get("scan.binaries") != null || 
565
            boolean xtest = properties.get("xtest.home") != null && properties.get("xtest.testtype") != null;
566
                    properties.get("xtest.home") != null && properties.get("xtest.testtype") != null) {
566
            if (properties.get("scan.binaries") != null || xtest) {
567
                entries = scanBinaries(properties, project);
567
                entries = scanBinaries(properties, project);
568
                // module itself has to be added because it doesn't have to be in binaries
568
                // module itself has to be added because it doesn't have to be in binaries
569
                Entry e = scanStandaloneSource(properties, project);
569
                    Entry e = scanStandaloneSource(properties, project);
570
                entries.put(e.getCnb(), e);
570
                    // xtest gets module jar and cluster from binaries
571
                    if (e.clusterName == null && xtest) {
572
                         Entry oldEntry = (Entry) entries.get(e.getCnb());
573
                         if (oldEntry != null) {
574
                             e = new Entry(e.getCnb(),oldEntry.getJar(),
575
                                          e.getClassPathExtensions(),e.sourceLocation,
576
                                          e.netbeansOrgPath,e.buildPrerequisites,
577
                                          oldEntry.getClusterName());  
578
                         }
579
                    }
580
                    entries.put(e.getCnb(), e);
571
            } else {
581
            } else {
572
                entries = scanNetBeansOrgSources(new File(nball), properties, project);
582
                entries = scanNetBeansOrgSources(new File(nball), properties, project);
573
            }
583
            }
574
        }
584
        }
575
    }
585
    }
576
    
577
    /**
586
    /**
578
     * Find all entries in this list.
587
     * Find all entries in this list.
579
     * @return a set of all known entries
588
     * @return a set of all known entries
(-)antsrc/org/netbeans/nbbuild/ParseProjectXml.java (-2 / +289 lines)
Lines 28-37 Link Here
28
import java.io.OutputStream;
28
import java.io.OutputStream;
29
import java.util.ArrayList;
29
import java.util.ArrayList;
30
import java.util.Arrays;
30
import java.util.Arrays;
31
import java.util.HashMap;
31
import java.util.HashSet;
32
import java.util.HashSet;
32
import java.util.Hashtable;
33
import java.util.Hashtable;
33
import java.util.Iterator;
34
import java.util.Iterator;
35
import java.util.LinkedList;
34
import java.util.List;
36
import java.util.List;
37
import java.util.Map;
35
import java.util.Set;
38
import java.util.Set;
36
import java.util.StringTokenizer;
39
import java.util.StringTokenizer;
37
import java.util.jar.Attributes;
40
import java.util.jar.Attributes;
Lines 189-194 Link Here
189
        classPathExtensionsProperty = s;
192
        classPathExtensionsProperty = s;
190
    }
193
    }
191
194
195
    // test distribution path 
196
    public  static String testDistLocation;
197
198
    public static class TestType {
199
        private String name;
200
        private String folder;
201
        private String runtimeCP;
202
        private String compileCP;
203
204
        public TestType() {}
205
        public String getName() {
206
            return name;
207
        }
208
209
        public void setName(String name) {
210
            this.name = name;
211
        }
212
213
        public String getFolder() {
214
            return folder;
215
        }
216
217
        public void setFolder(String folder) {
218
            this.folder = folder;
219
        }
220
221
        public String getRuntimeCP() {
222
            return runtimeCP;
223
        }
224
225
        public void setRuntimeCP(String runtimeCP) {
226
            this.runtimeCP = runtimeCP;
227
        }
228
229
        public String getCompileCP() {
230
            return compileCP;
231
        }
232
233
        public void setCompileCP(String compileCP) {
234
            this.compileCP = compileCP;
235
        }
236
        
237
    }
238
      List /*<TestType>*/ testTypes = new LinkedList();
239
      
240
      public void addTestType(TestType testType) {
241
          testTypes.add(testType);
242
      }
243
      public void add(TestType testType) {
244
          testTypes.add(testType);
245
      }
246
  
247
      
248
      private TestType getTestType(String name) {
249
          for (int i = 0 ; i < testTypes.size() ; i++) {
250
              TestType testType = (TestType) testTypes.get(i);
251
              if (testType.getName().equals(name)) {
252
                  return testType;
253
              }
254
          }
255
          return null;
256
      }
257
 
258
 
192
    private void define(String prop, String val) {
259
    private void define(String prop, String val) {
193
        log("Setting " + prop + "=" + val, Project.MSG_VERBOSE);
260
        log("Setting " + prop + "=" + val, Project.MSG_VERBOSE);
194
        String old = getProject().getProperty(prop);
261
        String old = getProject().getProperty(prop);
Lines 198-203 Link Here
198
        getProject().setNewProperty(prop, val);
265
        getProject().setNewProperty(prop, val);
199
    }
266
    }
200
    
267
    
268
    
201
    public void execute() throws BuildException {
269
    public void execute() throws BuildException {
202
        try {
270
        try {
203
            if (getProjectFile() == null) {
271
            if (getProjectFile() == null) {
Lines 276-282 Link Here
276
            }
344
            }
277
            ModuleListParser modules = null;
345
            ModuleListParser modules = null;
278
            Dep[] deps = null;
346
            Dep[] deps = null;
279
            if (moduleDependenciesProperty != null || moduleClassPathProperty != null || moduleRunClassPathProperty != null) {
347
            if (moduleDependenciesProperty != null || 
348
                    moduleClassPathProperty != null || 
349
                    moduleRunClassPathProperty != null ||
350
                    testTypes.size() > 0) {
280
                String nball = getProject().getProperty("nb_all");
351
                String nball = getProject().getProperty("nb_all");
281
                Hashtable properties = getProject().getProperties();
352
                Hashtable properties = getProject().getProperties();
282
                properties.put("project", project.getAbsolutePath());
353
                properties.put("project", project.getAbsolutePath());
Lines 348-353 Link Here
348
                    define(classPathExtensionsProperty, val);
419
                    define(classPathExtensionsProperty, val);
349
                }
420
                }
350
            }
421
            }
422
            
423
            // Test dependecies
424
            //
425
            if (modules != null) {
426
               String testDistLocation = getProject().getProperty(TestDeps.TEST_DIST_VAR);
427
               if (testDistLocation == null) {
428
                   testDistLocation = "${" + TestDeps.TEST_DIST_VAR + "}";
429
               }
430
               ParseProjectXml.testDistLocation = testDistLocation;
431
               
432
                TestDeps testDepss[] = getTestDeps(pDoc,modules,getCodeNameBase(pDoc));
433
                for (int tdIt = 0 ; tdIt < testDepss.length ; tdIt++) {
434
                    TestDeps td = testDepss[tdIt];
435
                    // unit tests 
436
                    TestType testType = getTestType(td.testtype);
437
                    if (testType!= null ) {
438
                        if (testType.getFolder() != null) {
439
                            define (testType.getFolder(),td.getTestFolder());
440
                        }
441
                        if (testType.getCompileCP() != null) {
442
                            
443
                            define(testType.getCompileCP(),td.getCompileClassPath());
444
                        }
445
                        if (testType.getRuntimeCP() != null) {
446
                            define(testType.getRuntimeCP(),td.getRuntimeClassPath());
447
                        }
448
449
                    } 
450
                }
451
            }
351
        } catch (BuildException e) {
452
        } catch (BuildException e) {
352
            throw e;
453
            throw e;
353
        } catch (Exception e) {
454
        } catch (Exception e) {
Lines 737-743 Link Here
737
        }
838
        }
738
        return module.getJar();
839
        return module.getJar();
739
    }
840
    }
740
    
841
 
842
  final class TestDeps {
843
      public static final String UNIT = "unit";
844
      public static final String QA_FUNCTIONAL = "qa-functional";
845
      // unit, qa-functional, performance
846
      final String testtype;
847
      // all dependecies for the testtype
848
      final  List /*<TestDep>*/ dependencies = new ArrayList();
849
      // code name base of tested module
850
      final String cnb;
851
      final ModuleListParser modulesParser;
852
853
      public  static final String TEST_DIST_VAR = "test.dist.dir";
854
      public TestDeps(String testtype,String cnb,ModuleListParser modulesParser) {
855
          assert modulesParser != null;
856
          this.testtype = testtype;
857
          this.cnb = cnb;
858
          this.modulesParser = modulesParser;
859
      }
860
      
861
      public List/*<String>*/ getFiles(boolean compile) {
862
          List/*<String>*/ files = new ArrayList();
863
          for (int dIt = 0 ; dIt < dependencies.size() ; dIt++) {
864
              files.addAll(((TestDep)dependencies.get(dIt)).getFiles(compile));
865
          }
866
          return files;
867
      }
868
      public void addDepenency(TestDep dep) {
869
          dependencies.add(dep);
870
      }
871
872
        private String getTestFolder() {
873
            ModuleListParser.Entry entry = modulesParser.findByCodeNameBase(cnb);
874
            String sep = File.separator;
875
            
876
            String cluster = entry.getClusterName(); 
877
            if (cluster == null) {
878
                // no cluster name is specified for standalone or module in module suite
879
                cluster = "cluster";
880
            }
881
            return ParseProjectXml.testDistLocation + sep + testtype + sep + entry.getClusterName() + sep + cnb.replace('.','-');
882
        }
883
884
        String getCompileClassPath() {
885
            return getPath(getFiles(true));
886
        }
887
        private String getPath(List/*<String>*/ files) {
888
            StringBuffer path = new StringBuffer();
889
            Set/*<String>*/ filesSet = new HashSet();
890
            for (int fIt = 0 ; fIt < files.size() ; fIt++) {
891
                String filePath = (String)files.get(fIt);
892
                if (!filesSet.contains(filePath)) {
893
                    if (path.length() > 0) {
894
                        path.append(File.pathSeparatorChar);
895
                    } 
896
                    filesSet.add(filePath);
897
                    path.append(filePath);
898
                }
899
            }
900
            return path.toString();    
901
        }
902
903
        String getRuntimeClassPath() {
904
            return getPath(getFiles(false));
905
        }
906
        
907
908
  }
909
   /** Test dependency for module and type
910
    */ 
911
   final class TestDep {
912
       final ModuleListParser modulesParser;
913
       // code name base
914
       final String cnb;
915
       // dependencies on tests of modules
916
       final boolean recursive;
917
       final boolean test;
918
       // runtime classpath
919
       final boolean compile;
920
       TestDeps testDeps;
921
       
922
       TestDep (String cnb,ModuleListParser modules, boolean recursive,boolean test, boolean compile,TestDeps testDeps) {   
923
           this.modulesParser = modules;
924
           this.cnb = cnb;
925
           this.recursive = recursive;
926
           this.test = test;
927
           this.testDeps = testDeps;
928
           this.compile = compile;
929
       }
930
       /* get modules dependecies
931
        */
932
       List/*<ModuleListParser.Entry>*/ getModules() {
933
           List /*<ModuleListParser.Entry>*/ entries = new ArrayList();
934
           if (!test) {
935
               if (recursive ) {
936
                   Map/*<String,ModuleListParser.Entry>*/ entriesMap = new HashMap();
937
                   addRecursiveModules(cnb,entriesMap);
938
                   entries.addAll(entriesMap.values());
939
               } else {
940
                   entries.add(modulesParser.findByCodeNameBase(cnb));
941
               }
942
           }
943
           return entries;     
944
           
945
       } 
946
       
947
       private void addRecursiveModules(String cnd, Map entriesMap) {
948
           if (!entriesMap.containsKey(cnd)) {
949
               ModuleListParser.Entry entry = modulesParser.findByCodeNameBase(cnd);
950
               entriesMap.put(cnd,entry);
951
               String cnds[] = entry.getBuildPrerequisites();
952
               // cnds can be null
953
               if (cnds != null) {
954
                   for (int i = 0 ; i < cnds.length ; i++) {
955
                       addRecursiveModules(cnds[i],entriesMap);
956
                   }
957
               }
958
           }
959
       }
960
       List/*<String>*/ getFiles(boolean compile) {
961
           List/*<String>*/ files = new ArrayList();
962
           if (!compile ||  ( compile && this.compile)) {
963
               List /*<ModuleListParser.Entry>*/ modules = getModules();  
964
               for (int mIt = 0 ; mIt <modules.size() ; mIt++) {
965
                   ModuleListParser.Entry entry = (ModuleListParser.Entry)modules.get(mIt);
966
                   if (entry != null) {
967
                       files.add(entry.getJar().getAbsolutePath());
968
                   } else {
969
                       log("Entry doesn't exist.");
970
                   }
971
               }
972
               // get tests files
973
               if (test) {
974
                   // get test folder
975
                   ModuleListParser.Entry entry = (ModuleListParser.Entry) modulesParser.findByCodeNameBase(cnb);
976
                   String sep = File.separator;
977
                   String jarPath = ParseProjectXml.testDistLocation + sep + testDeps.testtype + sep +  entry.getClusterName() + sep + cnb.replace('.','-') + sep + "tests.jar";
978
                   files.add(jarPath);
979
               }
980
           }
981
           return files;
982
       }
983
   } 
741
    private String computeClassPathExtensions(Document pDoc) {
984
    private String computeClassPathExtensions(Document pDoc) {
742
        Element data = getConfig(pDoc);
985
        Element data = getConfig(pDoc);
743
        StringBuffer list = null;
986
        StringBuffer list = null;
Lines 847-850 Link Here
847
        return ppjar;
1090
        return ppjar;
848
    }
1091
    }
849
1092
1093
    private TestDeps[] getTestDeps(Document pDoc,ModuleListParser modules,String testCnb) {
1094
        assert modules != null;
1095
        Element cfg = getConfig(pDoc);
1096
        List testDepsList = new ArrayList(); 
1097
        Element pp = XMLUtil.findElement(cfg, "test-dependencies", NBM_NS);
1098
        if (pp != null) {
1099
            for (Iterator depssIt = XMLUtil.findSubElements(pp).iterator(); depssIt.hasNext();) {
1100
                Element depssEl = (Element) depssIt.next();
1101
                String testType = findTextOrNull(depssEl,"name");
1102
                if (testType == null) {
1103
                    testType = TestDeps.UNIT; // default variant
1104
                }
1105
                TestDeps testDeps = new TestDeps(testType,testCnb,modules);
1106
                testDepsList.add(testDeps);
1107
                for (Iterator depsIt = XMLUtil.findSubElements(depssEl).iterator() ; depsIt.hasNext();) {
1108
                    Element el = (Element) depsIt.next();
1109
                    if (el.getTagName().equals("test-dependency")) {
1110
                        // parse test dep
1111
                        boolean  test =   (XMLUtil.findElement(el,"test",NBM_NS) != null);;
1112
                        String cnb =  findTextOrNull(el,"code-name-base");
1113
                        boolean  recursive = (XMLUtil.findElement(el,"recursive",NBM_NS) != null);
1114
                        boolean  compile = (XMLUtil.findElement(el,"compile-dependency",NBM_NS) != null);                    
1115
                        testDeps.addDepenency(new TestDep(cnb,
1116
                                                         modules,
1117
                                                         recursive,
1118
                                                         test,
1119
                                                         compile,
1120
                                                         testDeps)); 
1121
                    }
1122
1123
                }
1124
            }
1125
        }
1126
        TestDeps testDepss[] = new TestDeps[testDepsList.size()];
1127
        testDepsList.toArray(testDepss);
1128
        return testDepss;      
1129
    }
1130
    private static String findTextOrNull(Element parentElement,String elementName) {
1131
        Element el = XMLUtil.findElement(parentElement,elementName,NBM_NS);
1132
        return (el == null) ? null :
1133
                              XMLUtil.findText(el);
1134
                
1135
    }
1136
 
850
}
1137
}
(-)templates/common.xml (-8 / +138 lines)
Lines 301-319 Link Here
301
        <property name="build.test.unit.dir" location="build/test/unit"/>
301
        <property name="build.test.unit.dir" location="build/test/unit"/>
302
        <property name="build.test.unit.classes.dir" location="${build.test.unit.dir}/classes"/>
302
        <property name="build.test.unit.classes.dir" location="${build.test.unit.dir}/classes"/>
303
        <property name="build.test.unit.results.dir" location="${build.test.unit.dir}/results"/>
303
        <property name="build.test.unit.results.dir" location="${build.test.unit.dir}/results"/>
304
305
        <property name="test.qa-functional.dir" location="test/qa-functional"/>
306
        <property name="test.qa-functional.src.dir" location="${test.qa-functional.dir}/src"/>
307
        <property name="build.test.qa-functional.dir" location="build/test/qa-functional"/>
308
        <property name="build.test.qa-functional.classes.dir" location="${build.test.qa-functional.dir}/classes"/>
309
        <property name="build.test.qa-functional.results.dir" location="${build.test.qa-functional.dir}/results"/>
310
        
304
        <property name="test.filter.trace" value="true"/>
311
        <property name="test.filter.trace" value="true"/>
305
        <path id="test.unit.cp">
312
        <path id="test.unit.cp">
306
            <!-- Cannot use <path refid="cp"/> since that uses ${module.classpath} and we want ${module.run.classpath}: -->
313
            <!-- Cannot use <path refid="cp"/> since that uses ${module.classpath} and we want ${module.run.classpath}: -->
307
            <pathelement path="${module.run.classpath}"/>
314
            <pathelement path="${test.unit.compile.cp}"/>
308
            <pathelement path="${cp.extra}"/>
315
            <pathelement path="${cp.extra}"/>
309
            <pathelement location="${cluster}/${module.jar}"/>
316
            <pathelement location="${cluster}/${module.jar}"/>
310
            <path refid="test.unit.lib.cp"/>
317
            <path refid="test.unit.lib.cp"/>
318
            <!-- for compatibility with property based classpath-->
319
            <pathelement path="${module.classpath}"/>
311
            <pathelement path="${test.unit.cp.extra}"/>
320
            <pathelement path="${test.unit.cp.extra}"/>
312
        </path>
321
        </path>
313
        <path id="test.unit.run.cp">
322
        <path id="test.unit.run.cp">
314
            <path refid="test.unit.cp"/>
323
            <!-- Cannot use <path refid="cp"/> since that uses ${module.classpath} and we want ${module.run.classpath}: -->
324
            <pathelement path="${test.unit.runtime.cp}"/>
325
            <pathelement path="${cp.extra}"/>
326
            <pathelement location="${cluster}/${module.jar}"/>
327
            <path refid="test.unit.lib.cp"/>
328
           <pathelement path="${build.test.unit.classes.dir}"/>
329
            <!-- for compatibility with property based classpath-->
330
            <pathelement path="${module.run.classpath}"/>
331
            <pathelement path="${test.unit.cp.extra}"/>
332
        </path>
333
        
334
        <!-- path reference used in both compiler and executor -->
335
        <path id="test.qa-functional.cp">
336
            <!-- Cannot use <path refid="cp"/> since that uses ${module.classpath} and we want ${module.run.classpath}: -->
337
            <pathelement path="${test.qa-functional.compile.cp}"/>
338
            <pathelement path="${cp.extra}"/>
339
            <pathelement location="${cluster}/${module.jar}"/>
340
            <path refid="test.unit.lib.cp"/>
341
            <pathelement path="${test.qa-functional.cp.extra}"/>
342
            <pathelement path="${nb_all}/jellytools/builds/jelly2-nb.jar"/>
343
            <pathelement location="${nb_all}/jemmy/builds/jemmy.jar"/>
344
        </path>
345
        <path id="test.qa-functional.run.cp">
346
            <pathelement path="${test.qa-functional.runtime.cp}"/>
315
            <pathelement location="${build.test.unit.classes.dir}"/>
347
            <pathelement location="${build.test.unit.classes.dir}"/>
316
            <pathelement path="${test.unit.run.cp.extra}"/>
348
            <path refid="test.unit.lib.cp"/>
349
            <pathelement path="${test.qa-functional.run.cp.extra}"/>
317
        </path>
350
        </path>
318
        <propertyset id="test.unit.properties">
351
        <propertyset id="test.unit.properties">
319
            <propertyref prefix="test-unit-sys-prop."/>
352
            <propertyref prefix="test-unit-sys-prop."/>
Lines 321-330 Link Here
321
        </propertyset>
354
        </propertyset>
322
    </target>
355
    </target>
323
356
324
    <target name="test-build" depends="jar,do-test-build"/>
357
    <target name="test-build" depends="jar,do-test-build,test-build-datajar"/>
325
358
326
    <target name="do-test-build" depends="init,test-init">
359
    <target name="do-test-build" depends="init,test-init">
327
        <mkdir dir="${build.test.unit.classes.dir}"/>
360
        <mkdir dir="${build.test.unit.classes.dir}"/>
361
        <mkdir dir="${test.dist.dir}"/>
328
        <depend srcdir="${test.unit.src.dir}" destdir="${build.test.unit.classes.dir}" cache="${build.test.unit.dir}/depcache">
362
        <depend srcdir="${test.unit.src.dir}" destdir="${build.test.unit.classes.dir}" cache="${build.test.unit.dir}/depcache">
329
            <classpath refid="test.unit.cp"/>
363
            <classpath refid="test.unit.cp"/>
330
        </depend>
364
        </depend>
Lines 346-353 Link Here
346
                <include name="data/**"/>
380
                <include name="data/**"/>
347
            </fileset>
381
            </fileset>
348
        </copy>
382
        </copy>
383
        
384
        <available file="${test.unit.dir}/data" type="dir" property="exists.test.data"/>
385
        <!-- test distribution -->
386
               <mkdir dir="${test.dist.dir}/extralibs"/>
387
               <property name="extra.test.libs.dir" location="${test.dist.dir}/extralibs"/> 
388
           <property name="test.unit.out.folder" location="${test.unit.folder}"/>
389
           <mkdir dir="${test.unit.out.folder}"/>
390
           <jar destfile="${test.unit.out.folder}/tests.jar" basedir="${build.test.unit.classes.dir}"/>            
391
           <!-- create properties -->
392
            <shorterpaths inref="test.unit.run.cp" 
393
                           out="test.unit.run.cp.short" 
394
                           extralibs="extra.test.libs.short" 
395
                           extralibsdir="${extra.test.libs.dir}"
396
                           testproperties="${test.unit.out.folder}/test.properties">
397
398
                <replacement dir="${netbeans.dest.dir}" name="netbeans.dest.dir"/>
399
                <replacement dir="${test.dist.dir}" name="test.dist.dir"/>
400
                <replacement dir="${java.home}" name="java.home"/>
401
                <replacement dir="${java.home.parent}" name="java.home.parent"/>
402
            </shorterpaths>
403
  <!--          <copy file="${nb_all}/nbbuild/templates/testdist/unit-unit.xml" tofile="${test.unit.out.folder}/unit-unit.xml"/>-->
404
             <copy todir="${test.unit.out.folder}">
405
                <fileset dir="${test.unit.dir}/..">
406
                  <include name="build-unit.xml"/>
407
                  <include name="build.xml"/>
408
                  <include name="cfg-unit.xml"/>
409
                </fileset>
410
            </copy>
349
    </target>
411
    </target>
412
    
413
    <target name="test-build-datajar" depends="do-test-build" if="exists.test.data">
414
           <zip destfile="${test.unit.out.folder}/data.zip" basedir="${test.unit.dir}/data"/> 
415
    </target>
416
350
417
418
    <target name="test-build-qa-functional" depends="jar,do-test-build-qa-functional,test-build-datajar-qa-functional"/>
419
        
420
421
    <target name="do-test-build-qa-functional" depends="init,test-init">
422
        <mkdir dir="${build.test.qa-functional.classes.dir}"/>
423
        <javac srcdir="${test.qa-functional.src.dir}" destdir="${build.test.qa-functional.classes.dir}"
424
               debug="true" deprecation="${build.compiler.deprecation}"
425
               source="${javac.source}" target="${javac.target}" optimize="${build.compiler.optimize}" includeantruntime="false">
426
               <exclude name="**/jars/**"/><!-- XXX for core only; fix in core, not here -->
427
               <exclude name="**/data/**"/><!-- XXX for openide/util and co. -->
428
            <classpath refid="test.qa-functional.cp"/>
429
            <compilerarg line="${javac.compilerargs}"/>
430
        </javac>
431
        <copy todir="${build.test.qa-functional.classes.dir}">
432
            <fileset dir="${test.qa-functional.src.dir}">
433
                <exclude name="**/*.java"/>
434
            </fileset>
435
        </copy>
436
        <copy todir="${build.test.qa-functional.dir}">
437
            <fileset dir="${test.qa-functional.dir}">
438
                <include name="data/**"/>
439
            </fileset>
440
        </copy>
441
        
442
        <available file="${test.qa-functional.dir}/data" type="dir" property="exists.test.qa-functional.data"/>
443
        <!-- test distribution -->
444
               <mkdir dir="${nb_all}/nbbuild/build/testdist"/>
445
               <property name="test.dist.dir" location="${nb_all}/nbbuild/build/testdist"/>
446
               <mkdir dir="${test.dist.dir}/extralibs"/>
447
               <property name="extra.test.libs.dir" location="${test.dist.dir}/extralibs"/> 
448
           <property name="test.qa-functional.out.folder" location="${test.qa-functional.folder}"/>
449
           <mkdir dir="${test.qa-functional.out.folder}"/>
450
           <jar destfile="${test.qa-functional.out.folder}/tests.jar" basedir="${build.test.qa-functional.classes.dir}"/>            
451
           <!-- create properties -->
452
           <taskdef name="shorterpaths" classname="org.netbeans.nbbuild.ShorterPaths" classpath="${nb_all}/nbbuild/nbantext.jar"/>
453
            <shorterpaths inref="test.qa-functional.run.cp" 
454
                           out="test.qa-functional.run.cp.short" 
455
                           extralibs="extra.test.libs.short" 
456
                           extralibsdir="${extra.test.libs.dir}"
457
                           testproperties="${test.qa-functional.out.folder}/test.properties">
458
459
                <replacement dir="${netbeans.dest.dir}" name="netbeans.dest.dir"/>
460
                <replacement dir="${test.dist.dir}" name="test.dist.dir"/>
461
                <replacement dir="${java.home}" name="java.home"/>
462
                <replacement dir="${java.home.parent}" name="java.home.parent"/>
463
            </shorterpaths>
464
             <copy todir="${test.qa-functional.out.folder}">
465
                <fileset dir="${test.qa-functional.dir}/..">
466
                  <include name="build-qa-functional.xml"/>
467
                  <include name="build.xml"/>
468
                  <include name="cfg-qa-functional.xml"/>
469
                </fileset>
470
            </copy>
471
    </target>
472
    
473
    <target name="test-build-datajar-qa-functional" depends="do-test-build-qa-functional" if="exists.test.qa-functional.data">
474
           <zip destfile="${test.qa-functional.out.folder}/data.zip" basedir="${test.qa-functional.dir}/data"/> 
475
    </target>
476
    
477
    
351
    <target name="compile-test-single" depends="init,test-init,jar">
478
    <target name="compile-test-single" depends="init,test-init,jar">
352
        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
479
        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
353
        <mkdir dir="${build.test.unit.classes.dir}"/>
480
        <mkdir dir="${build.test.unit.classes.dir}"/>
Lines 378-390 Link Here
378
        <mkdir dir="${build.test.unit.results.dir}"/>
505
        <mkdir dir="${build.test.unit.results.dir}"/>
379
        <junit showoutput="true" fork="true" failureproperty="tests.failed" errorproperty="tests.failed" filtertrace="${test.filter.trace}" tempdir="${build.test.unit.results.dir}">
506
        <junit showoutput="true" fork="true" failureproperty="tests.failed" errorproperty="tests.failed" filtertrace="${test.filter.trace}" tempdir="${build.test.unit.results.dir}">
380
            <batchtest todir="${build.test.unit.results.dir}">
507
            <batchtest todir="${build.test.unit.results.dir}">
381
                <fileset dir="${test.unit.src.dir}">
508
                <fileset dir="${build.test.unit.classes.dir}">
382
                    <include name="**/*Test.java"/>
509
                    <include name="**/*Test.class"/>
383
                </fileset>
510
                </fileset>
384
            </batchtest>
511
            </batchtest>
385
            <classpath refid="test.unit.run.cp"/>
512
            <classpath refid="test.unit.run.cp"/>
386
            <syspropertyset refid="test.unit.properties"/>
513
            <syspropertyset refid="test.unit.properties"/>
387
            <!-- <assertions> does not seem to work in Ant 1.6.1? -->
388
            <jvmarg value="-ea"/>
514
            <jvmarg value="-ea"/>
389
            <formatter type="brief" usefile="false"/>
515
            <formatter type="brief" usefile="false"/>
390
            <formatter type="xml"/>
516
            <formatter type="xml"/>
Lines 580-584 Link Here
580
          </fileset>
706
          </fileset>
581
        </fixdependencies>
707
        </fixdependencies>
582
    </target>
708
    </target>
583
709
    
710
    <target name="fix-test-dependencies" depends="basic-init" description="It moves classpath for tests from project.properties to project.xml.">
711
            <fixtestdeps projectXml="nbproject/project.xml" 
712
                  propertiesFile="nbproject/project.properties"/>  
713
    </target>
584
</project>
714
</project>
(-)templates/projectized.xml (-10 / +20 lines)
Lines 28-44 Link Here
28
    <target name="build-init" depends="basic-init">
28
    <target name="build-init" depends="basic-init">
29
        <property name="public.package.jar.dir" location="${nb_all}/nbbuild/build/public-package-jars"/>
29
        <property name="public.package.jar.dir" location="${nb_all}/nbbuild/build/public-package-jars"/>
30
        <mkdir dir="${public.package.jar.dir}"/>
30
        <mkdir dir="${public.package.jar.dir}"/>
31
        <property name="test.dist.dir" location="${nb_all}/nbbuild/build/testdist"/>
31
        <parseprojectxml
32
        <parseprojectxml
32
            project="."
33
                project="."
33
            publicpackagesproperty="public.packages"
34
                publicpackagesproperty="public.packages"
34
            friendsproperty="friends"
35
                friendsproperty="friends"
35
            javadocpackagesproperty="module.javadoc.packages"
36
                javadocpackagesproperty="module.javadoc.packages"
36
            moduledependenciesproperty="module.dependencies"
37
                moduledependenciesproperty="module.dependencies"
37
            moduleclasspathproperty="module.classpath"
38
                moduleclasspathproperty="module.classpath"
38
            publicpackagejardir="${public.package.jar.dir}"
39
                publicpackagejardir="${public.package.jar.dir}"
39
            modulerunclasspathproperty="module.run.classpath"
40
                modulerunclasspathproperty="module.run.classpath"
40
            domainproperty="nbm.domain"
41
                domainproperty="nbm.domain"
41
            classpathextensionsproperty="class.path.extensions"/>
42
                classpathextensionsproperty="class.path.extensions">
43
            <testtype name="unit" 
44
                      folder="test.unit.folder" 
45
                      runtimecp="test.unit.runtime.cp" 
46
                      compilecp="test.unit.compile.cp"/>
47
            <testtype name="qa-functional" 
48
                      folder="test.qa-functional.folder" 
49
                      runtimecp="test.qa-functional.runtime.cp" 
50
                      compilecp="test.qa-functional.compile.cp"/>         
51
        </parseprojectxml>
42
        <condition property="is.regular">
52
        <condition property="is.regular">
43
            <not>
53
            <not>
44
                <or>
54
                <or>
(-)default.xml (+6 lines)
Lines 76-81 Link Here
76
    <taskdef name="checklicense"
76
    <taskdef name="checklicense"
77
         classname="org.netbeans.nbbuild.CheckLicense"
77
         classname="org.netbeans.nbbuild.CheckLicense"
78
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
78
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
79
    <taskdef name="fixtestdeps"
80
         classname="org.netbeans.nbbuild.FixTestDependencies"
81
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
82
    <taskdef name="shorterpaths"
83
         classname="org.netbeans.nbbuild.ShorterPaths"
84
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
79
    <property name="tasks-already-set" value="true"/>
85
    <property name="tasks-already-set" value="true"/>
80
  </target>
86
  </target>
81
  
87
  

Return to bug 54161