The following issues were found
android/guava-tests/test/com/google/common/graph/TraverserTest.java
437 issues
Line: 18
* limitations under the License.
*/
package com.google.common.graph;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.Lists.charactersOf;
import static com.google.common.truth.Truth.assertThat;
Reported by PMD.
Line: 38
import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class TraverserTest {
/**
* The undirected graph in the {@link Traverser#breadthFirst(Object)} javadoc:
*
* <pre>{@code
Reported by PMD.
Line: 38
import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class TraverserTest {
/**
* The undirected graph in the {@link Traverser#breadthFirst(Object)} javadoc:
*
* <pre>{@code
Reported by PMD.
Line: 38
import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class TraverserTest {
/**
* The undirected graph in the {@link Traverser#breadthFirst(Object)} javadoc:
*
* <pre>{@code
Reported by PMD.
Line: 38
import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class TraverserTest {
/**
* The undirected graph in the {@link Traverser#breadthFirst(Object)} javadoc:
*
* <pre>{@code
Reported by PMD.
Line: 172
createDirectedGraph("ab", "fe", "fg", "bc", "bd", "ed", "eh", "gh");
@Test
public void forGraph_breadthFirst_javadocExample_canBeIteratedMultipleTimes() {
Iterable<Character> result = Traverser.forGraph(JAVADOC_GRAPH).breadthFirst('a');
assertEqualCharNodes(result, "abcdef");
assertEqualCharNodes(result, "abcdef");
}
Reported by PMD.
Line: 173
@Test
public void forGraph_breadthFirst_javadocExample_canBeIteratedMultipleTimes() {
Iterable<Character> result = Traverser.forGraph(JAVADOC_GRAPH).breadthFirst('a');
assertEqualCharNodes(result, "abcdef");
assertEqualCharNodes(result, "abcdef");
}
Reported by PMD.
Line: 180
}
@Test
public void forGraph_breadthFirstIterable_javadocExample_canBeIteratedMultipleTimes() {
Iterable<Character> result = Traverser.forGraph(JAVADOC_GRAPH).breadthFirst(charactersOf("bf"));
assertEqualCharNodes(result, "bfaecd");
assertEqualCharNodes(result, "bfaecd");
}
Reported by PMD.
Line: 181
@Test
public void forGraph_breadthFirstIterable_javadocExample_canBeIteratedMultipleTimes() {
Iterable<Character> result = Traverser.forGraph(JAVADOC_GRAPH).breadthFirst(charactersOf("bf"));
assertEqualCharNodes(result, "bfaecd");
assertEqualCharNodes(result, "bfaecd");
}
Reported by PMD.
Line: 190
@Test
public void forGraph_breadthFirst_infinite() {
Iterable<Integer> result =
Traverser.forGraph(fixedSuccessors(Iterables.cycle(1, 2, 3))).breadthFirst(0);
assertThat(Iterables.limit(result, 4)).containsExactly(0, 1, 2, 3).inOrder();
}
@Test
public void forGraph_breadthFirst_diamond() {
Reported by PMD.
guava-tests/test/com/google/common/graph/TraverserTest.java
437 issues
Line: 18
* limitations under the License.
*/
package com.google.common.graph;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.Lists.charactersOf;
import static com.google.common.truth.Truth.assertThat;
Reported by PMD.
Line: 38
import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class TraverserTest {
/**
* The undirected graph in the {@link Traverser#breadthFirst(Object)} javadoc:
*
* <pre>{@code
Reported by PMD.
Line: 38
import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class TraverserTest {
/**
* The undirected graph in the {@link Traverser#breadthFirst(Object)} javadoc:
*
* <pre>{@code
Reported by PMD.
Line: 38
import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class TraverserTest {
/**
* The undirected graph in the {@link Traverser#breadthFirst(Object)} javadoc:
*
* <pre>{@code
Reported by PMD.
Line: 38
import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class TraverserTest {
/**
* The undirected graph in the {@link Traverser#breadthFirst(Object)} javadoc:
*
* <pre>{@code
Reported by PMD.
Line: 172
createDirectedGraph("ab", "fe", "fg", "bc", "bd", "ed", "eh", "gh");
@Test
public void forGraph_breadthFirst_javadocExample_canBeIteratedMultipleTimes() {
Iterable<Character> result = Traverser.forGraph(JAVADOC_GRAPH).breadthFirst('a');
assertEqualCharNodes(result, "abcdef");
assertEqualCharNodes(result, "abcdef");
}
Reported by PMD.
Line: 173
@Test
public void forGraph_breadthFirst_javadocExample_canBeIteratedMultipleTimes() {
Iterable<Character> result = Traverser.forGraph(JAVADOC_GRAPH).breadthFirst('a');
assertEqualCharNodes(result, "abcdef");
assertEqualCharNodes(result, "abcdef");
}
Reported by PMD.
Line: 180
}
@Test
public void forGraph_breadthFirstIterable_javadocExample_canBeIteratedMultipleTimes() {
Iterable<Character> result = Traverser.forGraph(JAVADOC_GRAPH).breadthFirst(charactersOf("bf"));
assertEqualCharNodes(result, "bfaecd");
assertEqualCharNodes(result, "bfaecd");
}
Reported by PMD.
Line: 181
@Test
public void forGraph_breadthFirstIterable_javadocExample_canBeIteratedMultipleTimes() {
Iterable<Character> result = Traverser.forGraph(JAVADOC_GRAPH).breadthFirst(charactersOf("bf"));
assertEqualCharNodes(result, "bfaecd");
assertEqualCharNodes(result, "bfaecd");
}
Reported by PMD.
Line: 190
@Test
public void forGraph_breadthFirst_infinite() {
Iterable<Integer> result =
Traverser.forGraph(fixedSuccessors(Iterables.cycle(1, 2, 3))).breadthFirst(0);
assertThat(Iterables.limit(result, 4)).containsExactly(0, 1, 2, 3).inOrder();
}
@Test
public void forGraph_breadthFirst_diamond() {
Reported by PMD.
guava-tests/test/com/google/common/math/StatsTest.java
425 issues
Line: 17
* limitations under the License.
*/
package com.google.common.math;
import static com.google.common.math.Stats.toStats;
import static com.google.common.math.StatsTesting.ALLOWED_ERROR;
import static com.google.common.math.StatsTesting.ALL_MANY_VALUES;
import static com.google.common.math.StatsTesting.ALL_STATS;
Reported by PMD.
Line: 99
*
* @author Pete Gillin
*/
public class StatsTest extends TestCase {
public void testCount() {
assertThat(EMPTY_STATS_VARARGS.count()).isEqualTo(0);
assertThat(EMPTY_STATS_ITERABLE.count()).isEqualTo(0);
assertThat(ONE_VALUE_STATS.count()).isEqualTo(1);
Reported by PMD.
Line: 99
*
* @author Pete Gillin
*/
public class StatsTest extends TestCase {
public void testCount() {
assertThat(EMPTY_STATS_VARARGS.count()).isEqualTo(0);
assertThat(EMPTY_STATS_ITERABLE.count()).isEqualTo(0);
assertThat(ONE_VALUE_STATS.count()).isEqualTo(1);
Reported by PMD.
Line: 101
*/
public class StatsTest extends TestCase {
public void testCount() {
assertThat(EMPTY_STATS_VARARGS.count()).isEqualTo(0);
assertThat(EMPTY_STATS_ITERABLE.count()).isEqualTo(0);
assertThat(ONE_VALUE_STATS.count()).isEqualTo(1);
assertThat(TWO_VALUES_STATS.count()).isEqualTo(2);
assertThat(MANY_VALUES_STATS_VARARGS.count()).isEqualTo(MANY_VALUES_COUNT);
Reported by PMD.
Line: 101
*/
public class StatsTest extends TestCase {
public void testCount() {
assertThat(EMPTY_STATS_VARARGS.count()).isEqualTo(0);
assertThat(EMPTY_STATS_ITERABLE.count()).isEqualTo(0);
assertThat(ONE_VALUE_STATS.count()).isEqualTo(1);
assertThat(TWO_VALUES_STATS.count()).isEqualTo(2);
assertThat(MANY_VALUES_STATS_VARARGS.count()).isEqualTo(MANY_VALUES_COUNT);
Reported by PMD.
Line: 102
public class StatsTest extends TestCase {
public void testCount() {
assertThat(EMPTY_STATS_VARARGS.count()).isEqualTo(0);
assertThat(EMPTY_STATS_ITERABLE.count()).isEqualTo(0);
assertThat(ONE_VALUE_STATS.count()).isEqualTo(1);
assertThat(TWO_VALUES_STATS.count()).isEqualTo(2);
assertThat(MANY_VALUES_STATS_VARARGS.count()).isEqualTo(MANY_VALUES_COUNT);
assertThat(MANY_VALUES_STATS_ITERABLE.count()).isEqualTo(MANY_VALUES_COUNT);
Reported by PMD.
Line: 103
public void testCount() {
assertThat(EMPTY_STATS_VARARGS.count()).isEqualTo(0);
assertThat(EMPTY_STATS_ITERABLE.count()).isEqualTo(0);
assertThat(ONE_VALUE_STATS.count()).isEqualTo(1);
assertThat(TWO_VALUES_STATS.count()).isEqualTo(2);
assertThat(MANY_VALUES_STATS_VARARGS.count()).isEqualTo(MANY_VALUES_COUNT);
assertThat(MANY_VALUES_STATS_ITERABLE.count()).isEqualTo(MANY_VALUES_COUNT);
assertThat(MANY_VALUES_STATS_ITERATOR.count()).isEqualTo(MANY_VALUES_COUNT);
Reported by PMD.
Line: 104
public void testCount() {
assertThat(EMPTY_STATS_VARARGS.count()).isEqualTo(0);
assertThat(EMPTY_STATS_ITERABLE.count()).isEqualTo(0);
assertThat(ONE_VALUE_STATS.count()).isEqualTo(1);
assertThat(TWO_VALUES_STATS.count()).isEqualTo(2);
assertThat(MANY_VALUES_STATS_VARARGS.count()).isEqualTo(MANY_VALUES_COUNT);
assertThat(MANY_VALUES_STATS_ITERABLE.count()).isEqualTo(MANY_VALUES_COUNT);
assertThat(MANY_VALUES_STATS_ITERATOR.count()).isEqualTo(MANY_VALUES_COUNT);
assertThat(MANY_VALUES_STATS_SNAPSHOT.count()).isEqualTo(MANY_VALUES_COUNT);
Reported by PMD.
Line: 105
assertThat(EMPTY_STATS_VARARGS.count()).isEqualTo(0);
assertThat(EMPTY_STATS_ITERABLE.count()).isEqualTo(0);
assertThat(ONE_VALUE_STATS.count()).isEqualTo(1);
assertThat(TWO_VALUES_STATS.count()).isEqualTo(2);
assertThat(MANY_VALUES_STATS_VARARGS.count()).isEqualTo(MANY_VALUES_COUNT);
assertThat(MANY_VALUES_STATS_ITERABLE.count()).isEqualTo(MANY_VALUES_COUNT);
assertThat(MANY_VALUES_STATS_ITERATOR.count()).isEqualTo(MANY_VALUES_COUNT);
assertThat(MANY_VALUES_STATS_SNAPSHOT.count()).isEqualTo(MANY_VALUES_COUNT);
assertThat(INTEGER_MANY_VALUES_STATS_VARARGS.count()).isEqualTo(INTEGER_MANY_VALUES_COUNT);
Reported by PMD.
Line: 106
assertThat(EMPTY_STATS_ITERABLE.count()).isEqualTo(0);
assertThat(ONE_VALUE_STATS.count()).isEqualTo(1);
assertThat(TWO_VALUES_STATS.count()).isEqualTo(2);
assertThat(MANY_VALUES_STATS_VARARGS.count()).isEqualTo(MANY_VALUES_COUNT);
assertThat(MANY_VALUES_STATS_ITERABLE.count()).isEqualTo(MANY_VALUES_COUNT);
assertThat(MANY_VALUES_STATS_ITERATOR.count()).isEqualTo(MANY_VALUES_COUNT);
assertThat(MANY_VALUES_STATS_SNAPSHOT.count()).isEqualTo(MANY_VALUES_COUNT);
assertThat(INTEGER_MANY_VALUES_STATS_VARARGS.count()).isEqualTo(INTEGER_MANY_VALUES_COUNT);
assertThat(INTEGER_MANY_VALUES_STATS_ITERABLE.count()).isEqualTo(INTEGER_MANY_VALUES_COUNT);
Reported by PMD.
android/guava-tests/test/com/google/common/collect/ImmutableSetMultimapTest.java
417 issues
Line: 48
* @author Mike Ward
*/
@GwtCompatible(emulated = true)
public class ImmutableSetMultimapTest extends TestCase {
private static final class ImmutableSetMultimapGenerator extends TestStringSetMultimapGenerator {
@Override
protected SetMultimap<String, String> create(Entry<String, String>[] entries) {
ImmutableSetMultimap.Builder<String, String> builder = ImmutableSetMultimap.builder();
for (Entry<String, String> entry : entries) {
Reported by PMD.
Line: 48
* @author Mike Ward
*/
@GwtCompatible(emulated = true)
public class ImmutableSetMultimapTest extends TestCase {
private static final class ImmutableSetMultimapGenerator extends TestStringSetMultimapGenerator {
@Override
protected SetMultimap<String, String> create(Entry<String, String>[] entries) {
ImmutableSetMultimap.Builder<String, String> builder = ImmutableSetMultimap.builder();
for (Entry<String, String> entry : entries) {
Reported by PMD.
Line: 68
}
}
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(ImmutableSetMultimapTest.class);
suite.addTest(
SetMultimapTestSuiteBuilder.using(new ImmutableSetMultimapGenerator())
Reported by PMD.
Line: 85
return suite;
}
public void testBuilder_withImmutableEntry() {
ImmutableSetMultimap<String, Integer> multimap =
new Builder<String, Integer>().put(Maps.immutableEntry("one", 1)).build();
assertEquals(ImmutableSet.of(1), multimap.get("one"));
}
Reported by PMD.
Line: 87
public void testBuilder_withImmutableEntry() {
ImmutableSetMultimap<String, Integer> multimap =
new Builder<String, Integer>().put(Maps.immutableEntry("one", 1)).build();
assertEquals(ImmutableSet.of(1), multimap.get("one"));
}
public void testBuilder_withImmutableEntryAndNullContents() {
Builder<String, Integer> builder = new Builder<>();
Reported by PMD.
Line: 88
public void testBuilder_withImmutableEntry() {
ImmutableSetMultimap<String, Integer> multimap =
new Builder<String, Integer>().put(Maps.immutableEntry("one", 1)).build();
assertEquals(ImmutableSet.of(1), multimap.get("one"));
}
public void testBuilder_withImmutableEntryAndNullContents() {
Builder<String, Integer> builder = new Builder<>();
try {
Reported by PMD.
Line: 91
assertEquals(ImmutableSet.of(1), multimap.get("one"));
}
public void testBuilder_withImmutableEntryAndNullContents() {
Builder<String, Integer> builder = new Builder<>();
try {
builder.put(Maps.immutableEntry("one", (Integer) null));
fail();
} catch (NullPointerException expected) {
Reported by PMD.
Line: 95
Builder<String, Integer> builder = new Builder<>();
try {
builder.put(Maps.immutableEntry("one", (Integer) null));
fail();
} catch (NullPointerException expected) {
}
try {
builder.put(Maps.immutableEntry((String) null, 1));
fail();
Reported by PMD.
Line: 95
Builder<String, Integer> builder = new Builder<>();
try {
builder.put(Maps.immutableEntry("one", (Integer) null));
fail();
} catch (NullPointerException expected) {
}
try {
builder.put(Maps.immutableEntry((String) null, 1));
fail();
Reported by PMD.
Line: 96
try {
builder.put(Maps.immutableEntry("one", (Integer) null));
fail();
} catch (NullPointerException expected) {
}
try {
builder.put(Maps.immutableEntry((String) null, 1));
fail();
} catch (NullPointerException expected) {
Reported by PMD.
guava-tests/test/com/google/common/collect/ImmutableSetMultimapTest.java
412 issues
Line: 53
* @author Mike Ward
*/
@GwtCompatible(emulated = true)
public class ImmutableSetMultimapTest extends TestCase {
private static final class ImmutableSetMultimapGenerator extends TestStringSetMultimapGenerator {
@Override
protected SetMultimap<String, String> create(Entry<String, String>[] entries) {
ImmutableSetMultimap.Builder<String, String> builder = ImmutableSetMultimap.builder();
for (Entry<String, String> entry : entries) {
Reported by PMD.
Line: 53
* @author Mike Ward
*/
@GwtCompatible(emulated = true)
public class ImmutableSetMultimapTest extends TestCase {
private static final class ImmutableSetMultimapGenerator extends TestStringSetMultimapGenerator {
@Override
protected SetMultimap<String, String> create(Entry<String, String>[] entries) {
ImmutableSetMultimap.Builder<String, String> builder = ImmutableSetMultimap.builder();
for (Entry<String, String> entry : entries) {
Reported by PMD.
Line: 73
}
}
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(ImmutableSetMultimapTest.class);
suite.addTest(
SetMultimapTestSuiteBuilder.using(new ImmutableSetMultimapGenerator())
Reported by PMD.
Line: 90
return suite;
}
public void testBuilder_withImmutableEntry() {
ImmutableSetMultimap<String, Integer> multimap =
new Builder<String, Integer>().put(Maps.immutableEntry("one", 1)).build();
assertEquals(ImmutableSet.of(1), multimap.get("one"));
}
Reported by PMD.
Line: 92
public void testBuilder_withImmutableEntry() {
ImmutableSetMultimap<String, Integer> multimap =
new Builder<String, Integer>().put(Maps.immutableEntry("one", 1)).build();
assertEquals(ImmutableSet.of(1), multimap.get("one"));
}
public void testBuilder_withImmutableEntryAndNullContents() {
Builder<String, Integer> builder = new Builder<>();
Reported by PMD.
Line: 93
public void testBuilder_withImmutableEntry() {
ImmutableSetMultimap<String, Integer> multimap =
new Builder<String, Integer>().put(Maps.immutableEntry("one", 1)).build();
assertEquals(ImmutableSet.of(1), multimap.get("one"));
}
public void testBuilder_withImmutableEntryAndNullContents() {
Builder<String, Integer> builder = new Builder<>();
try {
Reported by PMD.
Line: 96
assertEquals(ImmutableSet.of(1), multimap.get("one"));
}
public void testBuilder_withImmutableEntryAndNullContents() {
Builder<String, Integer> builder = new Builder<>();
try {
builder.put(Maps.immutableEntry("one", (Integer) null));
fail();
} catch (NullPointerException expected) {
Reported by PMD.
Line: 100
Builder<String, Integer> builder = new Builder<>();
try {
builder.put(Maps.immutableEntry("one", (Integer) null));
fail();
} catch (NullPointerException expected) {
}
try {
builder.put(Maps.immutableEntry((String) null, 1));
fail();
Reported by PMD.
Line: 100
Builder<String, Integer> builder = new Builder<>();
try {
builder.put(Maps.immutableEntry("one", (Integer) null));
fail();
} catch (NullPointerException expected) {
}
try {
builder.put(Maps.immutableEntry((String) null, 1));
fail();
Reported by PMD.
Line: 101
try {
builder.put(Maps.immutableEntry("one", (Integer) null));
fail();
} catch (NullPointerException expected) {
}
try {
builder.put(Maps.immutableEntry((String) null, 1));
fail();
} catch (NullPointerException expected) {
Reported by PMD.
guava-tests/test/com/google/common/util/concurrent/ClosingFutureTest.java
403 issues
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.Lists.asList;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.Lists.asList;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.Lists.asList;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
Reported by PMD.
Line: 84
* ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)} paths to complete a
* {@link ClosingFuture} pipeline.
*/
public abstract class ClosingFutureTest extends TestCase {
// TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4.
final List<AssertionError> failures = new ArrayList<>();
final StandardSubjectBuilder expect =
StandardSubjectBuilder.forCustomFailureStrategy(
new FailureStrategy() {
Reported by PMD.
Line: 84
* ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)} paths to complete a
* {@link ClosingFuture} pipeline.
*/
public abstract class ClosingFutureTest extends TestCase {
// TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4.
final List<AssertionError> failures = new ArrayList<>();
final StandardSubjectBuilder expect =
StandardSubjectBuilder.forCustomFailureStrategy(
new FailureStrategy() {
Reported by PMD.
Line: 84
* ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)} paths to complete a
* {@link ClosingFuture} pipeline.
*/
public abstract class ClosingFutureTest extends TestCase {
// TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4.
final List<AssertionError> failures = new ArrayList<>();
final StandardSubjectBuilder expect =
StandardSubjectBuilder.forCustomFailureStrategy(
new FailureStrategy() {
Reported by PMD.
Line: 84
* ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)} paths to complete a
* {@link ClosingFuture} pipeline.
*/
public abstract class ClosingFutureTest extends TestCase {
// TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4.
final List<AssertionError> failures = new ArrayList<>();
final StandardSubjectBuilder expect =
StandardSubjectBuilder.forCustomFailureStrategy(
new FailureStrategy() {
Reported by PMD.
Line: 84
* ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)} paths to complete a
* {@link ClosingFuture} pipeline.
*/
public abstract class ClosingFutureTest extends TestCase {
// TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4.
final List<AssertionError> failures = new ArrayList<>();
final StandardSubjectBuilder expect =
StandardSubjectBuilder.forCustomFailureStrategy(
new FailureStrategy() {
Reported by PMD.
Line: 84
* ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)} paths to complete a
* {@link ClosingFuture} pipeline.
*/
public abstract class ClosingFutureTest extends TestCase {
// TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4.
final List<AssertionError> failures = new ArrayList<>();
final StandardSubjectBuilder expect =
StandardSubjectBuilder.forCustomFailureStrategy(
new FailureStrategy() {
Reported by PMD.
Line: 86
*/
public abstract class ClosingFutureTest extends TestCase {
// TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4.
final List<AssertionError> failures = new ArrayList<>();
final StandardSubjectBuilder expect =
StandardSubjectBuilder.forCustomFailureStrategy(
new FailureStrategy() {
@Override
public void fail(AssertionError failure) {
Reported by PMD.
android/guava-tests/test/com/google/common/util/concurrent/ClosingFutureTest.java
399 issues
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.Lists.asList;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.Lists.asList;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.Lists.asList;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
Reported by PMD.
Line: 84
* ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)} paths to complete a
* {@link ClosingFuture} pipeline.
*/
public abstract class ClosingFutureTest extends TestCase {
// TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4.
final List<AssertionError> failures = new ArrayList<>();
final StandardSubjectBuilder expect =
StandardSubjectBuilder.forCustomFailureStrategy(
new FailureStrategy() {
Reported by PMD.
Line: 84
* ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)} paths to complete a
* {@link ClosingFuture} pipeline.
*/
public abstract class ClosingFutureTest extends TestCase {
// TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4.
final List<AssertionError> failures = new ArrayList<>();
final StandardSubjectBuilder expect =
StandardSubjectBuilder.forCustomFailureStrategy(
new FailureStrategy() {
Reported by PMD.
Line: 84
* ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)} paths to complete a
* {@link ClosingFuture} pipeline.
*/
public abstract class ClosingFutureTest extends TestCase {
// TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4.
final List<AssertionError> failures = new ArrayList<>();
final StandardSubjectBuilder expect =
StandardSubjectBuilder.forCustomFailureStrategy(
new FailureStrategy() {
Reported by PMD.
Line: 84
* ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)} paths to complete a
* {@link ClosingFuture} pipeline.
*/
public abstract class ClosingFutureTest extends TestCase {
// TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4.
final List<AssertionError> failures = new ArrayList<>();
final StandardSubjectBuilder expect =
StandardSubjectBuilder.forCustomFailureStrategy(
new FailureStrategy() {
Reported by PMD.
Line: 84
* ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)} paths to complete a
* {@link ClosingFuture} pipeline.
*/
public abstract class ClosingFutureTest extends TestCase {
// TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4.
final List<AssertionError> failures = new ArrayList<>();
final StandardSubjectBuilder expect =
StandardSubjectBuilder.forCustomFailureStrategy(
new FailureStrategy() {
Reported by PMD.
Line: 84
* ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)} paths to complete a
* {@link ClosingFuture} pipeline.
*/
public abstract class ClosingFutureTest extends TestCase {
// TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4.
final List<AssertionError> failures = new ArrayList<>();
final StandardSubjectBuilder expect =
StandardSubjectBuilder.forCustomFailureStrategy(
new FailureStrategy() {
Reported by PMD.
Line: 86
*/
public abstract class ClosingFutureTest extends TestCase {
// TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4.
final List<AssertionError> failures = new ArrayList<>();
final StandardSubjectBuilder expect =
StandardSubjectBuilder.forCustomFailureStrategy(
new FailureStrategy() {
@Override
public void fail(AssertionError failure) {
Reported by PMD.
android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java
393 issues
Line: 369
new AbstractFuture<Object>() {
@Override
public String pendingToString() {
throw new RuntimeException("I'm a misbehaving implementation");
}
}.toString())
.matches(
"[^\\[]+\\[status=PENDING, info=\\[Exception thrown from implementation: "
+ "class java.lang.RuntimeException\\]\\]");
Reported by PMD.
Line: 975
new AbstractFuture<String>() {
@Override
public String toString() {
throw new NullPointerException();
}
});
assertThat(orig.toString())
.contains(
"[status=PENDING, setFuture=[Exception thrown from implementation: class"
Reported by PMD.
Line: 1169
try {
barrier.await();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private void checkStackTrace(ExecutionException e) {
// Our call site for get() should be in the trace.
Reported by PMD.
Line: 1231
void awaitWaiting() {
while (!isBlocked()) {
if (getState() == State.TERMINATED) {
throw new RuntimeException("Thread exited");
}
Thread.yield();
}
}
Reported by PMD.
Line: 1272
void awaitWaiting() {
while (!isBlocked()) {
if (getState() == State.TERMINATED) {
throw new RuntimeException("Thread exited");
}
Thread.yield();
}
}
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import com.google.common.annotations.GwtIncompatible;
Reported by PMD.
Line: 56
* @author Brian Stoler
*/
public class AbstractFutureTest extends TestCase {
public void testSuccess() throws ExecutionException, InterruptedException {
final Object value = new Object();
assertSame(
value,
new AbstractFuture<Object>() {
Reported by PMD.
Line: 56
* @author Brian Stoler
*/
public class AbstractFutureTest extends TestCase {
public void testSuccess() throws ExecutionException, InterruptedException {
final Object value = new Object();
assertSame(
value,
new AbstractFuture<Object>() {
Reported by PMD.
Line: 56
* @author Brian Stoler
*/
public class AbstractFutureTest extends TestCase {
public void testSuccess() throws ExecutionException, InterruptedException {
final Object value = new Object();
assertSame(
value,
new AbstractFuture<Object>() {
Reported by PMD.
Line: 56
* @author Brian Stoler
*/
public class AbstractFutureTest extends TestCase {
public void testSuccess() throws ExecutionException, InterruptedException {
final Object value = new Object();
assertSame(
value,
new AbstractFuture<Object>() {
Reported by PMD.
guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java
393 issues
Line: 369
new AbstractFuture<Object>() {
@Override
public String pendingToString() {
throw new RuntimeException("I'm a misbehaving implementation");
}
}.toString())
.matches(
"[^\\[]+\\[status=PENDING, info=\\[Exception thrown from implementation: "
+ "class java.lang.RuntimeException\\]\\]");
Reported by PMD.
Line: 975
new AbstractFuture<String>() {
@Override
public String toString() {
throw new NullPointerException();
}
});
assertThat(orig.toString())
.contains(
"[status=PENDING, setFuture=[Exception thrown from implementation: class"
Reported by PMD.
Line: 1169
try {
barrier.await();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private void checkStackTrace(ExecutionException e) {
// Our call site for get() should be in the trace.
Reported by PMD.
Line: 1231
void awaitWaiting() {
while (!isBlocked()) {
if (getState() == State.TERMINATED) {
throw new RuntimeException("Thread exited");
}
Thread.yield();
}
}
Reported by PMD.
Line: 1272
void awaitWaiting() {
while (!isBlocked()) {
if (getState() == State.TERMINATED) {
throw new RuntimeException("Thread exited");
}
Thread.yield();
}
}
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import com.google.common.annotations.GwtIncompatible;
Reported by PMD.
Line: 56
* @author Brian Stoler
*/
public class AbstractFutureTest extends TestCase {
public void testSuccess() throws ExecutionException, InterruptedException {
final Object value = new Object();
assertSame(
value,
new AbstractFuture<Object>() {
Reported by PMD.
Line: 56
* @author Brian Stoler
*/
public class AbstractFutureTest extends TestCase {
public void testSuccess() throws ExecutionException, InterruptedException {
final Object value = new Object();
assertSame(
value,
new AbstractFuture<Object>() {
Reported by PMD.
Line: 56
* @author Brian Stoler
*/
public class AbstractFutureTest extends TestCase {
public void testSuccess() throws ExecutionException, InterruptedException {
final Object value = new Object();
assertSame(
value,
new AbstractFuture<Object>() {
Reported by PMD.
Line: 56
* @author Brian Stoler
*/
public class AbstractFutureTest extends TestCase {
public void testSuccess() throws ExecutionException, InterruptedException {
final Object value = new Object();
assertSame(
value,
new AbstractFuture<Object>() {
Reported by PMD.
guava-tests/test/com/google/common/graph/GraphsTest.java
392 issues
Line: 38
* the missing nodes to the graph, then adds the edge between them.
*/
@RunWith(JUnit4.class)
public class GraphsTest {
private static final Integer N1 = 1;
private static final Integer N2 = 2;
private static final Integer N3 = 3;
private static final Integer N4 = 4;
private static final String E11 = "1-1";
Reported by PMD.
Line: 47
private static final String E11_A = "1-1a";
private static final String E12 = "1-2";
private static final String E12_A = "1-2a";
private static final String E12_B = "1-2b";
private static final String E21 = "2-1";
private static final String E13 = "1-3";
private static final String E31 = "3-1";
private static final String E34 = "3-4";
private static final String E44 = "4-4";
Reported by PMD.
Line: 66
static final String ERROR_SELF_LOOP = "self-loops are not allowed";
@Test
public void transitiveClosure_directedGraph() {
MutableGraph<Integer> directedGraph = GraphBuilder.directed().allowsSelfLoops(false).build();
directedGraph.putEdge(N1, N2);
directedGraph.putEdge(N1, N3);
directedGraph.putEdge(N2, N3);
directedGraph.addNode(N4);
Reported by PMD.
Line: 67
@Test
public void transitiveClosure_directedGraph() {
MutableGraph<Integer> directedGraph = GraphBuilder.directed().allowsSelfLoops(false).build();
directedGraph.putEdge(N1, N2);
directedGraph.putEdge(N1, N3);
directedGraph.putEdge(N2, N3);
directedGraph.addNode(N4);
Reported by PMD.
Line: 67
@Test
public void transitiveClosure_directedGraph() {
MutableGraph<Integer> directedGraph = GraphBuilder.directed().allowsSelfLoops(false).build();
directedGraph.putEdge(N1, N2);
directedGraph.putEdge(N1, N3);
directedGraph.putEdge(N2, N3);
directedGraph.addNode(N4);
Reported by PMD.
Line: 68
@Test
public void transitiveClosure_directedGraph() {
MutableGraph<Integer> directedGraph = GraphBuilder.directed().allowsSelfLoops(false).build();
directedGraph.putEdge(N1, N2);
directedGraph.putEdge(N1, N3);
directedGraph.putEdge(N2, N3);
directedGraph.addNode(N4);
MutableGraph<Integer> expectedClosure = GraphBuilder.directed().allowsSelfLoops(true).build();
Reported by PMD.
Line: 69
public void transitiveClosure_directedGraph() {
MutableGraph<Integer> directedGraph = GraphBuilder.directed().allowsSelfLoops(false).build();
directedGraph.putEdge(N1, N2);
directedGraph.putEdge(N1, N3);
directedGraph.putEdge(N2, N3);
directedGraph.addNode(N4);
MutableGraph<Integer> expectedClosure = GraphBuilder.directed().allowsSelfLoops(true).build();
expectedClosure.putEdge(N1, N1);
Reported by PMD.
Line: 70
MutableGraph<Integer> directedGraph = GraphBuilder.directed().allowsSelfLoops(false).build();
directedGraph.putEdge(N1, N2);
directedGraph.putEdge(N1, N3);
directedGraph.putEdge(N2, N3);
directedGraph.addNode(N4);
MutableGraph<Integer> expectedClosure = GraphBuilder.directed().allowsSelfLoops(true).build();
expectedClosure.putEdge(N1, N1);
expectedClosure.putEdge(N1, N2);
Reported by PMD.
Line: 71
directedGraph.putEdge(N1, N2);
directedGraph.putEdge(N1, N3);
directedGraph.putEdge(N2, N3);
directedGraph.addNode(N4);
MutableGraph<Integer> expectedClosure = GraphBuilder.directed().allowsSelfLoops(true).build();
expectedClosure.putEdge(N1, N1);
expectedClosure.putEdge(N1, N2);
expectedClosure.putEdge(N1, N3);
Reported by PMD.
Line: 73
directedGraph.putEdge(N2, N3);
directedGraph.addNode(N4);
MutableGraph<Integer> expectedClosure = GraphBuilder.directed().allowsSelfLoops(true).build();
expectedClosure.putEdge(N1, N1);
expectedClosure.putEdge(N1, N2);
expectedClosure.putEdge(N1, N3);
expectedClosure.putEdge(N2, N2);
expectedClosure.putEdge(N2, N3);
Reported by PMD.