498 protected Map<String, String> normalize(Map<String, String> entries) {
499 return entries;
500 }
501
502
503 //--------------------------------------------------------------------------
504
505 /**
506 * Report that data for a test description has been found.
507 * @param entries The data for the test description
508 * @param file The file being read
509 * @param line The line number within the file (used for error messages)
510 */
511 protected void foundTestDescription(Map<String, String> entries, File file, int line) {
512 entries = normalize(entries);
513
514 if (debug) {
515 System.err.println("Found TestDescription");
516
517 System.err.println("--------values----------------------------");
518 for (Iterator i = entries.keySet().iterator() ; i.hasNext() ;) {
519 Object key = i.next();
520 System.err.println(">> " + key + ": " + entries.get(key) );
521 }
522 System.err.println("------------------------------------------");
523 }
524
525 String id = entries.get("id");
526 if (id == null)
527 id = "";
528
529 // make sure test has unique id within file
530 Integer prevLine = testsInFile.get(id);
531 if (prevLine != null) {
532 int i = 1;
533 String newId;
534 while (testsInFile.get(newId = (id + "__" + i)) != null)
535 i++;
536
537 error(i18n, "finder.nonUniqueId",
538 new Object[] { file,
|
498 protected Map<String, String> normalize(Map<String, String> entries) {
499 return entries;
500 }
501
502
503 //--------------------------------------------------------------------------
504
505 /**
506 * Report that data for a test description has been found.
507 * @param entries The data for the test description
508 * @param file The file being read
509 * @param line The line number within the file (used for error messages)
510 */
511 protected void foundTestDescription(Map<String, String> entries, File file, int line) {
512 entries = normalize(entries);
513
514 if (debug) {
515 System.err.println("Found TestDescription");
516
517 System.err.println("--------values----------------------------");
518 for (Iterator<String> i = entries.keySet().iterator() ; i.hasNext() ;) {
519 Object key = i.next();
520 System.err.println(">> " + key + ": " + entries.get(key) );
521 }
522 System.err.println("------------------------------------------");
523 }
524
525 String id = entries.get("id");
526 if (id == null)
527 id = "";
528
529 // make sure test has unique id within file
530 Integer prevLine = testsInFile.get(id);
531 if (prevLine != null) {
532 int i = 1;
533 String newId;
534 while (testsInFile.get(newId = (id + "__" + i)) != null)
535 i++;
536
537 error(i18n, "finder.nonUniqueId",
538 new Object[] { file,
|