/*
 * Copyright 2012 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;

/**
 * Test cases for {@link LongLiteralLowerCaseSuffix}.
 * 
 * @author Simon Nickerson (sjnickerson@google.com)
 */
public class LongLiteralLowerCaseSuffixTest {

  private CompilationTestHelper compilationHelper;

  @Before
  public void setUp() {
    compilationHelper = new CompilationTestHelper(new LongLiteralLowerCaseSuffix.Scanner());
  }

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

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

@@ -838,17 +838,16 @@
 fix%7D.%0A *
- 
 %0A * @aut
@@ -1329,33 +1329,481 @@
 ffixPositiveCase
-s
+1.java%22).toURI()));%0A  %7D%0A%0A  /**%0A   * Test for Java 7 integer literals that include underscores.%0A   */%0A  @Test%0A  public void testJava7PositiveCase() throws Exception %7B%0A    String%5B%5D javaVersion = System.getProperty(%22java.version%22).split(%22%5C%5C.%22);%0A    if (Integer.parseInt(javaVersion%5B1%5D) %3E= 7) %7B%0A      compilationHelper.assertCompileFailsWithMessages(%0A          new File(%0A              this.getClass().getResource(%22LongLiteralLowerCaseSuffixPositiveCase2
 .java%22).toURI())
@@ -1801,24 +1801,30 @@
 .toURI()));%0A
+    %7D%0A
   %7D%0A%0A  @Test

Fix to LongLiteralLowerCaseSuffixTest to work on both JDK6 and 7.