< prev index next >

test/langtools/lib/combo/tools/javac/combo/JavacTemplateTestBase.java

Print this page
*** 152,10 ***
--- 152,18 ---
          if (!diags.containsWarningKey(warning)) {
              fail(String.format("Expected compilation warning with %s, found %s", warning, diags.keys()));
          }
      }
  
+     protected void assertCompileSucceededWithWarning(String warning, int numberOfWarnings) {
+         if (diags.errorsFound())
+             fail("Expected successful compilation");
+         if (!diags.containsWarningKey(warning, numberOfWarnings)) {
+             fail(String.format("Expected compilation warning with %s, found %s", warning, diags.keys()));
+         }
+     }
+ 
      /**
       * If the provided boolean is true, assert all previous compiles succeeded,
       * otherwise assert that a compile failed.
       * */
      protected void assertCompileSucceededIff(boolean b) {
< prev index next >