Search in sources :

Example 1 with SourceArtifact

use of com.google.idea.blaze.base.command.buildresult.SourceArtifact in project intellij by bazelbuild.

the class EmptyLibraryFilterTest method isEmpty_largeAndNonEmpty.

@Test
public void isEmpty_largeAndNonEmpty() throws IOException {
    File jar = JarBuilder.newEmptyJar(tempDirectory).addManifest().addDirectory("dir1").addDirectory("dir2").addFile("com/google/example/A.java", "package com.google.example; public class A {}").addFile("com/google/example/B.java", "package com.google.example; public class B {}").addFile("com/google/example/C.java", "package com.google.example; public class C {}").build();
    assertThat(EmptyLibraryFilter.isEmpty(new SourceArtifact(jar))).isFalse();
}
Also used : File(java.io.File) SourceArtifact(com.google.idea.blaze.base.command.buildresult.SourceArtifact) Test(org.junit.Test)

Example 2 with SourceArtifact

use of com.google.idea.blaze.base.command.buildresult.SourceArtifact in project intellij by bazelbuild.

the class EmptyLibraryFilterTest method isEmpty_nonexistent.

@Test
public void isEmpty_nonexistent() throws IOException {
    File jar = new File("nonexistent.jar");
    assertThat(EmptyLibraryFilter.isEmpty(new SourceArtifact(jar))).isTrue();
}
Also used : File(java.io.File) SourceArtifact(com.google.idea.blaze.base.command.buildresult.SourceArtifact) Test(org.junit.Test)

Example 3 with SourceArtifact

use of com.google.idea.blaze.base.command.buildresult.SourceArtifact in project intellij by bazelbuild.

the class EmptyLibraryFilterTest method isEmpty_largeButManifestOnly.

@Test
public void isEmpty_largeButManifestOnly() throws IOException {
    File jar = JarBuilder.newEmptyJar(tempDirectory).addManifest().bloatBy(200).build();
    assertThat(EmptyLibraryFilter.isEmpty(new SourceArtifact(jar))).isTrue();
}
Also used : File(java.io.File) SourceArtifact(com.google.idea.blaze.base.command.buildresult.SourceArtifact) Test(org.junit.Test)

Example 4 with SourceArtifact

use of com.google.idea.blaze.base.command.buildresult.SourceArtifact in project intellij by bazelbuild.

the class EmptyLibraryFilterTest method isEmpty_trulyEmpty.

@Test
public void isEmpty_trulyEmpty() throws IOException {
    File jar = JarBuilder.newEmptyJar(tempDirectory).build();
    assertThat(EmptyLibraryFilter.isEmpty(new SourceArtifact(jar))).isTrue();
}
Also used : File(java.io.File) SourceArtifact(com.google.idea.blaze.base.command.buildresult.SourceArtifact) Test(org.junit.Test)

Example 5 with SourceArtifact

use of com.google.idea.blaze.base.command.buildresult.SourceArtifact in project intellij by bazelbuild.

the class EmptyLibraryFilterTest method isEmpty_smallButNonEmpty.

@Test
public void isEmpty_smallButNonEmpty() throws IOException {
    File jar = JarBuilder.newEmptyJar(tempDirectory).addManifest().addFile("com/google/example/A.java", "package com.google.example; class A {}").build();
    assertThat(EmptyLibraryFilter.isEmpty(new SourceArtifact(jar))).isFalse();
}
Also used : File(java.io.File) SourceArtifact(com.google.idea.blaze.base.command.buildresult.SourceArtifact) Test(org.junit.Test)

Aggregations

SourceArtifact (com.google.idea.blaze.base.command.buildresult.SourceArtifact)6 File (java.io.File)6 Test (org.junit.Test)6