1 package com.android.apifinder; 2 3 import com.android.apifinder.JavaApiUsedByMainlineModule; 4 import com.google.errorprone.CompilationTestHelper; 5 import org.junit.Before; 6 import org.junit.Test; 7 import org.junit.runner.RunWith; 8 import org.junit.runners.JUnit4; 9 10 /** Unit tests for {@link JavaApiUsedByMainlineModule}. */ 11 @RunWith(JUnit4.class) 12 public final class JavaApiUsedByMainlineModuleTest { 13 14 private CompilationTestHelper compilationHelper; 15 16 @Before setUp()17 public void setUp() { 18 compilationHelper = CompilationTestHelper.newInstance( 19 JavaApiUsedByMainlineModule.class, getClass()); 20 } 21 22 /* 23 * The error prone testing library will run the plugin on the resource file. 24 * The error prone testing library will compare the comment of each method in the 25 * resource file to determine if the return value is expected. 26 */ 27 @Test positiveFindPublicMethod()28 public void positiveFindPublicMethod() { 29 compilationHelper 30 .addSourceFile("JavaApiUsedByMainlineModuleCases.java").doTest(); 31 } 32 } 33