605
606 boolean matches(String stringToMatch) {
607 for (String x : testOutput) {
608 if (x.matches(stringToMatch)) {
609 return true;
610 }
611 }
612 appendError("string <" + stringToMatch + "> not found");
613 return false;
614 }
615
616 boolean notMatches(String stringToMatch) {
617 for (String x : testOutput) {
618 if (!x.matches(stringToMatch)) {
619 return true;
620 }
621 }
622 appendError("string <" + stringToMatch + "> found");
623 return false;
624 }
625 }
626 /**
627 * Indicates that the annotated method is a test method.
628 */
629 @Retention(RetentionPolicy.RUNTIME)
630 @Target(ElementType.METHOD)
631 public @interface Test {}
632 }
|
605
606 boolean matches(String stringToMatch) {
607 for (String x : testOutput) {
608 if (x.matches(stringToMatch)) {
609 return true;
610 }
611 }
612 appendError("string <" + stringToMatch + "> not found");
613 return false;
614 }
615
616 boolean notMatches(String stringToMatch) {
617 for (String x : testOutput) {
618 if (!x.matches(stringToMatch)) {
619 return true;
620 }
621 }
622 appendError("string <" + stringToMatch + "> found");
623 return false;
624 }
625
626 String findInOutput(String pattern) {
627 for (String x : testOutput) {
628 if (x.matches(pattern)) {
629 return x;
630 }
631 }
632 appendError("string <" + pattern + "> not found");
633 return null;
634 }
635 }
636 /**
637 * Indicates that the annotated method is a test method.
638 */
639 @Retention(RetentionPolicy.RUNTIME)
640 @Target(ElementType.METHOD)
641 public @interface Test {}
642 }
|