@@ -0,0 +1,2188 @@
+/*%0A * Copyright 2012 Google Inc. All Rights Reserved.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.google.errorprone.suppresswarnings;%0A%0Aimport com.google.errorprone.BugPattern;%0Aimport com.google.errorprone.ErrorProneCompiler;%0Aimport com.google.errorprone.ErrorProneScanner;%0Aimport com.google.errorprone.ErrorProneScanner.EnabledPredicate;%0Aimport com.google.errorprone.bugpatterns.dead_exception.DeadException;%0Aimport com.google.errorprone.bugpatterns.empty_if_statement.EmptyIfStatement;%0Aimport com.google.errorprone.bugpatterns.selfassignment.SelfAssignment;%0Aimport com.google.errorprone.matchers.DescribingMatcher;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport java.io.File;%0A%0Aimport static java.util.Arrays.asList;%0Aimport static org.hamcrest.core.Is.is;%0Aimport static org.junit.Assert.assertThat;%0A%0A/**%0A * @author alexeagle@google.com (Alex Eagle)%0A */%0Apublic class SuppressWarningsTest %7B%0A  private ErrorProneCompiler compiler;%0A%0A  @Before%0A  public void setUp() %7B%0A    compiler = new ErrorProneCompiler.Builder()%0A        .report(new ErrorProneScanner(new EnabledPredicate() %7B%0A          @SuppressWarnings(%22unchecked%22)%0A          @Override%0A          public boolean isEnabled(Class%3C? extends DescribingMatcher%3C?%3E%3E check, BugPattern annotation) %7B%0A            return asList(DeadException.class, EmptyIfStatement.class, SelfAssignment.class)%0A                .contains(check);%0A          %7D%0A        %7D))%0A        .build();%0A  %7D%0A%0A  @Test%0A  public void testNegativeCase() throws Exception %7B%0A    File source = new File(this.getClass().getResource(%22NegativeCases.java%22).toURI());%0A    assertThat(compiler.compile(new String%5B%5D%7Bsource.getAbsolutePath()%7D), is(0));%0A  %7D%0A%7D%0A

Add an integration test for @SuppressWarnings feature