Index: org\apache\harmony\harness\Selector.java =================================================================== --- org\apache\harmony\harness\Selector.java (revision 547104) +++ org\apache\harmony\harness\Selector.java (working copy) @@ -84,6 +84,11 @@ /* the constant to multiply the day field for time selection */ public static final int DAY_MULTIPLIER = 1; + protected boolean excludePredefinedNames = true; + protected String[] predefinedNames = { "/~", "/#", "/.#", + "/%", "/._", "/CVS/", "/.cvsignore/", "/SCCS/", "/vssver.scc/", + "/.svn/", "/.DS_Store/" }; + /* the list of tests that should be executed in the current run */ protected Main curCore = Main.getCurCore(); @@ -188,12 +193,51 @@ * default constructor: parse the config and create the arrays for selection */ public Selector() { + setDefaultExclude(); createSortArr(); createDateNumber(); createExcStat(); } /* + * setup default exclude option: true/ false and list of substring Section + * in the configuration file for 'selector' plugin can looks like true /.svn /CVS + * + */ + void setDefaultExclude() { + HashMap params; + HashMap tmpH; + ArrayList tmpA; + + tmpA = (ArrayList)cfg.getPlugins().get("Selector"); + if (tmpA == null) { + return; + } + tmpH = (HashMap)(tmpA).get(1); + if (tmpH == null) { + return; + } + params = (HashMap)tmpH.get("excludeDefault"); + if (params != null) { + tmpA = (ArrayList)params.get("use"); + if (tmpA != null && tmpA.size() > 0) { + if ("false".equalsIgnoreCase(tmpA.get(0).toString())) { + excludePredefinedNames = false; + } + } + tmpA = (ArrayList)params.get("substring"); + if (tmpA != null && tmpA.size() > 0) { + predefinedNames = new String[tmpA.size()]; + for (int i = 0; i < tmpA.size(); i++) { + predefinedNames[i] = tmpA.get(i).toString(); + } + } + } + } + + /* * create general sort array: to include and exclude tests String[0] = * SelKeywords(); String[1] = SelAuthor(); String[2] = SelModifAuthors(); * String[3] = SelResources(); String[4] = SelRunners(); @@ -1057,6 +1101,15 @@ boolean testAccepted = true; + //if test name has 'predefined exclude' part - exclude it + if (excludePredefinedNames) { + for (int i = 0; i < predefinedNames.length; i++) { + if (test.getTestID().contains(predefinedNames[i])) { + return false; + } + } + } + //if exclude list is defined and this test is excluded in this list: // skip it for run if (excludeTestNames != null) {