aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValerij Fredriksen <valerij92@gmail.com>2018-05-07 22:08:17 +0200
committerValerij Fredriksen <valerij92@gmail.com>2018-05-07 22:13:54 +0200
commit3fbd22f037518a171aa14591e3921a568ad38b82 (patch)
tree64548048c6b5272c68f5f6fd5829eb43d78b6a03
parent1ad3b3138ebe70aa122071e12ba210d9dd3d79e5 (diff)
Remove unncessary throws
-rw-r--r--docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/DockerImageGarbageCollectionTest.java20
-rw-r--r--docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/DockerImplTest.java2
-rw-r--r--docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/ProcessResultTest.java4
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/noderepository/RealNodeRepositoryTest.java2
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperationsImplTest.java2
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/NodeStateTest.java4
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/RebootTest.java2
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/RestartTest.java2
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImplTest.java4
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/FileAttributesCacheTest.java2
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/FileContentCacheTest.java4
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/TemplateTest.java2
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/UnixPathTest.java8
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/systemd/SystemCtlTest.java18
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/yum/AddYumRepoTest.java2
-rw-r--r--node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollector.java10
-rw-r--r--node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollectorTest.java20
-rw-r--r--node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/CoredumpHandlerTest.java6
-rw-r--r--node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/FileHelperTest.java2
-rw-r--r--node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/commons/noderepo/IPAddressVerifierTest.java2
-rw-r--r--node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/hardware/benchmarks/CPUBenchmarkTest.java2
-rw-r--r--node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/CPURetrieverTest.java2
-rw-r--r--node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/DiskRetrieverTest.java6
-rw-r--r--node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/MemoryRetrieverTest.java2
-rw-r--r--node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/NetRetrieverTest.java2
25 files changed, 66 insertions, 66 deletions
diff --git a/docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/DockerImageGarbageCollectionTest.java b/docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/DockerImageGarbageCollectionTest.java
index 9072f5c0d15..a78c9280e4e 100644
--- a/docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/DockerImageGarbageCollectionTest.java
+++ b/docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/DockerImageGarbageCollectionTest.java
@@ -23,21 +23,21 @@ import static org.junit.Assert.assertThat;
*/
public class DockerImageGarbageCollectionTest {
@Test
- public void noImagesMeansNoUnusedImages() throws Exception {
+ public void noImagesMeansNoUnusedImages() {
new ImageGcTester(0)
.withExistingImages()
.expectUnusedImages();
}
@Test
- public void singleImageWithoutContainersIsUnused() throws Exception {
+ public void singleImageWithoutContainersIsUnused() {
new ImageGcTester(0)
.withExistingImages(new ImageBuilder("image-1"))
.expectUnusedImages("image-1");
}
@Test
- public void singleImageWithContainerIsUsed() throws Exception {
+ public void singleImageWithContainerIsUsed() {
new ImageGcTester(0)
.withExistingImages(ImageBuilder.forId("image-1"))
.andExistingContainers(ContainerBuilder.forId("container-1").withImageId("image-1"))
@@ -45,7 +45,7 @@ public class DockerImageGarbageCollectionTest {
}
@Test
- public void multipleUnusedImagesAreIdentified() throws Exception {
+ public void multipleUnusedImagesAreIdentified() {
new ImageGcTester(0)
.withExistingImages(
ImageBuilder.forId("image-1"),
@@ -54,7 +54,7 @@ public class DockerImageGarbageCollectionTest {
}
@Test
- public void multipleUnusedLeavesAreIdentified() throws Exception {
+ public void multipleUnusedLeavesAreIdentified() {
new ImageGcTester(0)
.withExistingImages(
ImageBuilder.forId("parent-image"),
@@ -64,7 +64,7 @@ public class DockerImageGarbageCollectionTest {
}
@Test
- public void unusedLeafWithUsedSiblingIsIdentified() throws Exception {
+ public void unusedLeafWithUsedSiblingIsIdentified() {
new ImageGcTester(0)
.withExistingImages(
ImageBuilder.forId("parent-image"),
@@ -75,7 +75,7 @@ public class DockerImageGarbageCollectionTest {
}
@Test
- public void unusedImagesWithMultipleTags() throws Exception {
+ public void unusedImagesWithMultipleTags() {
new ImageGcTester(0)
.withExistingImages(
ImageBuilder.forId("parent-image"),
@@ -85,14 +85,14 @@ public class DockerImageGarbageCollectionTest {
}
@Test
- public void taggedImageWithNoContainersIsUnused() throws Exception {
+ public void taggedImageWithNoContainersIsUnused() {
new ImageGcTester(0)
.withExistingImages(ImageBuilder.forId("image-1").withTags("vespa-6"))
.expectUnusedImages("vespa-6");
}
@Test
- public void unusedImagesWithSimpleImageGc() throws Exception {
+ public void unusedImagesWithSimpleImageGc() {
new ImageGcTester(20)
.withExistingImages(
ImageBuilder.forId("parent-image").withLastUsedMinutesAgo(25),
@@ -101,7 +101,7 @@ public class DockerImageGarbageCollectionTest {
}
@Test
- public void unusedImagesWithImageGc() throws Exception {
+ public void unusedImagesWithImageGc() {
new ImageGcTester(20)
.withExistingImages(
ImageBuilder.forId("parent-1").withLastUsedMinutesAgo(40),
diff --git a/docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/DockerImplTest.java b/docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/DockerImplTest.java
index 654b5df3f3b..82c7d2285e9 100644
--- a/docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/DockerImplTest.java
+++ b/docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/DockerImplTest.java
@@ -34,7 +34,7 @@ import static org.mockito.Mockito.when;
public class DockerImplTest {
@Test
- public void testExecuteCompletes() throws Exception {
+ public void testExecuteCompletes() {
final String containerId = "container-id";
final String[] command = new String[] {"/bin/ls", "-l"};
final String execId = "exec-id";
diff --git a/docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/ProcessResultTest.java b/docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/ProcessResultTest.java
index 4e5d32046ae..0f1ad8a3466 100644
--- a/docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/ProcessResultTest.java
+++ b/docker-api/src/test/java/com/yahoo/vespa/hosted/dockerapi/ProcessResultTest.java
@@ -8,7 +8,7 @@ import static org.junit.Assert.assertThat;
public class ProcessResultTest {
@Test
- public void testBasicProperties() throws Exception {
+ public void testBasicProperties() {
ProcessResult processResult = new ProcessResult(0, "foo", "bar");
assertThat(processResult.getExitStatus(), is(0));
assertThat(processResult.getOutput(), is("foo"));
@@ -16,7 +16,7 @@ public class ProcessResultTest {
}
@Test
- public void testSuccessFails() throws Exception {
+ public void testSuccessFails() {
ProcessResult processResult = new ProcessResult(1, "foo", "bar");
assertThat(processResult.isSuccess(), is(false));
}
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/noderepository/RealNodeRepositoryTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/noderepository/RealNodeRepositoryTest.java
index 7f9f0027546..ae5ba9681e6 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/noderepository/RealNodeRepositoryTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/noderepository/RealNodeRepositoryTest.java
@@ -101,7 +101,7 @@ public class RealNodeRepositoryTest {
}
@Test
- public void testGetContainersToRunApi() throws InterruptedException {
+ public void testGetContainersToRunApi() {
String dockerHostHostname = "dockerhost1.yahoo.com";
final List<NodeSpec> containersToRun = nodeRepositoryApi.getNodes(dockerHostHostname);
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperationsImplTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperationsImplTest.java
index e5f35f17aed..4526891d24a 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperationsImplTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperationsImplTest.java
@@ -43,7 +43,7 @@ public class DockerOperationsImplTest {
= new DockerOperationsImpl(docker, environment, processExecuter, addressesMock);
@Test
- public void processResultFromNodeProgramWhenSuccess() throws Exception {
+ public void processResultFromNodeProgramWhenSuccess() {
final ContainerName containerName = new ContainerName("container-name");
final ProcessResult actualResult = new ProcessResult(0, "output", "errors");
final String programPath = "/bin/command";
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/NodeStateTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/NodeStateTest.java
index 063e478ffb4..16e311cdec1 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/NodeStateTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/NodeStateTest.java
@@ -43,7 +43,7 @@ public class NodeStateTest {
@Test
- public void activeToDirty() throws InterruptedException, IOException {
+ public void activeToDirty() throws InterruptedException {
try (DockerTester dockerTester = new DockerTester()) {
setup(dockerTester);
// Change node state to dirty
@@ -68,7 +68,7 @@ public class NodeStateTest {
}
@Test
- public void activeToInactiveToActive() throws InterruptedException, IOException {
+ public void activeToInactiveToActive() throws InterruptedException {
try (DockerTester dockerTester = new DockerTester()) {
setup(dockerTester);
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/RebootTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/RebootTest.java
index f8746bcc22a..c5621b2f0e6 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/RebootTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/RebootTest.java
@@ -27,7 +27,7 @@ public class RebootTest {
@Test
@Ignore
- public void test() throws InterruptedException, UnknownHostException {
+ public void test() throws InterruptedException {
try (DockerTester dockerTester = new DockerTester()) {
dockerTester.addNodeRepositoryNode(createNodeRepositoryNode());
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/RestartTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/RestartTest.java
index d029d356d77..91071cf096c 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/RestartTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/RestartTest.java
@@ -17,7 +17,7 @@ import java.net.UnknownHostException;
public class RestartTest {
@Test
- public void test() throws InterruptedException, UnknownHostException {
+ public void test() throws InterruptedException {
try (DockerTester dockerTester = new DockerTester()) {
long wantedRestartGeneration = 1;
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImplTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImplTest.java
index 22aa7a5d229..91c61623ee7 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImplTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImplTest.java
@@ -54,7 +54,7 @@ public class NodeAdminImplTest {
new MetricReceiverWrapper(MetricReceiver.nullImplementation), clock);
@Test
- public void nodeAgentsAreProperlyLifeCycleManaged() throws Exception {
+ public void nodeAgentsAreProperlyLifeCycleManaged() {
final String hostName1 = "host1.test.yahoo.com";
final String hostName2 = "host2.test.yahoo.com";
final ContainerName containerName1 = ContainerName.fromHostname(hostName1);
@@ -98,7 +98,7 @@ public class NodeAdminImplTest {
}
@Test
- public void testSetFrozen() throws Exception {
+ public void testSetFrozen() {
List<NodeAgent> nodeAgents = new ArrayList<>();
List<String> existingContainerHostnames = new ArrayList<>();
for (int i = 0; i < 3; i++) {
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/FileAttributesCacheTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/FileAttributesCacheTest.java
index 9224faf1c6f..06192c9f308 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/FileAttributesCacheTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/FileAttributesCacheTest.java
@@ -17,7 +17,7 @@ import static org.mockito.Mockito.when;
public class FileAttributesCacheTest {
@Test
- public void exists() throws Exception {
+ public void exists() {
UnixPath unixPath = mock(UnixPath.class);
FileAttributesCache cache = new FileAttributesCache(unixPath);
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/FileContentCacheTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/FileContentCacheTest.java
index 677dd048445..83ab5462fb6 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/FileContentCacheTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/FileContentCacheTest.java
@@ -18,7 +18,7 @@ public class FileContentCacheTest {
private final FileContentCache cache = new FileContentCache(unixPath);
@Test
- public void get() throws Exception {
+ public void get() {
when(unixPath.readUtf8File()).thenReturn("content");
assertEquals("content", cache.get(Instant.ofEpochMilli(0)));
verify(unixPath, times(1)).readUtf8File();
@@ -45,7 +45,7 @@ public class FileContentCacheTest {
}
@Test
- public void updateWith() throws Exception {
+ public void updateWith() {
cache.updateWith("content", Instant.ofEpochMilli(2));
assertEquals("content", cache.get(Instant.ofEpochMilli(2)));
verifyNoMoreInteractions(unixPath);
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/TemplateTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/TemplateTest.java
index 7aa672e9e80..cd3a33e54b6 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/TemplateTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/TemplateTest.java
@@ -18,7 +18,7 @@ import static org.mockito.Mockito.mock;
public class TemplateTest {
@Test
- public void basic() throws IOException {
+ public void basic() {
FileSystem fileSystem = TestFileSystem.create();
Path templatePath = fileSystem.getPath("/example.vm");
String templateContent = "a $x, $y b";
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/UnixPathTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/UnixPathTest.java
index 6f1991ec3d4..8d3d336a4ac 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/UnixPathTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/UnixPathTest.java
@@ -20,7 +20,7 @@ public class UnixPathTest {
final FileSystem fileSystem = TestFileSystem.create();
@Test
- public void createParents() throws Exception {
+ public void createParents() {
Path parentDirectory = fileSystem.getPath("/a/b/c");
Path filePath = parentDirectory.resolve("bar");
UnixPath path = new UnixPath(filePath);
@@ -31,7 +31,7 @@ public class UnixPathTest {
}
@Test
- public void utf8File() throws Exception {
+ public void utf8File() {
String original = "foo\nbar\n";
UnixPath path = new UnixPath(fileSystem.getPath("example.txt"));
path.writeUtf8File(original);
@@ -40,7 +40,7 @@ public class UnixPathTest {
}
@Test
- public void permissions() throws Exception {
+ public void permissions() {
String expectedPermissions = "rwxr-x---";
UnixPath path = new UnixPath(fileSystem.getPath("file.txt"));
path.writeUtf8File("foo");
@@ -54,7 +54,7 @@ public class UnixPathTest {
}
@Test
- public void owner() throws Exception {
+ public void owner() {
FileSystem fs = TestFileSystem.create();
Path path = fs.getPath("file.txt");
UnixPath unixPath = new UnixPath(path);
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/systemd/SystemCtlTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/systemd/SystemCtlTest.java
index 085402410b3..315138e897f 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/systemd/SystemCtlTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/systemd/SystemCtlTest.java
@@ -19,7 +19,7 @@ public class SystemCtlTest {
private final TestTerminal terminal = new TestTerminal();
@Test
- public void enable() throws Exception {
+ public void enable() {
terminal.expectCommand(
"systemctl show docker 2>&1",
0,
@@ -33,7 +33,7 @@ public class SystemCtlTest {
}
@Test
- public void enableIsNoop() throws Exception {
+ public void enableIsNoop() {
terminal.expectCommand(
"systemctl show docker 2>&1",
0,
@@ -48,7 +48,7 @@ public class SystemCtlTest {
@Test
- public void enableCommandFailre() throws Exception {
+ public void enableCommandFailre() {
terminal.expectCommand("systemctl show docker 2>&1", 1, "error");
SystemCtl.SystemCtlEnable enableDockerService = new SystemCtl(terminal).enable("docker");
try {
@@ -61,7 +61,7 @@ public class SystemCtlTest {
@Test
- public void start() throws Exception {
+ public void start() {
terminal.expectCommand(
"systemctl show docker 2>&1",
0,
@@ -75,7 +75,7 @@ public class SystemCtlTest {
}
@Test
- public void startIsNoop() throws Exception {
+ public void startIsNoop() {
terminal.expectCommand(
"systemctl show docker 2>&1",
0,
@@ -90,7 +90,7 @@ public class SystemCtlTest {
@Test
- public void startCommandFailre() throws Exception {
+ public void startCommandFailre() {
terminal.expectCommand("systemctl show docker 2>&1", 1, "error");
SystemCtl.SystemCtlStart startDockerService = new SystemCtl(terminal).start("docker");
try {
@@ -103,7 +103,7 @@ public class SystemCtlTest {
@Test
- public void disable() throws Exception {
+ public void disable() {
terminal.expectCommand(
"systemctl show docker 2>&1",
0,
@@ -116,7 +116,7 @@ public class SystemCtlTest {
}
@Test
- public void stop() throws Exception {
+ public void stop() {
terminal.expectCommand(
"systemctl show docker 2>&1",
0,
@@ -129,7 +129,7 @@ public class SystemCtlTest {
}
@Test
- public void restart() throws Exception {
+ public void restart() {
terminal.expectCommand("systemctl restart docker 2>&1", 0, "");
assertTrue(new SystemCtl(terminal).restart("docker").converge(taskContext));
}
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/yum/AddYumRepoTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/yum/AddYumRepoTest.java
index 399759c7c0a..c6314439003 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/yum/AddYumRepoTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/yum/AddYumRepoTest.java
@@ -17,7 +17,7 @@ import static org.mockito.Mockito.mock;
public class AddYumRepoTest {
@Test
- public void converge() throws Exception {
+ public void converge() {
String repositoryId = "repoid";
String name = "name";
String baseurl = "http://foo.com/bar";
diff --git a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollector.java b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollector.java
index c82f4406015..fe09f23d282 100644
--- a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollector.java
+++ b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollector.java
@@ -58,7 +58,7 @@ public class CoreCollector {
return Arrays.asList(result.getSecond().split("\n"));
}
- Path readBinPathFallback(Path coredumpPath) throws IOException, InterruptedException {
+ Path readBinPathFallback(Path coredumpPath) throws IOException {
String command = GDB_PATH + " -n -batch -core " + coredumpPath + " | grep \'^Core was generated by\'";
String[] wrappedCommand = new String[] {"/bin/sh", "-c", command};
Pair<Integer, String> result = processExecuter.exec(wrappedCommand);
@@ -71,7 +71,7 @@ public class CoreCollector {
return Paths.get(matcher.group("path").split(" ")[0]);
}
- Path readBinPath(Path coredumpPath) throws IOException, InterruptedException {
+ Path readBinPath(Path coredumpPath) throws IOException {
String[] command = new String[] {"file", coredumpPath.toString()};
try {
Pair<Integer, String> result = processExecuter.exec(command);
@@ -97,7 +97,7 @@ public class CoreCollector {
return readBinPathFallback(coredumpPath);
}
- List<String> readBacktrace(Path coredumpPath, Path binPath, boolean allThreads) throws IOException, InterruptedException {
+ List<String> readBacktrace(Path coredumpPath, Path binPath, boolean allThreads) throws IOException {
String threads = allThreads ? "thread apply all bt" : "bt";
String[] command = new String[]{GDB_PATH, "-n", "-ex", threads, "-batch", binPath.toString(), coredumpPath.toString()};
Pair<Integer, String> result = processExecuter.exec(command);
@@ -111,7 +111,7 @@ public class CoreCollector {
Map<String, Object> data = new LinkedHashMap<>();
try {
coredumpPath = compressCoredump(coredumpPath);
- } catch (IOException | InterruptedException e) {
+ } catch (IOException e) {
logger.log(Level.WARNING, "Failed compressing/decompressing core dump", e);
}
@@ -154,7 +154,7 @@ public class CoreCollector {
*
* @return Path to the decompressed core dump
*/
- private Path compressCoredump(Path coredumpPath) throws IOException, InterruptedException {
+ private Path compressCoredump(Path coredumpPath) throws IOException {
if (! coredumpPath.toString().endsWith(".lz4")) {
processExecuter.exec(
new String[]{LZ4_PATH, coredumpPath.toString(), coredumpPath.toString() + ".lz4"});
diff --git a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollectorTest.java b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollectorTest.java
index 4b58c16bdc3..b32f6d076a7 100644
--- a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollectorTest.java
+++ b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollectorTest.java
@@ -53,18 +53,18 @@ public class CoreCollectorTest {
@Rule
public TemporaryFolder folder= new TemporaryFolder();
- private void mockExec(String[] cmd, String output) throws IOException, InterruptedException {
+ private void mockExec(String[] cmd, String output) throws IOException {
mockExec(cmd, output, "");
}
- private void mockExec(String[] cmd, String output, String error) throws IOException, InterruptedException {
+ private void mockExec(String[] cmd, String output, String error) throws IOException {
when(processExecuter.exec(cmd)).thenReturn(new Pair<>(error.isEmpty() ? 0 : 1, output + error));
}
static final String GDB_PATH = getDefaults().underVespaHome("bin64/gdb");
@Test
- public void extractsBinaryPathTest() throws IOException, InterruptedException {
+ public void extractsBinaryPathTest() throws IOException {
final String[] cmd = {"file", TEST_CORE_PATH.toString()};
mockExec(cmd,
@@ -101,7 +101,7 @@ public class CoreCollectorTest {
}
@Test
- public void extractsBinaryPathUsingGdbTest() throws IOException, InterruptedException {
+ public void extractsBinaryPathUsingGdbTest() throws IOException {
final String[] cmd = new String[]{"/bin/sh", "-c",
GDB_PATH + " -n -batch -core /tmp/core.1234 | grep '^Core was generated by'"};
@@ -119,7 +119,7 @@ public class CoreCollectorTest {
}
@Test
- public void extractsBacktraceUsingGdb() throws IOException, InterruptedException {
+ public void extractsBacktraceUsingGdb() throws IOException {
mockExec(new String[]{GDB_PATH, "-n", "-ex", "bt", "-batch", "/usr/bin/program", "/tmp/core.1234"},
String.join("\n", GDB_BACKTRACE));
assertEquals(GDB_BACKTRACE, coreCollector.readBacktrace(TEST_CORE_PATH, TEST_BIN_PATH, false));
@@ -136,7 +136,7 @@ public class CoreCollectorTest {
}
@Test
- public void extractsBacktraceFromAllThreadsUsingGdb() throws IOException, InterruptedException {
+ public void extractsBacktraceFromAllThreadsUsingGdb() throws IOException {
mockExec(new String[]{GDB_PATH, "-n", "-ex", "thread apply all bt", "-batch",
"/usr/bin/program", "/tmp/core.1234"},
String.join("\n", GDB_BACKTRACE));
@@ -144,7 +144,7 @@ public class CoreCollectorTest {
}
@Test
- public void collectsDataTest() throws IOException, InterruptedException {
+ public void collectsDataTest() throws IOException {
mockExec(new String[]{"file", TEST_CORE_PATH.toString()},
"/tmp/core.1234: ELF 64-bit LSB core file x86-64, version 1 (SYSV), SVR4-style, from " +
"'/usr/bin/program'");
@@ -166,7 +166,7 @@ public class CoreCollectorTest {
}
@Test
- public void collectsPartialIfUnableToDetermineDumpingProgramTest() throws IOException, InterruptedException {
+ public void collectsPartialIfUnableToDetermineDumpingProgramTest() throws IOException {
// We fail to get backtrace and RPM packages, but install state works, make sure it is returned
mockExec(new String[]{"cat", INSTALL_STATE_PATH.toString()}, String.join("\n", INSTALL_STATE));
@@ -176,7 +176,7 @@ public class CoreCollectorTest {
}
@Test
- public void collectsPartialIfBacktraceFailsTest() throws IOException, InterruptedException {
+ public void collectsPartialIfBacktraceFailsTest() throws IOException {
mockExec(new String[]{"file", TEST_CORE_PATH.toString()},
"/tmp/core.1234: ELF 64-bit LSB core file x86-64, version 1 (SYSV), SVR4-style, from " +
"'/usr/bin/program'");
@@ -189,7 +189,7 @@ public class CoreCollectorTest {
}
@Test
- public void parseTotalMemoryTestTest() throws IOException {
+ public void parseTotalMemoryTestTest() {
String memInfo = "MemTotal: 100000000 kB\nMemUsed: 1000000 kB\n";
assertEquals(100000000, coreCollector.parseTotalMemorySize(memInfo));
diff --git a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/CoredumpHandlerTest.java b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/CoredumpHandlerTest.java
index 2cc96567e20..4a5fddf984e 100644
--- a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/CoredumpHandlerTest.java
+++ b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/CoredumpHandlerTest.java
@@ -141,7 +141,7 @@ public class CoredumpHandlerTest {
}
@Test
- public void coredumpMetadataCollectAndWriteTest() throws IOException, InterruptedException {
+ public void coredumpMetadataCollectAndWriteTest() throws IOException {
createCoredump("core.dump", Instant.now());
Path processingPath = coredumpHandler.enqueueCoredumps();
Path processingCoredumpPath = Files.list(processingPath).findFirst().orElseThrow(() ->
@@ -157,7 +157,7 @@ public class CoredumpHandlerTest {
}
@Test
- public void coredumpMetadataReadIfExistsTest() throws IOException, InterruptedException {
+ public void coredumpMetadataReadIfExistsTest() throws IOException {
final String documentId = "UIDD-ABCD-EFGH";
Path metadataPath = createProcessedCoredump(documentId);
@@ -167,7 +167,7 @@ public class CoredumpHandlerTest {
}
@Test
- public void reportSuccessCoredumpTest() throws IOException, URISyntaxException, InterruptedException {
+ public void reportSuccessCoredumpTest() throws IOException, URISyntaxException {
final String documentId = "UIDD-ABCD-EFGH";
Path coredumpPath = createProcessedCoredump(documentId);
diff --git a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/FileHelperTest.java b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/FileHelperTest.java
index 4bbfe3e5b25..eefdcf4adad 100644
--- a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/FileHelperTest.java
+++ b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/FileHelperTest.java
@@ -125,7 +125,7 @@ public class FileHelperTest {
}
@Test
- public void testGetContentsOfNonExistingDirectory() throws IOException {
+ public void testGetContentsOfNonExistingDirectory() {
Path fakePath = Paths.get("/some/made/up/dir/");
assertEquals(Collections.emptyList(), FileHelper.listContentsOfDirectory(fakePath));
}
diff --git a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/commons/noderepo/IPAddressVerifierTest.java b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/commons/noderepo/IPAddressVerifierTest.java
index fc846e3eba6..5762975ec9b 100644
--- a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/commons/noderepo/IPAddressVerifierTest.java
+++ b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/commons/noderepo/IPAddressVerifierTest.java
@@ -25,7 +25,7 @@ public class IPAddressVerifierTest {
private String ipv6LookupFormat;
@Before
- public void setup() throws Exception {
+ public void setup() {
ipv4LookupFormat = "8.4.2.10.in-addr.arpa";
ipv6LookupFormat = "4.3.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.b.a.d.f.ip6.arpa";
}
diff --git a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/hardware/benchmarks/CPUBenchmarkTest.java b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/hardware/benchmarks/CPUBenchmarkTest.java
index 04e9057b44e..70fab6eecb1 100644
--- a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/hardware/benchmarks/CPUBenchmarkTest.java
+++ b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/hardware/benchmarks/CPUBenchmarkTest.java
@@ -68,7 +68,7 @@ public class CPUBenchmarkTest {
}
@Test
- public void test_if_setCpuCyclesPerSec_reads_output_correctly() throws IOException {
+ public void test_if_setCpuCyclesPerSec_reads_output_correctly() {
List<ParseResult> parseResults = new ArrayList<>();
parseResults.add(new ParseResult("cycles", "2.066.201.729"));
parseResults.add(new ParseResult("seconds", "0,957617512"));
diff --git a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/CPURetrieverTest.java b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/CPURetrieverTest.java
index d878d6614f7..0cf6bb0907b 100644
--- a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/CPURetrieverTest.java
+++ b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/CPURetrieverTest.java
@@ -33,7 +33,7 @@ public class CPURetrieverTest {
}
@Test
- public void updateInfo_should_write_numOfCpuCores_to_hardware_info() throws Exception {
+ public void updateInfo_should_write_numOfCpuCores_to_hardware_info() {
commandExecutor.addCommand("cat " + FILENAME);
cpu.updateInfo();
double expectedAmountOfCores = 4;
diff --git a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/DiskRetrieverTest.java b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/DiskRetrieverTest.java
index 220d89f3be9..a72cca1c72a 100644
--- a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/DiskRetrieverTest.java
+++ b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/DiskRetrieverTest.java
@@ -44,14 +44,14 @@ public class DiskRetrieverTest {
}
@Test
- public void updateDiskType__should_store_diskType_in_hardwareInfo() throws IOException {
+ public void updateDiskType__should_store_diskType_in_hardwareInfo() {
commandExecutor.addCommand(CAT_RESOURCE_PATH + "DiskTypeFastDisk");
diskRetriever.updateDiskType();
assertEquals(DiskType.FAST, hardwareInfo.getDiskType());
}
@Test
- public void updateDiskSize__should_store_diskSize_in_hardwareInfo() throws IOException {
+ public void updateDiskSize__should_store_diskSize_in_hardwareInfo() {
commandExecutor.addCommand(CAT_RESOURCE_PATH + "filesize");
diskRetriever.updateDiskSize();
double expectedSize = 1760.0;
@@ -76,7 +76,7 @@ public class DiskRetrieverTest {
}
@Test
- public void parseDiskType_with_invalid_outputstream_does_not_contain_searchword_should_throw_exception() throws Exception {
+ public void parseDiskType_with_invalid_outputstream_does_not_contain_searchword_should_throw_exception() {
List<String> mockOutput = commandExecutor.outputFromString("Name Rota");
try {
diskRetriever.parseDiskType(mockOutput);
diff --git a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/MemoryRetrieverTest.java b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/MemoryRetrieverTest.java
index 6b0b5f6d24a..1722abdc7b8 100644
--- a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/MemoryRetrieverTest.java
+++ b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/MemoryRetrieverTest.java
@@ -32,7 +32,7 @@ public class MemoryRetrieverTest {
}
@Test
- public void updateInfo_should_set_memory_available_in_hardwareInfo() throws IOException {
+ public void updateInfo_should_set_memory_available_in_hardwareInfo() {
commandExecutor.addCommand("cat " + FILENAME);
memory.updateInfo();
double expectedMemory = 4.042128;
diff --git a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/NetRetrieverTest.java b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/NetRetrieverTest.java
index eb9f122b726..dad73a9bb90 100644
--- a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/NetRetrieverTest.java
+++ b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/retrievers/NetRetrieverTest.java
@@ -62,7 +62,7 @@ public class NetRetrieverTest {
}
@Test
- public void findInterfaceSpeed_valid_input() throws IOException {
+ public void findInterfaceSpeed_valid_input() {
commandExecutor.addCommand("cat " + NET_FIND_INTERFACE);
commandExecutor.addCommand("cat " + NET_CHECK_INTERFACE_SPEED);
parseResults = net.findInterface();