Refine search
public void testFindClassesToTest_testClass() { assertThat(findClassesToTest(ImmutableList.of(EmptyTest.class))).isEmpty(); assertThat(findClassesToTest(ImmutableList.of(EmptyTests.class))).isEmpty(); assertThat(findClassesToTest(ImmutableList.of(EmptyTestCase.class))).isEmpty(); assertThat(findClassesToTest(ImmutableList.of(EmptyTestSuite.class))).isEmpty(); }
public void testSkip_structurallyModifiedSkipAllList() throws Exception { List<String> list = Lists.newArrayList("a", "b", "c"); FluentIterable<String> tail = FluentIterable.from(list).skip(2); list.subList(0, 2).clear(); assertThat(tail).isEmpty(); }
@GwtIncompatible // java.util.regex.Pattern public void testPatternSplitOnOnlyDelimitersOmitEmptyStrings() { Iterable<String> empty = Splitter.on(literalDotPattern()).omitEmptyStrings().split("..."); assertThat(empty).isEmpty(); }
public void testGetClassPathFromManifest_badClassPath() throws IOException { File jarFile = new File("base.jar"); Manifest manifest = manifestClasspath("nosuchscheme:an_invalid^path"); assertThat(ClassPath.Scanner.getClassPathFromManifest(jarFile, manifest)).isEmpty(); }
public void testGetClassPathFromManifest_emptyClassPath() throws IOException { File jarFile = new File("base.jar"); assertThat(ClassPath.Scanner.getClassPathFromManifest(jarFile, manifestClasspath(""))) .isEmpty(); }
public void testScanFromFile_notJarFile() throws IOException { ClassLoader classLoader = ClassPathTest.class.getClassLoader(); File notJar = File.createTempFile("not_a_jar", "txt"); ClassPath.DefaultScanner scanner = new ClassPath.DefaultScanner(); try { scanner.scan(notJar, classLoader); } finally { notJar.delete(); } assertThat(scanner.getResources()).isEmpty(); }
private void testNegativeMaxElements(BlockingQueue<Object> q) throws InterruptedException { @SuppressWarnings("unused") // go/futurereturn-lsc Future<?> possiblyIgnoredError = threadPool.submit(new Producer(q, 1)); List<Object> buf = newArrayList(); int elements = Queues.drain(q, buf, -1, MAX_VALUE, NANOSECONDS); assertEquals(0, elements); assertThat(buf).isEmpty(); // Free the producer thread, and give subsequent tests a clean slate. q.take(); }
public void testScanFromFile_fileNotExists() throws IOException { ClassLoader classLoader = ClassPathTest.class.getClassLoader(); ClassPath.DefaultScanner scanner = new ClassPath.DefaultScanner(); scanner.scan(new File("no/such/file/anywhere"), classLoader); assertThat(scanner.getResources()).isEmpty(); }
public <T extends NoInterface, T1 extends T, T2 extends T1> void testGetGenericInterfaces_typeVariable_boundIsTypeVariableAndClass() { assertThat(TypeToken.of(new TypeCapture<T2>() {}.capture()).getGenericInterfaces()).isEmpty(); assertHasArrayInterfaces(new TypeToken<T2[]>() {}); }
public void testDifferentlyOverriddenNotAnnotatedInSubclass() { assertThat(getSubscriber().differentlyOverriddenNotAnnotatedInSubclassGoodEvents) .contains(EVENT); assertThat(getSubscriber().differentlyOverriddenNotAnnotatedInSubclassBadEvents).isEmpty(); }
public void testDifferentlyOverriddenAndAnnotatedInSubclass() { assertThat(getSubscriber().differentlyOverriddenAnnotatedInSubclassGoodEvents) .contains(EVENT); assertThat(getSubscriber().differentlyOverriddenAnnotatedInSubclassBadEvents).isEmpty(); }
public void removeEdge_antiparallelEdges() { putEdge(N1, N2); putEdge(N2, N1); assertThat(graph.removeEdge(N1, N2)).isTrue(); assertThat(graph.successors(N1)).isEmpty(); assertThat(graph.predecessors(N1)).containsExactly(N2); assertThat(graph.edges()).hasSize(1); assertThat(graph.removeEdge(N2, N1)).isTrue(); assertThat(graph.successors(N1)).isEmpty(); assertThat(graph.predecessors(N1)).isEmpty(); assertThat(graph.edges()).isEmpty(); }
@Test public void predecessors_noPredecessors() { addNode(N1); assertThat(network.predecessors(N1)).isEmpty(); }
public void testZeroK() { TopKSelector<Integer> top = TopKSelector.least(0); for (int i = 0; i < 10; i++) { top.offer(i); } assertThat(top.topK()).isEmpty(); }
@Test public void adjacentNodes_noAdjacentNodes() { addNode(N1); assertThat(graph.adjacentNodes(N1)).isEmpty(); }
@Test public void successors_noSuccessors() { addNode(N1); assertThat(graph.successors(N1)).isEmpty(); }
@Test public void outEdges_noOutEdges() { addNode(N1); assertThat(network.outEdges(N1)).isEmpty(); }
@Test public void successors_noSuccessors() { addNode(N1); assertThat(network.successors(N1)).isEmpty(); }
@Test public void predecessors_noPredecessors() { addNode(N1); assertThat(graph.predecessors(N1)).isEmpty(); }
public void testAllAsList_emptyList() throws Exception { SingleCallListener listener = new SingleCallListener(); listener.expectCall(); List<ListenableFuture<String>> futures = ImmutableList.of(); ListenableFuture<List<String>> compound = allAsList(futures); compound.addListener(listener, directExecutor()); assertThat(getDone(compound)).isEmpty(); assertTrue(listener.wasCalled()); }