use of javax.tools.JavaFileObject in project buck by facebook.
the class ClassUsageTrackerTest method fileTypeIsTracked.
private boolean fileTypeIsTracked(JavaFileObject.Kind kind) throws IOException {
final JavaFileObject javaFileObject = fileManager.getJavaFileForInput(null, kind.toString(), kind);
javaFileObject.openInputStream();
return fileWasRead(TEST_JAR_PATH, SINGLE_FILE_NAME);
}
use of javax.tools.JavaFileObject in project buck by facebook.
the class ClassUsageTrackerTest method readingFileByOpeningStreamShouldBeTracked.
@Test
public void readingFileByOpeningStreamShouldBeTracked() throws IOException {
final JavaFileObject javaFileObject = fileManager.getJavaFileForInput(null, SINGLE_FILE_NAME, JavaFileObject.Kind.CLASS);
javaFileObject.openInputStream();
assertFilesRead(TEST_JAR_PATH, SINGLE_FILE_NAME);
}
use of javax.tools.JavaFileObject in project buck by facebook.
the class ClassUsageTrackerTest method readingFileFromGetJavaFileObjectsFileOverloadShouldNotBeTracked.
@Test
public void readingFileFromGetJavaFileObjectsFileOverloadShouldNotBeTracked() throws IOException {
final Iterable<? extends JavaFileObject> javaFileObjects = fileManager.getJavaFileObjects(SINGLE_FILE);
for (JavaFileObject javaFileObject : javaFileObjects) {
javaFileObject.openInputStream();
}
assertNoFilesRead();
}
use of javax.tools.JavaFileObject in project buck by facebook.
the class ClassUsageTrackerTest method readingFileWithGetCharContentShouldBeTracked.
@Test
public void readingFileWithGetCharContentShouldBeTracked() throws IOException {
final JavaFileObject javaFileObject = fileManager.getJavaFileForInput(null, SINGLE_FILE_NAME, JavaFileObject.Kind.CLASS);
javaFileObject.getCharContent(false);
assertFilesRead(TEST_JAR_PATH, SINGLE_FILE_NAME);
}
use of javax.tools.JavaFileObject in project buck by facebook.
the class ClassUsageTrackerTest method readingFileFromGetJavaFileObjectsFromFilesShouldNotBeTracked.
@Test
public void readingFileFromGetJavaFileObjectsFromFilesShouldNotBeTracked() throws IOException {
final Iterable<? extends JavaFileObject> javaFileObjects = fileManager.getJavaFileObjectsFromFiles(Lists.newArrayList(SINGLE_FILE));
for (JavaFileObject javaFileObject : javaFileObjects) {
javaFileObject.openInputStream();
}
assertNoFilesRead();
}
Aggregations