/*
 * Copyright 2014 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.errorprone.bugpatterns;

import com.google.errorprone.CompilationTestHelper;

import org.junit.Before;
import org.junit.Test;

import java.io.File;

/**
 * @author vidarh@google.com (Will Holen)
 */
public class MisusedFormattingLoggerTest {

  private CompilationTestHelper compilationHelper;

  @Before
  public void setUp() {
    compilationHelper = new CompilationTestHelper(MisusedFormattingLogger.class);
  }

  @Test
  public void testPositiveCases() throws Exception {
    compilationHelper.assertCompileFailsWithMessages(
        new File(this.getClass().getResource("MisusedFormattingLoggerPositiveCases.java").toURI()));
  }

  @Test
  public void testNegativeCases() throws Exception {
    compilationHelper.assertCompileSucceeds(
        new File(this.getClass().getResource("MisusedFormattingLoggerNegativeCases.java").toURI()));
  }
}

@@ -654,16 +654,84 @@
 terns;%0A%0A
+import static com.google.errorprone.CompilationTestHelper.sources;%0A%0A
 import c
@@ -774,16 +774,16 @@
 Helper;%0A
-
 %0Aimport 
@@ -828,30 +828,8 @@
 t;%0A%0A
-import java.io.File;%0A%0A
 /**%0A
@@ -1218,45 +1218,28 @@
     
-new File(this.getClass().getResource(
+sources(getClass(), 
 %22Mis
@@ -1274,33 +1274,24 @@
 Cases.java%22)
-.toURI())
 );%0A  %7D%0A%0A  @T
@@ -1404,45 +1404,28 @@
     
-new File(this.getClass().getResource(
+sources(getClass(), 
 %22Mis
@@ -1468,17 +1468,8 @@
 va%22)
-.toURI())
 );%0A 

Fix merge conflict