aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google
diff options
context:
space:
mode:
authorGravatar cushon <cushon@google.com>2017-09-15 09:33:27 +0200
committerGravatar Philipp Wollermann <philwo@google.com>2017-09-15 11:29:32 +0200
commit03e701887fb83fd8bf99f85c951a2dc81e56332f (patch)
tree2a21f3b21de61114bafa7c4364ba3082a800b57d /src/test/java/com/google
parent6f3af28954ac65614b4dc8e2378829a5a653038f (diff)
Automatic code cleanup.
PiperOrigin-RevId: 168802886
Diffstat (limited to 'src/test/java/com/google')
-rw-r--r--src/test/java/com/google/devtools/build/lib/actions/ResourceManagerTest.java6
-rw-r--r--src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java11
-rw-r--r--src/test/java/com/google/devtools/build/lib/concurrent/AbstractQueueVisitorTest.java6
-rw-r--r--src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java14
-rw-r--r--src/test/java/com/google/devtools/build/lib/packages/TestTargetUtilsTest.java14
-rw-r--r--src/test/java/com/google/devtools/build/lib/pkgcache/PathPackageLocatorTest.java9
-rw-r--r--src/test/java/com/google/devtools/build/lib/runtime/CommandInterruptionTest.java2
-rw-r--r--src/test/java/com/google/devtools/build/lib/shell/CommandTest.java7
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/ArtifactFunctionTest.java2
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java8
-rw-r--r--src/test/java/com/google/devtools/build/skyframe/MemoizingEvaluatorTest.java22
11 files changed, 54 insertions, 47 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/actions/ResourceManagerTest.java b/src/test/java/com/google/devtools/build/lib/actions/ResourceManagerTest.java
index fbe74fbae2..2357dc28c3 100644
--- a/src/test/java/com/google/devtools/build/lib/actions/ResourceManagerTest.java
+++ b/src/test/java/com/google/devtools/build/lib/actions/ResourceManagerTest.java
@@ -47,8 +47,8 @@ public class ResourceManagerTest {
public final void configureResourceManager() throws Exception {
rm.setRamUtilizationPercentage(100);
rm.setAvailableResources(
- ResourceSet.create(/*memoryMb=*/1000.0, /*cpuUsage=*/1.0, /*ioUsage=*/1.0,
- /*testCount=*/2));
+ ResourceSet.create(
+ /*memoryMb=*/ 1000.0, /*cpuUsage=*/ 1.0, /*ioUsage=*/ 1.0, /* localTestCount= */ 2));
counter = new AtomicInteger(0);
sync = new CyclicBarrier(2);
sync2 = new CyclicBarrier(2);
@@ -357,7 +357,7 @@ public class ResourceManagerTest {
// the available memory. But it shouldn't.
rm.setAvailableResources(
ResourceSet.create(
- /*memoryMb=*/ 2000.0, /*cpuUsage=*/ 1.0, /*ioUsage=*/ 1.0, /*testCount=*/ 2));
+ /*memoryMb=*/ 2000.0, /*cpuUsage=*/ 1.0, /*ioUsage=*/ 1.0, /* localTestCount= */ 2));
TestThread thread2 =
new TestThread() {
@Override
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java
index aa2bf35295..8c2eddd133 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java
@@ -485,9 +485,14 @@ public abstract class BuildViewTestCase extends FoundationTestCase {
}
protected CachingAnalysisEnvironment getTestAnalysisEnvironment() {
- return new CachingAnalysisEnvironment(view.getArtifactFactory(),
- ArtifactOwner.NULL_OWNER, /*isSystemEnv=*/true, /*extendedSanityChecks*/false, reporter,
- /*skyframeEnv=*/ null, /*actionsEnabled=*/true);
+ return new CachingAnalysisEnvironment(
+ view.getArtifactFactory(),
+ ArtifactOwner.NULL_OWNER,
+ /*isSystemEnv=*/ true, /*extendedSanityChecks*/
+ false,
+ reporter,
+ /* env= */ null,
+ /* allowRegisteringActions= */ true);
}
/**
diff --git a/src/test/java/com/google/devtools/build/lib/concurrent/AbstractQueueVisitorTest.java b/src/test/java/com/google/devtools/build/lib/concurrent/AbstractQueueVisitorTest.java
index 07544f670b..108f18d866 100644
--- a/src/test/java/com/google/devtools/build/lib/concurrent/AbstractQueueVisitorTest.java
+++ b/src/test/java/com/google/devtools/build/lib/concurrent/AbstractQueueVisitorTest.java
@@ -561,9 +561,9 @@ public class AbstractQueueVisitorTest {
public CountingQueueVisitor() {
super(
/*parallelism=*/ 5,
- /*keepAlive=*/ 3L,
+ /* keepAliveTime= */ 3L,
TimeUnit.SECONDS,
- /*failFast=*/ false,
+ /* failFastOnException= */ false,
THREAD_NAME,
AbstractQueueVisitor.EXECUTOR_FACTORY,
ErrorClassifier.DEFAULT);
@@ -602,7 +602,7 @@ public class AbstractQueueVisitorTest {
5,
3L,
TimeUnit.SECONDS,
- /*failFast=*/ false,
+ /* failFastOnException= */ false,
THREAD_NAME,
AbstractQueueVisitor.EXECUTOR_FACTORY,
ErrorClassifier.DEFAULT);
diff --git a/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java b/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java
index e443321abc..cf450317a1 100644
--- a/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java
@@ -735,7 +735,7 @@ public class PackageFactoryTest extends PackageFactoryTestBase {
/*result=*/ ImmutableList.of("Wombat1.java", "This_file_doesn_t_exist.java"),
/*includes=*/ ImmutableList.of("W*", "subdir"),
/*excludes=*/ ImmutableList.<String>of(),
- /*excludesDirs=*/ true);
+ /* excludeDirs= */ true);
fail();
} catch (IllegalArgumentException e) {
assertThat(e).hasMessage("ERROR /globs/BUILD:2:73: name 'this_will_fail' is not defined");
@@ -748,7 +748,7 @@ public class PackageFactoryTest extends PackageFactoryTestBase {
/*result=*/ ImmutableList.of("Wombat1.java", "Wombat2.java"),
/*includes=*/ ImmutableList.of("W*", "subdir"),
/*excludes=*/ ImmutableList.<String>of(),
- /*excludesDirs=*/ true);
+ /* excludeDirs= */ true);
}
@Test
@@ -757,7 +757,7 @@ public class PackageFactoryTest extends PackageFactoryTestBase {
/*result=*/ ImmutableList.of("Wombat1.java", "Wombat2.java", "subdir"),
/*includes=*/ ImmutableList.of("W*", "subdir"),
/*excludes=*/ ImmutableList.<String>of(),
- /*excludesDirs=*/ false);
+ /* excludeDirs= */ false);
}
@Test
@@ -766,7 +766,7 @@ public class PackageFactoryTest extends PackageFactoryTestBase {
/*result=*/ ImmutableList.of("Wombat1.java", "Wombat2.java"),
/*includes=*/ ImmutableList.of("W*"),
/*excludes=*/ Collections.<String>emptyList(),
- /*excludesDirs=*/ false);
+ /* excludeDirs= */ false);
}
@Test
@@ -785,7 +785,7 @@ public class PackageFactoryTest extends PackageFactoryTestBase {
/*result=*/ ImmutableList.of("Wombat1.java"),
/*includes=*/ ImmutableList.of("W*"),
/*excludes=*/ ImmutableList.of("*2*"),
- /*excludesDirs=*/ false);
+ /* excludeDirs= */ false);
}
@Test
@@ -794,7 +794,7 @@ public class PackageFactoryTest extends PackageFactoryTestBase {
/*result=*/ ImmutableList.of("Wombat1.java", "subdir/Wombat3.java"),
/*includes=*/ ImmutableList.of("W*", "subdir/W*"),
/*excludes=*/ ImmutableList.of("*2*"),
- /*excludesDirs=*/ false);
+ /* excludeDirs= */ false);
}
@Test
@@ -803,7 +803,7 @@ public class PackageFactoryTest extends PackageFactoryTestBase {
/*result=*/ ImmutableList.of("subdir/Wombat3.java"),
/*includes=*/ ImmutableList.of("W*", "subdir/W*"),
/*excludes=*/ ImmutableList.of("Wombat*.java"),
- /*excludesDirs=*/ false);
+ /* excludeDirs= */ false);
}
@Test
diff --git a/src/test/java/com/google/devtools/build/lib/packages/TestTargetUtilsTest.java b/src/test/java/com/google/devtools/build/lib/packages/TestTargetUtilsTest.java
index 2ff6446c3c..265c088c02 100644
--- a/src/test/java/com/google/devtools/build/lib/packages/TestTargetUtilsTest.java
+++ b/src/test/java/com/google/devtools/build/lib/packages/TestTargetUtilsTest.java
@@ -150,9 +150,9 @@ public class TestTargetUtilsTest extends PackageLoadingTestCase {
TestTargetUtils.expandTestSuites(
getPackageManager(),
reporter,
- Sets.newHashSet(getTarget("//broken")), /*strict=*/
- false, /*keep_going=*/
- true);
+ Sets.newHashSet(getTarget("//broken")),
+ /*strict=*/ false,
+ /* keepGoing= */ true);
assertThat(actual.hasError()).isTrue();
assertThat(actual.getTargets()).isEmpty();
}
@@ -161,7 +161,7 @@ public class TestTargetUtilsTest extends PackageLoadingTestCase {
throws Exception {
ResolvedTargets<Target> actual =
TestTargetUtils.expandTestSuites(
- getPackageManager(), reporter, suites, /*strict=*/ false, /*keep_going=*/ true);
+ getPackageManager(), reporter, suites, /*strict=*/ false, /* keepGoing= */ true);
assertThat(actual.hasError()).isFalse();
assertThat(actual.getTargets()).containsExactlyElementsIn(expected);
}
@@ -201,9 +201,9 @@ public class TestTargetUtilsTest extends PackageLoadingTestCase {
}
},
reporter,
- Sets.newHashSet(getTarget("//broken")), /*strict=*/
- false, /*keep_going=*/
- true);
+ Sets.newHashSet(getTarget("//broken")),
+ /*strict=*/ false,
+ /* keepGoing= */ true);
} catch (TargetParsingException e) {
assertThat(e).hasMessageThat().isNotNull();
}
diff --git a/src/test/java/com/google/devtools/build/lib/pkgcache/PathPackageLocatorTest.java b/src/test/java/com/google/devtools/build/lib/pkgcache/PathPackageLocatorTest.java
index f7d1aa44db..3ef04b5ad0 100644
--- a/src/test/java/com/google/devtools/build/lib/pkgcache/PathPackageLocatorTest.java
+++ b/src/test/java/com/google/devtools/build/lib/pkgcache/PathPackageLocatorTest.java
@@ -235,9 +235,14 @@ public class PathPackageLocatorTest extends FoundationTestCase {
private Path setLocator(String root) {
Path nonExistentRoot = scratch.resolve(root);
- this.locator = PathPackageLocator.create(null, Arrays.asList(root), reporter,
+ this.locator =
+ PathPackageLocator.create(
+ null,
+ Arrays.asList(root),
+ reporter,
/*workspace=*/ FileSystemUtils.getWorkingDirectory(scratch.getFileSystem()),
- /*workingDir=*/ FileSystemUtils.getWorkingDirectory(scratch.getFileSystem()));
+ /* clientWorkingDirectory= */ FileSystemUtils.getWorkingDirectory(
+ scratch.getFileSystem()));
return nonExistentRoot;
}
diff --git a/src/test/java/com/google/devtools/build/lib/runtime/CommandInterruptionTest.java b/src/test/java/com/google/devtools/build/lib/runtime/CommandInterruptionTest.java
index b254c4ebe5..1843ca7979 100644
--- a/src/test/java/com/google/devtools/build/lib/runtime/CommandInterruptionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/runtime/CommandInterruptionTest.java
@@ -371,7 +371,7 @@ public final class CommandInterruptionTest {
dispatcher = new BlazeCommandDispatcher(runtime, snooze);
BlazeDirectories blazeDirectories =
new BlazeDirectories(serverDirectories, scratch.dir("workspace"), productName);
- runtime.initWorkspace(blazeDirectories, /*bintools=*/ null);
+ runtime.initWorkspace(blazeDirectories, /* binTools= */ null);
}
@After
diff --git a/src/test/java/com/google/devtools/build/lib/shell/CommandTest.java b/src/test/java/com/google/devtools/build/lib/shell/CommandTest.java
index 52dd8b9909..c7e887dd3b 100644
--- a/src/test/java/com/google/devtools/build/lib/shell/CommandTest.java
+++ b/src/test/java/com/google/devtools/build/lib/shell/CommandTest.java
@@ -208,11 +208,8 @@ public class CommandTest {
ByteArrayInputStream emptyInput = new ByteArrayInputStream(new byte[0]);
ByteArrayOutputStream stdOut = new ByteArrayOutputStream();
ByteArrayOutputStream stdErr = new ByteArrayOutputStream();
- FutureCommandResult result = command.executeAsync(
- emptyInput,
- stdOut,
- stdErr,
- /*killSubprocess=*/ false);
+ FutureCommandResult result =
+ command.executeAsync(emptyInput, stdOut, stdErr, /* killSubprocessOnInterrupt= */ false);
result.get(); // Make sure the process actually finished
assertThat(stdOut.toString("UTF-8")).isEqualTo(helloWorld + "\n");
assertThat(stdErr.toByteArray()).isEmpty();
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/ArtifactFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/ArtifactFunctionTest.java
index 16b7a39387..5e2dba77c8 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/ArtifactFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/ArtifactFunctionTest.java
@@ -448,7 +448,7 @@ public class ArtifactFunctionTest extends ArtifactFunctionTestCase {
}
private SkyValue evaluateArtifactValue(Artifact artifact) throws Throwable {
- return evaluateArtifactValue(artifact, /*isMandatory=*/ true);
+ return evaluateArtifactValue(artifact, /* mandatory= */ true);
}
private SkyValue evaluateArtifactValue(Artifact artifact, boolean mandatory) throws Throwable {
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java
index 2daf071529..df5ed51efb 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java
@@ -1249,22 +1249,22 @@ public class FileFunctionTest {
@Test
public void testInfiniteSymlinkExpansion_AbsoluteSymlinkToDescendant() throws Exception {
- runTestInfiniteSymlinkExpansion(/*ancestor=*/ false, /*absoluteSymlink=*/ true);
+ runTestInfiniteSymlinkExpansion(/* symlinkToAncestor= */ false, /*absoluteSymlink=*/ true);
}
@Test
public void testInfiniteSymlinkExpansion_RelativeSymlinkToDescendant() throws Exception {
- runTestInfiniteSymlinkExpansion(/*ancestor=*/ false, /*absoluteSymlink=*/ false);
+ runTestInfiniteSymlinkExpansion(/* symlinkToAncestor= */ false, /*absoluteSymlink=*/ false);
}
@Test
public void testInfiniteSymlinkExpansion_AbsoluteSymlinkToAncestor() throws Exception {
- runTestInfiniteSymlinkExpansion(/*ancestor=*/ true, /*absoluteSymlink=*/ true);
+ runTestInfiniteSymlinkExpansion(/* symlinkToAncestor= */ true, /*absoluteSymlink=*/ true);
}
@Test
public void testInfiniteSymlinkExpansion_RelativeSymlinkToAncestor() throws Exception {
- runTestInfiniteSymlinkExpansion(/*ancestor=*/ true, /*absoluteSymlink=*/ false);
+ runTestInfiniteSymlinkExpansion(/* symlinkToAncestor= */ true, /*absoluteSymlink=*/ false);
}
@Test
diff --git a/src/test/java/com/google/devtools/build/skyframe/MemoizingEvaluatorTest.java b/src/test/java/com/google/devtools/build/skyframe/MemoizingEvaluatorTest.java
index f3cf5a83d0..1a70c2e70a 100644
--- a/src/test/java/com/google/devtools/build/skyframe/MemoizingEvaluatorTest.java
+++ b/src/test/java/com/google/devtools/build/skyframe/MemoizingEvaluatorTest.java
@@ -780,7 +780,7 @@ public class MemoizingEvaluatorTest {
}
tester.set("leaf", new StringValue("leaf"));
- EvaluationResult<StringValue> result = tester.eval(/*keep_going=*/false, values);
+ EvaluationResult<StringValue> result = tester.eval(/* keepGoing= */ false, values);
for (int i = 0; i < values.length; i++) {
SkyValue actual = result.get(toSkyKey(values[i]));
assertThat(actual).isEqualTo(new StringValue("leaf"));
@@ -789,7 +789,7 @@ public class MemoizingEvaluatorTest {
for (int j = 0; j < TESTED_NODES; j++) {
tester.set("leaf", new StringValue("other" + j));
tester.invalidate();
- result = tester.eval(/*keep_going=*/false, values);
+ result = tester.eval(/* keepGoing= */ false, values);
for (int i = 0; i < values.length; i++) {
SkyValue actual = result.get(toSkyKey(values[i]));
assertWithMessage("Run " + j + ", value " + i)
@@ -816,7 +816,7 @@ public class MemoizingEvaluatorTest {
value.addDependency(values[i]);
}
- EvaluationResult<StringValue> result = tester.eval(/*keep_going=*/false, rootKey);
+ EvaluationResult<StringValue> result = tester.eval(/* keepGoing= */ false, rootKey);
assertThat(result.get(rootKey)).isEqualTo(new StringValue(expected.toString()));
for (int j = 0; j < 10; j++) {
@@ -828,7 +828,7 @@ public class MemoizingEvaluatorTest {
}
tester.invalidate();
- result = tester.eval(/*keep_going=*/false, rootKey);
+ result = tester.eval(/* keepGoing= */ false, rootKey);
assertThat(result.get(rootKey)).isEqualTo(new StringValue(expected.toString()));
}
}
@@ -864,7 +864,7 @@ public class MemoizingEvaluatorTest {
String lastLeft = "left-" + (TEST_NODE_COUNT - 1);
String lastRight = "right-" + (TEST_NODE_COUNT - 1);
- EvaluationResult<StringValue> result = tester.eval(/*keep_going=*/false, lastLeft, lastRight);
+ EvaluationResult<StringValue> result = tester.eval(/* keepGoing= */ false, lastLeft, lastRight);
assertThat(result.get(toSkyKey(lastLeft))).isEqualTo(new StringValue("leaf"));
assertThat(result.get(toSkyKey(lastRight))).isEqualTo(new StringValue("leaf"));
@@ -872,7 +872,7 @@ public class MemoizingEvaluatorTest {
String value = "other" + j;
tester.set("leaf", new StringValue(value));
tester.invalidate();
- result = tester.eval(/*keep_going=*/false, lastLeft, lastRight);
+ result = tester.eval(/* keepGoing= */ false, lastLeft, lastRight);
assertThat(result.get(toSkyKey(lastLeft))).isEqualTo(new StringValue(value));
assertThat(result.get(toSkyKey(lastRight))).isEqualTo(new StringValue(value));
}
@@ -2342,7 +2342,7 @@ public class MemoizingEvaluatorTest {
tester.getOrCreate(topKey, /*markAsModified=*/false).setHasError(true);
tester.invalidate();
- result = tester.eval(/*keep_going=*/false, topKey);
+ result = tester.eval(/* keepGoing= */ false, topKey);
assertThat(result.get(topKey)).isEqualTo(new StringValue(expected.toString()));
}
}
@@ -3643,16 +3643,16 @@ public class MemoizingEvaluatorTest {
try {
tester.getOrCreate(leftValues[i], /*markAsModified=*/true).setHasError(true);
tester.invalidate();
- EvaluationResult<StringValue> result = tester.eval(
- /*keep_going=*/false, lastLeft, lastRight);
+ EvaluationResult<StringValue> result =
+ tester.eval(/* keepGoing= */ false, lastLeft, lastRight);
assertThat(result.hasError()).isTrue();
tester.differencer.invalidate(ImmutableList.of(leftValues[i]));
tester.invalidate();
- result = tester.eval(/*keep_going=*/false, lastLeft, lastRight);
+ result = tester.eval(/* keepGoing= */ false, lastLeft, lastRight);
assertThat(result.hasError()).isTrue();
tester.getOrCreate(leftValues[i], /*markAsModified=*/true).setHasError(false);
tester.invalidate();
- result = tester.eval(/*keep_going=*/false, lastLeft, lastRight);
+ result = tester.eval(/* keepGoing= */ false, lastLeft, lastRight);
assertThat(result.get(toSkyKey(lastLeft))).isEqualTo(new StringValue("leaf"));
assertThat(result.get(toSkyKey(lastRight))).isEqualTo(new StringValue("leaf"));
} catch (Exception e) {