From 498e035c60ba718c98c4b6005efe7283175dfc7c Mon Sep 17 00:00:00 2001 From: huangguojie2024 <503601315@qq.com> Date: Fri, 7 Feb 2025 17:32:03 +0800 Subject: [PATCH 1/5] Add some unit tests for stack bigtop module. --- .../v3_3_0/flink/FlinkClientScriptTest.java | 51 +++++++++++++++++ .../flink/FlinkHistoryServerScriptTest.java | 33 +++++++++++ .../bigtop/v3_3_0/flink/FlinkParamsTest.java | 56 +++++++++++++++++++ .../v3_3_0/hadoop/DataNodeScriptTest.java | 32 +++++++++++ .../v3_3_0/hadoop/HadoopClientScriptTest.java | 47 ++++++++++++++++ .../v3_3_0/hadoop/HadoopParamsTest.java | 54 ++++++++++++++++++ .../hadoop/HistoryServerScriptTest.java | 32 +++++++++++ .../v3_3_0/hadoop/NameNodeScriptTest.java | 32 +++++++++++ .../v3_3_0/hadoop/NodeManagerScriptTest.java | 32 +++++++++++ .../hadoop/ResourceManagerScriptTest.java | 32 +++++++++++ .../v3_3_0/hadoop/SNameNodeScriptTest.java | 32 +++++++++++ .../v3_3_0/hbase/HBaseClientScriptTest.java | 47 ++++++++++++++++ .../bigtop/v3_3_0/hbase/HBaseParamsTest.java | 32 +++++++++++ .../v3_3_0/hbase/HMasterScriptTest.java | 32 +++++++++++ .../v3_3_0/hbase/HRegionServerScriptTest.java | 32 +++++++++++ .../v3_3_0/hive/HiveClientScriptTest.java | 47 ++++++++++++++++ .../v3_3_0/hive/HiveMetastoreScriptTest.java | 32 +++++++++++ .../bigtop/v3_3_0/hive/HiveParamsTest.java | 43 ++++++++++++++ .../v3_3_0/hive/HiveServer2ScriptTest.java | 32 +++++++++++ .../v3_3_0/kafka/KafkaBrokerScriptTest.java | 32 +++++++++++ .../bigtop/v3_3_0/kafka/KafkaParamsTest.java | 43 ++++++++++++++ .../v3_3_0/solr/SolrInstanceScriptTest.java | 32 +++++++++++ .../bigtop/v3_3_0/solr/SolrParamsTest.java | 43 ++++++++++++++ .../v3_3_0/spark/SparkClientScriptTest.java | 33 +++++++++++ .../spark/SparkHistoryServerScriptTest.java | 32 +++++++++++ .../bigtop/v3_3_0/spark/SparkParamsTest.java | 52 +++++++++++++++++ .../spark/SparkThriftServerScriptTest.java | 32 +++++++++++ .../v3_3_0/tez/TezClientScriptTest.java | 51 +++++++++++++++++ .../bigtop/v3_3_0/tez/TezParamsTest.java | 52 +++++++++++++++++ .../zookeeper/ZookeeperClientScriptTest.java | 51 +++++++++++++++++ .../v3_3_0/zookeeper/ZookeeperParamsTest.java | 32 +++++++++++ .../zookeeper/ZookeeperServerScriptTest.java | 32 +++++++++++ 32 files changed, 1247 insertions(+) create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkClientScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkParamsTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/DataNodeScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopClientScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParamsTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HistoryServerScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NameNodeScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NodeManagerScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/ResourceManagerScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/SNameNodeScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseClientScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseParamsTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveClientScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveMetastoreScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveParamsTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveServer2ScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaBrokerScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaParamsTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrInstanceScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrParamsTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkClientScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkHistoryServerScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkParamsTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkThriftServerScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/tez/TezClientScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/tez/TezParamsTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperClientScriptTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperParamsTest.java create mode 100644 bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperServerScriptTest.java diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkClientScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkClientScriptTest.java new file mode 100644 index 000000000..38c263111 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkClientScriptTest.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.flink; + +import org.apache.bigtop.manager.stack.core.spi.param.Params; + +import org.junit.jupiter.api.Test; + +import lombok.extern.slf4j.Slf4j; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +@Slf4j +public class FlinkClientScriptTest { + + private final FlinkClientScript flinkClientScript = new FlinkClientScript(); + + @Test + public void testGetComponentName() { + assertEquals("flink_client", flinkClientScript.getComponentName()); + } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> flinkClientScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> flinkClientScript.configure(params)); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java new file mode 100644 index 000000000..53e2e0dff --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.flink; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class FlinkHistoryServerScriptTest { + + private FlinkHistoryServerScript script = new FlinkHistoryServerScript(); + + @Test + void testGetComponentName() { + assertEquals("flink_historyserver", script.getComponentName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkParamsTest.java new file mode 100644 index 000000000..869fd3f6c --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkParamsTest.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.flink; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class FlinkParamsTest { + + @Test + public void testHadoopConfDir() { + FlinkParams flinkParams = mock(FlinkParams.class); + when(flinkParams.stackHome()).thenReturn("/usr/local"); + when(flinkParams.hadoopHome()).thenCallRealMethod(); + when(flinkParams.hadoopConfDir()).thenCallRealMethod(); + + String expected = "/usr/local/hadoop/etc/hadoop"; + assertEquals(expected, flinkParams.hadoopConfDir()); + } + + @Test + public void testHadoopHome() { + FlinkParams flinkParams = mock(FlinkParams.class); + when(flinkParams.stackHome()).thenReturn("/usr/local"); + when(flinkParams.hadoopHome()).thenCallRealMethod(); + + String expected = "/usr/local/hadoop"; + assertEquals(expected, flinkParams.hadoopHome()); + } + + @Test + public void testGetServiceName() { + FlinkParams flinkParams = new FlinkParams(); + String expected = "flink"; + assertEquals(expected, flinkParams.getServiceName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/DataNodeScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/DataNodeScriptTest.java new file mode 100644 index 000000000..6b4ee756a --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/DataNodeScriptTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class DataNodeScriptTest { + + @Test + public void testGetComponentName() { + DataNodeScript dataNodeScript = new DataNodeScript(); + assertEquals("datanode", dataNodeScript.getComponentName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopClientScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopClientScriptTest.java new file mode 100644 index 000000000..c1c03f0b5 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopClientScriptTest.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop; + +import org.junit.jupiter.api.Test; + +import lombok.extern.slf4j.Slf4j; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +@Slf4j +public class HadoopClientScriptTest { + + private final HadoopClientScript hadoopClientScript = new HadoopClientScript(); + + @Test + public void testGetComponentName() { + assertEquals("hadoop_client", hadoopClientScript.getComponentName()); + } + + @Test + public void testAddParamsNull() { + assertThrows(NullPointerException.class, () -> hadoopClientScript.add(null)); + } + + @Test + public void testConfigureParamsNull() { + assertThrows(NullPointerException.class, () -> hadoopClientScript.configure(null)); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParamsTest.java new file mode 100644 index 000000000..123af97ef --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParamsTest.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class HadoopParamsTest { + + private HadoopParams hadoopParams; + + @BeforeEach + public void setUp() { + hadoopParams = new HadoopParams() { + @Override + public String serviceHome() { + return "/path/to/service"; + } + }; + } + + @Test + public void testConfDir() { + assertEquals("/path/to/service/etc/hadoop", hadoopParams.confDir()); + } + + @Test + public void testBinDir() { + assertEquals("/path/to/service/bin", hadoopParams.binDir()); + } + + @Test + public void testGetServiceName() { + assertEquals("hadoop", hadoopParams.getServiceName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HistoryServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HistoryServerScriptTest.java new file mode 100644 index 000000000..acefb79e0 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HistoryServerScriptTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class HistoryServerScriptTest { + + @Test + public void testGetComponentName() { + HistoryServerScript historyServerScript = new HistoryServerScript(); + assertEquals("history_server", historyServerScript.getComponentName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NameNodeScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NameNodeScriptTest.java new file mode 100644 index 000000000..28704b6b0 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NameNodeScriptTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class NameNodeScriptTest { + + @Test + public void testGetComponentName() { + NameNodeScript nameNodeScript = new NameNodeScript(); + assertEquals("namenode", nameNodeScript.getComponentName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NodeManagerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NodeManagerScriptTest.java new file mode 100644 index 000000000..9163cdfc7 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NodeManagerScriptTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class NodeManagerScriptTest { + + @Test + public void testGetComponentName() { + NodeManagerScript nodeManagerScript = new NodeManagerScript(); + assertEquals("nodemanager", nodeManagerScript.getComponentName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/ResourceManagerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/ResourceManagerScriptTest.java new file mode 100644 index 000000000..0d93c06d4 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/ResourceManagerScriptTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class ResourceManagerScriptTest { + + @Test + public void testGetComponentName() { + ResourceManagerScript resourceManagerScript = new ResourceManagerScript(); + assertEquals("resourcemanager", resourceManagerScript.getComponentName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/SNameNodeScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/SNameNodeScriptTest.java new file mode 100644 index 000000000..5589c1e8b --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/SNameNodeScriptTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class SNameNodeScriptTest { + + @Test + public void testGetComponentName() { + SNameNodeScript sNameNodeScript = new SNameNodeScript(); + assertEquals("secondarynamenode", sNameNodeScript.getComponentName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseClientScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseClientScriptTest.java new file mode 100644 index 000000000..d2bbed2b1 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseClientScriptTest.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hbase; + +import org.junit.jupiter.api.Test; + +import lombok.extern.slf4j.Slf4j; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +@Slf4j +public class HBaseClientScriptTest { + + private final HBaseClientScript hBaseClientScript = new HBaseClientScript(); + + @Test + public void testGetComponentName() { + assertEquals("hbase_client", hBaseClientScript.getComponentName()); + } + + @Test + public void testAddParamsNull() { + assertThrows(NullPointerException.class, () -> hBaseClientScript.add(null)); + } + + @Test + public void testConfigureParamsNull() { + assertThrows(NullPointerException.class, () -> hBaseClientScript.configure(null)); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseParamsTest.java new file mode 100644 index 000000000..f3cc70aed --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseParamsTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hbase; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class HBaseParamsTest { + + @Test + public void testGetServiceName() { + HBaseParams hBaseParams = new HBaseParams(); + assertEquals("hbase", hBaseParams.getServiceName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScriptTest.java new file mode 100644 index 000000000..22efaab5b --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScriptTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hbase; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class HMasterScriptTest { + + @Test + public void testGetComponentName() { + HMasterScript hMasterScript = new HMasterScript(); + assertEquals("hbase_master", hMasterScript.getComponentName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScriptTest.java new file mode 100644 index 000000000..9ad8ac4e6 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScriptTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hbase; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class HRegionServerScriptTest { + + @Test + public void testGetComponentName() { + HRegionServerScript hRegionServerScript = new HRegionServerScript(); + assertEquals("hbase_regionserver", hRegionServerScript.getComponentName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveClientScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveClientScriptTest.java new file mode 100644 index 000000000..7ccc9c0c5 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveClientScriptTest.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hive; + +import org.junit.jupiter.api.Test; + +import lombok.extern.slf4j.Slf4j; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +@Slf4j +public class HiveClientScriptTest { + + private final HiveClientScript hiveClientScript = new HiveClientScript(); + + @Test + public void testGetComponentName() { + assertEquals("hive_client", hiveClientScript.getComponentName()); + } + + @Test + public void testAddParamsNull() { + assertThrows(NullPointerException.class, () -> hiveClientScript.add(null)); + } + + @Test + public void testConfigureParamsNull() { + assertThrows(NullPointerException.class, () -> hiveClientScript.configure(null)); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveMetastoreScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveMetastoreScriptTest.java new file mode 100644 index 000000000..d5bf374c4 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveMetastoreScriptTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hive; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class HiveMetastoreScriptTest { + + @Test + public void testGetComponentName() { + HiveMetastoreScript hiveMetastoreScript = new HiveMetastoreScript(); + assertEquals("hive_metastore", hiveMetastoreScript.getComponentName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveParamsTest.java new file mode 100644 index 000000000..0cbb8a6a2 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveParamsTest.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hive; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class HiveParamsTest { + + private final HiveParams hiveParams = new HiveParams() { + @Override + public String stackHome() { + return "/stack"; + } + }; + + @Test + public void testHadoopHome() { + assertEquals("/stack/hadoop", hiveParams.hadoopHome()); + } + + @Test + public void testGetServiceName() { + assertEquals("hive", hiveParams.getServiceName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveServer2ScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveServer2ScriptTest.java new file mode 100644 index 000000000..db9c9963c --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveServer2ScriptTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hive; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class HiveServer2ScriptTest { + + @Test + public void testGetComponentName() { + HiveServer2Script hiveServer2Script = new HiveServer2Script(); + assertEquals("hiveserver2", hiveServer2Script.getComponentName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaBrokerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaBrokerScriptTest.java new file mode 100644 index 000000000..95db6f9e1 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaBrokerScriptTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.kafka; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class KafkaBrokerScriptTest { + + @Test + public void testGetComponentName() { + KafkaBrokerScript kafkaBrokerScript = new KafkaBrokerScript(); + assertEquals("kafka_broker", kafkaBrokerScript.getComponentName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaParamsTest.java new file mode 100644 index 000000000..bfefc980a --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaParamsTest.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.kafka; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class KafkaParamsTest { + + private final KafkaParams kafkaParams = new KafkaParams() { + @Override + public String serviceHome() { + return "/confDir"; + } + }; + + @Test + public void testConfDir() { + assertEquals("/confDir/config", kafkaParams.confDir()); + } + + @Test + public void testGetServiceName() { + assertEquals("kafka", kafkaParams.getServiceName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrInstanceScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrInstanceScriptTest.java new file mode 100644 index 000000000..382f35c78 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrInstanceScriptTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.solr; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class SolrInstanceScriptTest { + + @Test + public void testGetComponentName() { + SolrInstanceScript solrInstanceScript = new SolrInstanceScript(); + assertEquals("solr_instance", solrInstanceScript.getComponentName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrParamsTest.java new file mode 100644 index 000000000..bb13bcd27 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrParamsTest.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.solr; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class SolrParamsTest { + + private final SolrParams kafkaParams = new SolrParams() { + @Override + public String serviceHome() { + return "/confDir"; + } + }; + + @Test + public void testConfDir() { + assertEquals("/confDir/server/solr", kafkaParams.confDir()); + } + + @Test + public void testGetServiceName() { + assertEquals("solr", kafkaParams.getServiceName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkClientScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkClientScriptTest.java new file mode 100644 index 000000000..4a4e3c659 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkClientScriptTest.java @@ -0,0 +1,33 @@ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.spark; + +import org.apache.bigtop.manager.stack.core.spi.param.Params; + +import org.junit.jupiter.api.Test; + +import lombok.extern.slf4j.Slf4j; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +@Slf4j +public class SparkClientScriptTest { + + private final SparkClientScript sparkClientScript = new SparkClientScript(); + + @Test + public void testGetComponentName() { + assertEquals("spark_client", sparkClientScript.getComponentName()); + } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sparkClientScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sparkClientScript.configure(params)); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkHistoryServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkHistoryServerScriptTest.java new file mode 100644 index 000000000..b5f489f12 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkHistoryServerScriptTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.spark; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class SparkHistoryServerScriptTest { + + @Test + public void testGetComponentName() { + SparkHistoryServerScript script = new SparkHistoryServerScript(); + assertEquals("spark_historyserver", script.getComponentName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkParamsTest.java new file mode 100644 index 000000000..1f4a431fa --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkParamsTest.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.spark; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class SparkParamsTest { + + @Test + public void testHadoopConfDir() { + SparkParams params = mock(SparkParams.class); + when(params.stackHome()).thenReturn("/opt/stack"); + when(params.hadoopHome()).thenCallRealMethod(); + when(params.hadoopConfDir()).thenCallRealMethod(); + assertEquals("/opt/stack/hadoop/etc/hadoop", params.hadoopConfDir()); + } + + @Test + public void testHiveConfDir() { + SparkParams params = mock(SparkParams.class); + when(params.stackHome()).thenReturn("/opt/stack"); + when(params.hiveHome()).thenCallRealMethod(); + when(params.hiveConfDir()).thenCallRealMethod(); + assertEquals("/opt/stack/hive/conf", params.hiveConfDir()); + } + + @Test + public void testGetServiceName() { + SparkParams params = new SparkParams(); + assertEquals("spark", params.getServiceName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkThriftServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkThriftServerScriptTest.java new file mode 100644 index 000000000..51c4491ee --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkThriftServerScriptTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.spark; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class SparkThriftServerScriptTest { + + @Test + public void testGetComponentName() { + SparkThriftServerScript serverScript = new SparkThriftServerScript(); + assertEquals("spark_thriftserver", serverScript.getComponentName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/tez/TezClientScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/tez/TezClientScriptTest.java new file mode 100644 index 000000000..68103ca0e --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/tez/TezClientScriptTest.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.tez; + +import org.apache.bigtop.manager.stack.core.spi.param.Params; + +import org.junit.jupiter.api.Test; + +import lombok.extern.slf4j.Slf4j; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +@Slf4j +public class TezClientScriptTest { + + private final TezClientScript tezClientScript = new TezClientScript(); + + @Test + public void testGetComponentName() { + assertEquals("tez_client", tezClientScript.getComponentName()); + } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> tezClientScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> tezClientScript.configure(params)); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/tez/TezParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/tez/TezParamsTest.java new file mode 100644 index 000000000..c92697a5b --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/tez/TezParamsTest.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.tez; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class TezParamsTest { + + @Test + public void testHadoopHome() { + TezParams tezParams = mock(TezParams.class); + when(tezParams.stackHome()).thenReturn("/stack"); + when(tezParams.hadoopHome()).thenCallRealMethod(); + when(tezParams.hadoopConfDir()).thenCallRealMethod(); + assertEquals("/stack/hadoop", tezParams.hadoopHome()); + } + + @Test + public void testHadoopConfDir() { + TezParams tezParams = mock(TezParams.class); + when(tezParams.stackHome()).thenReturn("/stack"); + when(tezParams.hadoopHome()).thenCallRealMethod(); + when(tezParams.hadoopConfDir()).thenCallRealMethod(); + assertEquals("/stack/hadoop/etc/hadoop", tezParams.hadoopConfDir()); + } + + @Test + public void testGetServiceName() { + TezParams tezParams = new TezParams(); + assertEquals("tez", tezParams.getServiceName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperClientScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperClientScriptTest.java new file mode 100644 index 000000000..1fafea2f8 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperClientScriptTest.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.zookeeper; + +import org.apache.bigtop.manager.stack.core.spi.param.Params; + +import org.junit.jupiter.api.Test; + +import lombok.extern.slf4j.Slf4j; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +@Slf4j +public class ZookeeperClientScriptTest { + + private final ZookeeperClientScript zookeeperClientScript = new ZookeeperClientScript(); + + @Test + public void testGetComponentName() { + assertEquals("zookeeper_client", zookeeperClientScript.getComponentName()); + } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> zookeeperClientScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> zookeeperClientScript.configure(params)); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperParamsTest.java new file mode 100644 index 000000000..287c921bc --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperParamsTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.zookeeper; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class ZookeeperParamsTest { + + @Test + public void testGetServiceName() { + ZookeeperParams zookeeperParams = new ZookeeperParams(); + assertEquals("zookeeper", zookeeperParams.getServiceName()); + } +} diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperServerScriptTest.java new file mode 100644 index 000000000..c91848216 --- /dev/null +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperServerScriptTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.bigtop.manager.stack.bigtop.v3_3_0.zookeeper; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class ZookeeperServerScriptTest { + + @Test + public void testGetComponentName() { + ZookeeperServerScript zookeeperServerScript = new ZookeeperServerScript(); + assertEquals("zookeeper_server", zookeeperServerScript.getComponentName()); + } +} From f8c4cf2a992816abd26bd97430ea599a81c21111 Mon Sep 17 00:00:00 2001 From: huangguojie2024 <503601315@qq.com> Date: Fri, 7 Feb 2025 17:43:50 +0800 Subject: [PATCH 2/5] Add license header. --- .../v3_3_0/spark/SparkClientScriptTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkClientScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkClientScriptTest.java index 4a4e3c659..53c9a44cf 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkClientScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkClientScriptTest.java @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.spark; import org.apache.bigtop.manager.stack.core.spi.param.Params; From 07ce789ab296ad6f5ab8b9b9ed344c9ae14efad4 Mon Sep 17 00:00:00 2001 From: huangguojie2024 <503601315@qq.com> Date: Mon, 10 Feb 2025 14:02:41 +0800 Subject: [PATCH 3/5] Fix the code style. --- .../flink/FlinkHistoryServerScriptTest.java | 2 +- .../bigtop/v3_3_0/flink/FlinkParamsTest.java | 41 +++++++++------ .../v3_3_0/hadoop/HadoopParamsTest.java | 23 ++++++--- .../bigtop/v3_3_0/hbase/HBaseParamsTest.java | 25 ++++++++- .../bigtop/v3_3_0/hive/HiveParamsTest.java | 30 ++++++++--- .../bigtop/v3_3_0/kafka/KafkaParamsTest.java | 26 +++++++--- .../bigtop/v3_3_0/solr/SolrParamsTest.java | 28 +++++++--- .../bigtop/v3_3_0/spark/SparkParamsTest.java | 51 ++++++++++++++----- .../bigtop/v3_3_0/tez/TezParamsTest.java | 35 +++++++++---- .../v3_3_0/zookeeper/ZookeeperParamsTest.java | 25 ++++++++- 10 files changed, 217 insertions(+), 69 deletions(-) diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java index 53e2e0dff..e304bc0d0 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java @@ -24,7 +24,7 @@ class FlinkHistoryServerScriptTest { - private FlinkHistoryServerScript script = new FlinkHistoryServerScript(); + private final FlinkHistoryServerScript script = new FlinkHistoryServerScript(); @Test void testGetComponentName() { diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkParamsTest.java index 869fd3f6c..6d2bd9bb5 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkParamsTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkParamsTest.java @@ -18,6 +18,7 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.flink; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -26,31 +27,41 @@ public class FlinkParamsTest { - @Test - public void testHadoopConfDir() { - FlinkParams flinkParams = mock(FlinkParams.class); - when(flinkParams.stackHome()).thenReturn("/usr/local"); + private FlinkParams flinkParams; + + @BeforeEach + public void setUp() { + flinkParams = mock(FlinkParams.class); + when(flinkParams.stackHome()).thenReturn("/stack"); + when(flinkParams.getServiceName()).thenCallRealMethod(); + when(flinkParams.serviceHome()).thenCallRealMethod(); when(flinkParams.hadoopHome()).thenCallRealMethod(); when(flinkParams.hadoopConfDir()).thenCallRealMethod(); + when(flinkParams.confDir()).thenCallRealMethod(); + } - String expected = "/usr/local/hadoop/etc/hadoop"; - assertEquals(expected, flinkParams.hadoopConfDir()); + @Test + public void testServiceHome() { + assertEquals("/stack/flink", flinkParams.serviceHome()); } @Test - public void testHadoopHome() { - FlinkParams flinkParams = mock(FlinkParams.class); - when(flinkParams.stackHome()).thenReturn("/usr/local"); - when(flinkParams.hadoopHome()).thenCallRealMethod(); + public void testConfDir() { + assertEquals("/stack/flink/conf", flinkParams.confDir()); + } - String expected = "/usr/local/hadoop"; - assertEquals(expected, flinkParams.hadoopHome()); + @Test + public void testHadoopConfDir() { + assertEquals("/stack/hadoop/etc/hadoop", flinkParams.hadoopConfDir()); + } + + @Test + public void testHadoopHome() { + assertEquals("/stack/hadoop", flinkParams.hadoopHome()); } @Test public void testGetServiceName() { - FlinkParams flinkParams = new FlinkParams(); - String expected = "flink"; - assertEquals(expected, flinkParams.getServiceName()); + assertEquals("flink", flinkParams.getServiceName()); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParamsTest.java index 123af97ef..0b413483e 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParamsTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParamsTest.java @@ -22,6 +22,8 @@ import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; public class HadoopParamsTest { @@ -29,22 +31,27 @@ public class HadoopParamsTest { @BeforeEach public void setUp() { - hadoopParams = new HadoopParams() { - @Override - public String serviceHome() { - return "/path/to/service"; - } - }; + hadoopParams = mock(HadoopParams.class); + when(hadoopParams.stackHome()).thenReturn("/stack"); + when(hadoopParams.getServiceName()).thenCallRealMethod(); + when(hadoopParams.serviceHome()).thenCallRealMethod(); + when(hadoopParams.confDir()).thenCallRealMethod(); + when(hadoopParams.binDir()).thenCallRealMethod(); + } + + @Test + public void testServiceHome() { + assertEquals("/stack/hadoop", hadoopParams.serviceHome()); } @Test public void testConfDir() { - assertEquals("/path/to/service/etc/hadoop", hadoopParams.confDir()); + assertEquals("/stack/hadoop/etc/hadoop", hadoopParams.confDir()); } @Test public void testBinDir() { - assertEquals("/path/to/service/bin", hadoopParams.binDir()); + assertEquals("/stack/hadoop/bin", hadoopParams.binDir()); } @Test diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseParamsTest.java index f3cc70aed..78a7ae061 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseParamsTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseParamsTest.java @@ -18,15 +18,38 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hbase; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; public class HBaseParamsTest { + private HBaseParams hBaseParams; + + @BeforeEach + public void setUp() { + hBaseParams = mock(HBaseParams.class); + when(hBaseParams.stackHome()).thenReturn("/stack"); + when(hBaseParams.getServiceName()).thenCallRealMethod(); + when(hBaseParams.serviceHome()).thenCallRealMethod(); + when(hBaseParams.confDir()).thenCallRealMethod(); + } + + @Test + public void testServiceHome() { + assertEquals("/stack/hbase", hBaseParams.serviceHome()); + } + + @Test + public void testConfDir() { + assertEquals("/stack/hbase/conf", hBaseParams.confDir()); + } + @Test public void testGetServiceName() { - HBaseParams hBaseParams = new HBaseParams(); assertEquals("hbase", hBaseParams.getServiceName()); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveParamsTest.java index 0cbb8a6a2..4c1ceee7a 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveParamsTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveParamsTest.java @@ -18,18 +18,36 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hive; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; public class HiveParamsTest { - private final HiveParams hiveParams = new HiveParams() { - @Override - public String stackHome() { - return "/stack"; - } - }; + private HiveParams hiveParams; + + @BeforeEach + public void setUp() { + hiveParams = mock(HiveParams.class); + when(hiveParams.stackHome()).thenReturn("/stack"); + when(hiveParams.getServiceName()).thenCallRealMethod(); + when(hiveParams.serviceHome()).thenCallRealMethod(); + when(hiveParams.hadoopHome()).thenCallRealMethod(); + when(hiveParams.confDir()).thenCallRealMethod(); + } + + @Test + public void testServiceHome() { + assertEquals("/stack/hive", hiveParams.serviceHome()); + } + + @Test + public void testConfDir() { + assertEquals("/stack/hive/conf", hiveParams.confDir()); + } @Test public void testHadoopHome() { diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaParamsTest.java index bfefc980a..feb6c7d43 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaParamsTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaParamsTest.java @@ -18,22 +18,34 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.kafka; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; public class KafkaParamsTest { - private final KafkaParams kafkaParams = new KafkaParams() { - @Override - public String serviceHome() { - return "/confDir"; - } - }; + private KafkaParams kafkaParams; + + @BeforeEach + public void setUp() { + kafkaParams = mock(KafkaParams.class); + when(kafkaParams.stackHome()).thenReturn("/stack"); + when(kafkaParams.getServiceName()).thenCallRealMethod(); + when(kafkaParams.serviceHome()).thenCallRealMethod(); + when(kafkaParams.confDir()).thenCallRealMethod(); + } + + @Test + public void testServiceHome() { + assertEquals("/stack/kafka", kafkaParams.serviceHome()); + } @Test public void testConfDir() { - assertEquals("/confDir/config", kafkaParams.confDir()); + assertEquals("/stack/kafka/config", kafkaParams.confDir()); } @Test diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrParamsTest.java index bb13bcd27..32bb79f89 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrParamsTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrParamsTest.java @@ -18,26 +18,38 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.solr; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; public class SolrParamsTest { - private final SolrParams kafkaParams = new SolrParams() { - @Override - public String serviceHome() { - return "/confDir"; - } - }; + private SolrParams solrParams; + + @BeforeEach + public void setUp() { + solrParams = mock(SolrParams.class); + when(solrParams.stackHome()).thenReturn("/stack"); + when(solrParams.getServiceName()).thenCallRealMethod(); + when(solrParams.serviceHome()).thenCallRealMethod(); + when(solrParams.confDir()).thenCallRealMethod(); + } + + @Test + public void testServiceHome() { + assertEquals("/stack/solr", solrParams.serviceHome()); + } @Test public void testConfDir() { - assertEquals("/confDir/server/solr", kafkaParams.confDir()); + assertEquals("/stack/solr/server/solr", solrParams.confDir()); } @Test public void testGetServiceName() { - assertEquals("solr", kafkaParams.getServiceName()); + assertEquals("solr", solrParams.getServiceName()); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkParamsTest.java index 1f4a431fa..cb14d1a67 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkParamsTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkParamsTest.java @@ -18,6 +18,7 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.spark; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -26,27 +27,53 @@ public class SparkParamsTest { + private SparkParams sparkParams; + + @BeforeEach + public void setUp() { + sparkParams = mock(SparkParams.class); + when(sparkParams.stackHome()).thenReturn("/stack"); + when(sparkParams.getServiceName()).thenCallRealMethod(); + when(sparkParams.serviceHome()).thenCallRealMethod(); + when(sparkParams.hadoopConfDir()).thenCallRealMethod(); + when(sparkParams.hadoopHome()).thenCallRealMethod(); + when(sparkParams.hiveConfDir()).thenCallRealMethod(); + when(sparkParams.hiveHome()).thenCallRealMethod(); + when(sparkParams.confDir()).thenCallRealMethod(); + } + + @Test + public void testServiceHome() { + assertEquals("/stack/spark", sparkParams.serviceHome()); + } + @Test public void testHadoopConfDir() { - SparkParams params = mock(SparkParams.class); - when(params.stackHome()).thenReturn("/opt/stack"); - when(params.hadoopHome()).thenCallRealMethod(); - when(params.hadoopConfDir()).thenCallRealMethod(); - assertEquals("/opt/stack/hadoop/etc/hadoop", params.hadoopConfDir()); + assertEquals("/stack/hadoop/etc/hadoop", sparkParams.hadoopConfDir()); + } + + @Test + public void testHadoopHome() { + assertEquals("/stack/hadoop", sparkParams.hadoopHome()); } @Test public void testHiveConfDir() { - SparkParams params = mock(SparkParams.class); - when(params.stackHome()).thenReturn("/opt/stack"); - when(params.hiveHome()).thenCallRealMethod(); - when(params.hiveConfDir()).thenCallRealMethod(); - assertEquals("/opt/stack/hive/conf", params.hiveConfDir()); + assertEquals("/stack/hive/conf", sparkParams.hiveConfDir()); + } + + @Test + public void testHiveHome() { + assertEquals("/stack/hive", sparkParams.hiveHome()); + } + + @Test + public void testConfDir() { + assertEquals("/stack/spark/conf", sparkParams.confDir()); } @Test public void testGetServiceName() { - SparkParams params = new SparkParams(); - assertEquals("spark", params.getServiceName()); + assertEquals("spark", sparkParams.getServiceName()); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/tez/TezParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/tez/TezParamsTest.java index c92697a5b..6dfc81517 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/tez/TezParamsTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/tez/TezParamsTest.java @@ -18,6 +18,7 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.tez; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -26,27 +27,41 @@ public class TezParamsTest { - @Test - public void testHadoopHome() { - TezParams tezParams = mock(TezParams.class); + private TezParams tezParams; + + @BeforeEach + public void setUp() { + tezParams = mock(TezParams.class); when(tezParams.stackHome()).thenReturn("/stack"); - when(tezParams.hadoopHome()).thenCallRealMethod(); + when(tezParams.getServiceName()).thenCallRealMethod(); + when(tezParams.serviceHome()).thenCallRealMethod(); when(tezParams.hadoopConfDir()).thenCallRealMethod(); - assertEquals("/stack/hadoop", tezParams.hadoopHome()); + when(tezParams.hadoopHome()).thenCallRealMethod(); + when(tezParams.confDir()).thenCallRealMethod(); + } + + @Test + public void testConfDir() { + assertEquals("/stack/tez/conf", tezParams.confDir()); + } + + @Test + public void testServiceHome() { + assertEquals("/stack/tez", tezParams.serviceHome()); } @Test public void testHadoopConfDir() { - TezParams tezParams = mock(TezParams.class); - when(tezParams.stackHome()).thenReturn("/stack"); - when(tezParams.hadoopHome()).thenCallRealMethod(); - when(tezParams.hadoopConfDir()).thenCallRealMethod(); assertEquals("/stack/hadoop/etc/hadoop", tezParams.hadoopConfDir()); } + @Test + public void testHadoopHome() { + assertEquals("/stack/hadoop", tezParams.hadoopHome()); + } + @Test public void testGetServiceName() { - TezParams tezParams = new TezParams(); assertEquals("tez", tezParams.getServiceName()); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperParamsTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperParamsTest.java index 287c921bc..f1f035f35 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperParamsTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperParamsTest.java @@ -18,15 +18,38 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.zookeeper; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; public class ZookeeperParamsTest { + private ZookeeperParams zookeeperParams; + + @BeforeEach + public void setUp() { + zookeeperParams = mock(ZookeeperParams.class); + when(zookeeperParams.stackHome()).thenReturn("/stack"); + when(zookeeperParams.getServiceName()).thenCallRealMethod(); + when(zookeeperParams.serviceHome()).thenCallRealMethod(); + when(zookeeperParams.confDir()).thenCallRealMethod(); + } + + @Test + public void testServiceHome() { + assertEquals("/stack/zookeeper", zookeeperParams.serviceHome()); + } + + @Test + public void testConfDir() { + assertEquals("/stack/zookeeper/conf", zookeeperParams.confDir()); + } + @Test public void testGetServiceName() { - ZookeeperParams zookeeperParams = new ZookeeperParams(); assertEquals("zookeeper", zookeeperParams.getServiceName()); } } From 6c7a248b1c5690c31f6908910856f1db2d7673a9 Mon Sep 17 00:00:00 2001 From: huangguojie2024 <503601315@qq.com> Date: Tue, 11 Feb 2025 17:34:47 +0800 Subject: [PATCH 4/5] Add some ut cases. --- .../flink/FlinkHistoryServerScriptTest.java | 37 +++++++++++++++++- .../v3_3_0/hadoop/DataNodeScriptTest.java | 36 +++++++++++++++++- .../hadoop/HistoryServerScriptTest.java | 36 +++++++++++++++++- .../v3_3_0/hadoop/NameNodeScriptTest.java | 36 +++++++++++++++++- .../v3_3_0/hadoop/NodeManagerScriptTest.java | 36 +++++++++++++++++- .../hadoop/ResourceManagerScriptTest.java | 36 +++++++++++++++++- .../v3_3_0/hadoop/SNameNodeScriptTest.java | 36 +++++++++++++++++- .../v3_3_0/hbase/HMasterScriptTest.java | 36 +++++++++++++++++- .../v3_3_0/hbase/HRegionServerScriptTest.java | 36 +++++++++++++++++- .../v3_3_0/hive/HiveMetastoreScriptTest.java | 36 +++++++++++++++++- .../v3_3_0/hive/HiveServer2ScriptTest.java | 36 +++++++++++++++++- .../v3_3_0/kafka/KafkaBrokerScriptTest.java | 36 +++++++++++++++++- .../v3_3_0/solr/SolrInstanceScriptTest.java | 36 +++++++++++++++++- .../spark/SparkHistoryServerScriptTest.java | 38 ++++++++++++++++++- .../spark/SparkThriftServerScriptTest.java | 38 ++++++++++++++++++- .../zookeeper/ZookeeperServerScriptTest.java | 36 +++++++++++++++++- 16 files changed, 562 insertions(+), 19 deletions(-) diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java index e304bc0d0..c2dac7d8d 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java @@ -18,16 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.flink; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; class FlinkHistoryServerScriptTest { - private final FlinkHistoryServerScript script = new FlinkHistoryServerScript(); + private final FlinkHistoryServerScript flinkHistoryServerScript = new FlinkHistoryServerScript(); @Test void testGetComponentName() { - assertEquals("flink_historyserver", script.getComponentName()); + assertEquals("flink_historyserver", flinkHistoryServerScript.getComponentName()); + } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> flinkHistoryServerScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> flinkHistoryServerScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> flinkHistoryServerScript.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> flinkHistoryServerScript.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> flinkHistoryServerScript.start(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/DataNodeScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/DataNodeScriptTest.java index 6b4ee756a..9ddfcc966 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/DataNodeScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/DataNodeScriptTest.java @@ -18,15 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class DataNodeScriptTest { + private final DataNodeScript dataNodeScript = new DataNodeScript(); + @Test public void testGetComponentName() { - DataNodeScript dataNodeScript = new DataNodeScript(); assertEquals("datanode", dataNodeScript.getComponentName()); } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> dataNodeScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> dataNodeScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> dataNodeScript.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> dataNodeScript.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> dataNodeScript.start(params)); + } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HistoryServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HistoryServerScriptTest.java index acefb79e0..d10a71672 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HistoryServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HistoryServerScriptTest.java @@ -18,15 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class HistoryServerScriptTest { + private final HistoryServerScript historyServerScript = new HistoryServerScript(); + @Test public void testGetComponentName() { - HistoryServerScript historyServerScript = new HistoryServerScript(); assertEquals("history_server", historyServerScript.getComponentName()); } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> historyServerScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> historyServerScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> historyServerScript.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> historyServerScript.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> historyServerScript.start(params)); + } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NameNodeScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NameNodeScriptTest.java index 28704b6b0..87d91a5ac 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NameNodeScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NameNodeScriptTest.java @@ -18,15 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class NameNodeScriptTest { + private final NameNodeScript nameNodeScript = new NameNodeScript(); + @Test public void testGetComponentName() { - NameNodeScript nameNodeScript = new NameNodeScript(); assertEquals("namenode", nameNodeScript.getComponentName()); } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> nameNodeScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> nameNodeScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> nameNodeScript.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> nameNodeScript.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> nameNodeScript.start(params)); + } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NodeManagerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NodeManagerScriptTest.java index 9163cdfc7..b592f2e93 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NodeManagerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NodeManagerScriptTest.java @@ -18,15 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class NodeManagerScriptTest { + private final NodeManagerScript nodeManagerScript = new NodeManagerScript(); + @Test public void testGetComponentName() { - NodeManagerScript nodeManagerScript = new NodeManagerScript(); assertEquals("nodemanager", nodeManagerScript.getComponentName()); } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> nodeManagerScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> nodeManagerScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> nodeManagerScript.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> nodeManagerScript.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> nodeManagerScript.start(params)); + } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/ResourceManagerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/ResourceManagerScriptTest.java index 0d93c06d4..d38287cdc 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/ResourceManagerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/ResourceManagerScriptTest.java @@ -18,15 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class ResourceManagerScriptTest { + private final ResourceManagerScript resourceManagerScript = new ResourceManagerScript(); + @Test public void testGetComponentName() { - ResourceManagerScript resourceManagerScript = new ResourceManagerScript(); assertEquals("resourcemanager", resourceManagerScript.getComponentName()); } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> resourceManagerScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> resourceManagerScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> resourceManagerScript.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> resourceManagerScript.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> resourceManagerScript.start(params)); + } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/SNameNodeScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/SNameNodeScriptTest.java index 5589c1e8b..4667376f8 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/SNameNodeScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/SNameNodeScriptTest.java @@ -18,15 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class SNameNodeScriptTest { + private final SNameNodeScript sNameNodeScript = new SNameNodeScript(); + @Test public void testGetComponentName() { - SNameNodeScript sNameNodeScript = new SNameNodeScript(); assertEquals("secondarynamenode", sNameNodeScript.getComponentName()); } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sNameNodeScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sNameNodeScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sNameNodeScript.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sNameNodeScript.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sNameNodeScript.start(params)); + } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScriptTest.java index 22efaab5b..6d18e043d 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScriptTest.java @@ -18,15 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hbase; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class HMasterScriptTest { + private final HMasterScript hMasterScript = new HMasterScript(); + @Test public void testGetComponentName() { - HMasterScript hMasterScript = new HMasterScript(); assertEquals("hbase_master", hMasterScript.getComponentName()); } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hMasterScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hMasterScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hMasterScript.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hMasterScript.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hMasterScript.start(params)); + } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScriptTest.java index 9ad8ac4e6..0ea220e1b 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScriptTest.java @@ -18,15 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hbase; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class HRegionServerScriptTest { + private final HRegionServerScript hRegionServerScript = new HRegionServerScript(); + @Test public void testGetComponentName() { - HRegionServerScript hRegionServerScript = new HRegionServerScript(); assertEquals("hbase_regionserver", hRegionServerScript.getComponentName()); } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hRegionServerScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hRegionServerScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hRegionServerScript.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hRegionServerScript.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hRegionServerScript.start(params)); + } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveMetastoreScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveMetastoreScriptTest.java index d5bf374c4..58552c2ae 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveMetastoreScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveMetastoreScriptTest.java @@ -18,15 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hive; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class HiveMetastoreScriptTest { + private final HiveMetastoreScript hiveMetastoreScript = new HiveMetastoreScript(); + @Test public void testGetComponentName() { - HiveMetastoreScript hiveMetastoreScript = new HiveMetastoreScript(); assertEquals("hive_metastore", hiveMetastoreScript.getComponentName()); } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hiveMetastoreScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hiveMetastoreScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hiveMetastoreScript.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hiveMetastoreScript.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hiveMetastoreScript.start(params)); + } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveServer2ScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveServer2ScriptTest.java index db9c9963c..c752d13a0 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveServer2ScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveServer2ScriptTest.java @@ -18,15 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hive; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class HiveServer2ScriptTest { + private final HiveServer2Script hiveServer2Script = new HiveServer2Script(); + @Test public void testGetComponentName() { - HiveServer2Script hiveServer2Script = new HiveServer2Script(); assertEquals("hiveserver2", hiveServer2Script.getComponentName()); } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hiveServer2Script.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hiveServer2Script.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hiveServer2Script.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hiveServer2Script.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> hiveServer2Script.start(params)); + } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaBrokerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaBrokerScriptTest.java index 95db6f9e1..9a4403d18 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaBrokerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaBrokerScriptTest.java @@ -18,15 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.kafka; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class KafkaBrokerScriptTest { + private final KafkaBrokerScript kafkaBrokerScript = new KafkaBrokerScript(); + @Test public void testGetComponentName() { - KafkaBrokerScript kafkaBrokerScript = new KafkaBrokerScript(); assertEquals("kafka_broker", kafkaBrokerScript.getComponentName()); } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> kafkaBrokerScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> kafkaBrokerScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> kafkaBrokerScript.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> kafkaBrokerScript.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> kafkaBrokerScript.start(params)); + } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrInstanceScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrInstanceScriptTest.java index 382f35c78..49f42ed07 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrInstanceScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrInstanceScriptTest.java @@ -18,15 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.solr; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class SolrInstanceScriptTest { + private final SolrInstanceScript solrInstanceScript = new SolrInstanceScript(); + @Test public void testGetComponentName() { - SolrInstanceScript solrInstanceScript = new SolrInstanceScript(); assertEquals("solr_instance", solrInstanceScript.getComponentName()); } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> solrInstanceScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> solrInstanceScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> solrInstanceScript.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> solrInstanceScript.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> solrInstanceScript.start(params)); + } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkHistoryServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkHistoryServerScriptTest.java index b5f489f12..a5baf52db 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkHistoryServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkHistoryServerScriptTest.java @@ -18,15 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.spark; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class SparkHistoryServerScriptTest { + private final SparkHistoryServerScript sparkHistoryServerScript = new SparkHistoryServerScript(); + @Test public void testGetComponentName() { - SparkHistoryServerScript script = new SparkHistoryServerScript(); - assertEquals("spark_historyserver", script.getComponentName()); + assertEquals("spark_historyserver", sparkHistoryServerScript.getComponentName()); + } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sparkHistoryServerScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sparkHistoryServerScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sparkHistoryServerScript.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sparkHistoryServerScript.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sparkHistoryServerScript.start(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkThriftServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkThriftServerScriptTest.java index 51c4491ee..aef311ba6 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkThriftServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkThriftServerScriptTest.java @@ -18,15 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.spark; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class SparkThriftServerScriptTest { + private final SparkThriftServerScript sparkThriftServerScript = new SparkThriftServerScript(); + @Test public void testGetComponentName() { - SparkThriftServerScript serverScript = new SparkThriftServerScript(); - assertEquals("spark_thriftserver", serverScript.getComponentName()); + assertEquals("spark_thriftserver", sparkThriftServerScript.getComponentName()); + } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sparkThriftServerScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sparkThriftServerScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sparkThriftServerScript.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sparkThriftServerScript.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> sparkThriftServerScript.start(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperServerScriptTest.java index c91848216..5c6a1a752 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperServerScriptTest.java @@ -18,15 +18,49 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.zookeeper; +import org.apache.bigtop.manager.stack.core.spi.param.Params; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class ZookeeperServerScriptTest { + private final ZookeeperServerScript zookeeperServerScript = new ZookeeperServerScript(); + @Test public void testGetComponentName() { - ZookeeperServerScript zookeeperServerScript = new ZookeeperServerScript(); assertEquals("zookeeper_server", zookeeperServerScript.getComponentName()); } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> zookeeperServerScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> zookeeperServerScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> zookeeperServerScript.add(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> zookeeperServerScript.configure(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> zookeeperServerScript.start(params)); + } } From cc7a995bf0da44440ae71b7c0aceadc0fe9ec6be Mon Sep 17 00:00:00 2001 From: huangguojie2024 <503601315@qq.com> Date: Tue, 11 Feb 2025 20:20:58 +0800 Subject: [PATCH 5/5] Fixed the incorrect method calls. --- .../bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java | 6 +++--- .../stack/bigtop/v3_3_0/hadoop/DataNodeScriptTest.java | 6 +++--- .../stack/bigtop/v3_3_0/hadoop/HistoryServerScriptTest.java | 6 +++--- .../stack/bigtop/v3_3_0/hadoop/NameNodeScriptTest.java | 6 +++--- .../stack/bigtop/v3_3_0/hadoop/NodeManagerScriptTest.java | 6 +++--- .../bigtop/v3_3_0/hadoop/ResourceManagerScriptTest.java | 6 +++--- .../stack/bigtop/v3_3_0/hadoop/SNameNodeScriptTest.java | 6 +++--- .../stack/bigtop/v3_3_0/hbase/HMasterScriptTest.java | 6 +++--- .../stack/bigtop/v3_3_0/hbase/HRegionServerScriptTest.java | 6 +++--- .../stack/bigtop/v3_3_0/hive/HiveMetastoreScriptTest.java | 6 +++--- .../stack/bigtop/v3_3_0/hive/HiveServer2ScriptTest.java | 6 +++--- .../stack/bigtop/v3_3_0/kafka/KafkaBrokerScriptTest.java | 6 +++--- .../stack/bigtop/v3_3_0/solr/SolrInstanceScriptTest.java | 6 +++--- .../bigtop/v3_3_0/spark/SparkHistoryServerScriptTest.java | 6 +++--- .../bigtop/v3_3_0/spark/SparkThriftServerScriptTest.java | 6 +++--- .../bigtop/v3_3_0/zookeeper/ZookeeperServerScriptTest.java | 2 +- 16 files changed, 46 insertions(+), 46 deletions(-) diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java index c2dac7d8d..56eed2fbb 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/flink/FlinkHistoryServerScriptTest.java @@ -49,18 +49,18 @@ public void testConfigureParamsNull() { @Test public void testStartParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> flinkHistoryServerScript.add(params)); + assertThrows(NullPointerException.class, () -> flinkHistoryServerScript.start(params)); } @Test public void testStopParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> flinkHistoryServerScript.configure(params)); + assertThrows(NullPointerException.class, () -> flinkHistoryServerScript.stop(params)); } @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> flinkHistoryServerScript.start(params)); + assertThrows(NullPointerException.class, () -> flinkHistoryServerScript.status(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/DataNodeScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/DataNodeScriptTest.java index 9ddfcc966..159643adb 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/DataNodeScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/DataNodeScriptTest.java @@ -49,18 +49,18 @@ public void testConfigureParamsNull() { @Test public void testStartParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> dataNodeScript.add(params)); + assertThrows(NullPointerException.class, () -> dataNodeScript.start(params)); } @Test public void testStopParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> dataNodeScript.configure(params)); + assertThrows(NullPointerException.class, () -> dataNodeScript.stop(params)); } @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> dataNodeScript.start(params)); + assertThrows(NullPointerException.class, () -> dataNodeScript.status(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HistoryServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HistoryServerScriptTest.java index d10a71672..432dc63c4 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HistoryServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HistoryServerScriptTest.java @@ -49,18 +49,18 @@ public void testConfigureParamsNull() { @Test public void testStartParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> historyServerScript.add(params)); + assertThrows(NullPointerException.class, () -> historyServerScript.start(params)); } @Test public void testStopParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> historyServerScript.configure(params)); + assertThrows(NullPointerException.class, () -> historyServerScript.stop(params)); } @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> historyServerScript.start(params)); + assertThrows(NullPointerException.class, () -> historyServerScript.status(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NameNodeScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NameNodeScriptTest.java index 87d91a5ac..8d13f3f20 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NameNodeScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NameNodeScriptTest.java @@ -49,18 +49,18 @@ public void testConfigureParamsNull() { @Test public void testStartParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> nameNodeScript.add(params)); + assertThrows(NullPointerException.class, () -> nameNodeScript.start(params)); } @Test public void testStopParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> nameNodeScript.configure(params)); + assertThrows(NullPointerException.class, () -> nameNodeScript.stop(params)); } @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> nameNodeScript.start(params)); + assertThrows(NullPointerException.class, () -> nameNodeScript.status(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NodeManagerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NodeManagerScriptTest.java index b592f2e93..f87c8220b 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NodeManagerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/NodeManagerScriptTest.java @@ -49,18 +49,18 @@ public void testConfigureParamsNull() { @Test public void testStartParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> nodeManagerScript.add(params)); + assertThrows(NullPointerException.class, () -> nodeManagerScript.start(params)); } @Test public void testStopParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> nodeManagerScript.configure(params)); + assertThrows(NullPointerException.class, () -> nodeManagerScript.stop(params)); } @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> nodeManagerScript.start(params)); + assertThrows(NullPointerException.class, () -> nodeManagerScript.status(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/ResourceManagerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/ResourceManagerScriptTest.java index d38287cdc..6ce95f502 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/ResourceManagerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/ResourceManagerScriptTest.java @@ -49,18 +49,18 @@ public void testConfigureParamsNull() { @Test public void testStartParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> resourceManagerScript.add(params)); + assertThrows(NullPointerException.class, () -> resourceManagerScript.start(params)); } @Test public void testStopParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> resourceManagerScript.configure(params)); + assertThrows(NullPointerException.class, () -> resourceManagerScript.stop(params)); } @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> resourceManagerScript.start(params)); + assertThrows(NullPointerException.class, () -> resourceManagerScript.status(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/SNameNodeScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/SNameNodeScriptTest.java index 4667376f8..8b5ad1a38 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/SNameNodeScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/SNameNodeScriptTest.java @@ -49,18 +49,18 @@ public void testConfigureParamsNull() { @Test public void testStartParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> sNameNodeScript.add(params)); + assertThrows(NullPointerException.class, () -> sNameNodeScript.start(params)); } @Test public void testStopParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> sNameNodeScript.configure(params)); + assertThrows(NullPointerException.class, () -> sNameNodeScript.stop(params)); } @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> sNameNodeScript.start(params)); + assertThrows(NullPointerException.class, () -> sNameNodeScript.status(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScriptTest.java index 6d18e043d..374bc2ba0 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HMasterScriptTest.java @@ -49,18 +49,18 @@ public void testConfigureParamsNull() { @Test public void testStartParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> hMasterScript.add(params)); + assertThrows(NullPointerException.class, () -> hMasterScript.start(params)); } @Test public void testStopParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> hMasterScript.configure(params)); + assertThrows(NullPointerException.class, () -> hMasterScript.stop(params)); } @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> hMasterScript.start(params)); + assertThrows(NullPointerException.class, () -> hMasterScript.status(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScriptTest.java index 0ea220e1b..fd1bac05b 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HRegionServerScriptTest.java @@ -49,18 +49,18 @@ public void testConfigureParamsNull() { @Test public void testStartParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> hRegionServerScript.add(params)); + assertThrows(NullPointerException.class, () -> hRegionServerScript.start(params)); } @Test public void testStopParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> hRegionServerScript.configure(params)); + assertThrows(NullPointerException.class, () -> hRegionServerScript.stop(params)); } @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> hRegionServerScript.start(params)); + assertThrows(NullPointerException.class, () -> hRegionServerScript.status(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveMetastoreScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveMetastoreScriptTest.java index 58552c2ae..7b6fd5ea0 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveMetastoreScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveMetastoreScriptTest.java @@ -49,18 +49,18 @@ public void testConfigureParamsNull() { @Test public void testStartParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> hiveMetastoreScript.add(params)); + assertThrows(NullPointerException.class, () -> hiveMetastoreScript.start(params)); } @Test public void testStopParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> hiveMetastoreScript.configure(params)); + assertThrows(NullPointerException.class, () -> hiveMetastoreScript.stop(params)); } @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> hiveMetastoreScript.start(params)); + assertThrows(NullPointerException.class, () -> hiveMetastoreScript.status(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveServer2ScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveServer2ScriptTest.java index c752d13a0..7dbcae19a 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveServer2ScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveServer2ScriptTest.java @@ -49,18 +49,18 @@ public void testConfigureParamsNull() { @Test public void testStartParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> hiveServer2Script.add(params)); + assertThrows(NullPointerException.class, () -> hiveServer2Script.start(params)); } @Test public void testStopParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> hiveServer2Script.configure(params)); + assertThrows(NullPointerException.class, () -> hiveServer2Script.stop(params)); } @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> hiveServer2Script.start(params)); + assertThrows(NullPointerException.class, () -> hiveServer2Script.status(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaBrokerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaBrokerScriptTest.java index 9a4403d18..d156cc042 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaBrokerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/kafka/KafkaBrokerScriptTest.java @@ -49,18 +49,18 @@ public void testConfigureParamsNull() { @Test public void testStartParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> kafkaBrokerScript.add(params)); + assertThrows(NullPointerException.class, () -> kafkaBrokerScript.start(params)); } @Test public void testStopParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> kafkaBrokerScript.configure(params)); + assertThrows(NullPointerException.class, () -> kafkaBrokerScript.stop(params)); } @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> kafkaBrokerScript.start(params)); + assertThrows(NullPointerException.class, () -> kafkaBrokerScript.status(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrInstanceScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrInstanceScriptTest.java index 49f42ed07..62c65dc0e 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrInstanceScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/solr/SolrInstanceScriptTest.java @@ -49,18 +49,18 @@ public void testConfigureParamsNull() { @Test public void testStartParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> solrInstanceScript.add(params)); + assertThrows(NullPointerException.class, () -> solrInstanceScript.start(params)); } @Test public void testStopParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> solrInstanceScript.configure(params)); + assertThrows(NullPointerException.class, () -> solrInstanceScript.stop(params)); } @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> solrInstanceScript.start(params)); + assertThrows(NullPointerException.class, () -> solrInstanceScript.status(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkHistoryServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkHistoryServerScriptTest.java index a5baf52db..d5ecfacba 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkHistoryServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkHistoryServerScriptTest.java @@ -49,18 +49,18 @@ public void testConfigureParamsNull() { @Test public void testStartParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> sparkHistoryServerScript.add(params)); + assertThrows(NullPointerException.class, () -> sparkHistoryServerScript.start(params)); } @Test public void testStopParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> sparkHistoryServerScript.configure(params)); + assertThrows(NullPointerException.class, () -> sparkHistoryServerScript.stop(params)); } @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> sparkHistoryServerScript.start(params)); + assertThrows(NullPointerException.class, () -> sparkHistoryServerScript.status(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkThriftServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkThriftServerScriptTest.java index aef311ba6..d2a9af636 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkThriftServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/spark/SparkThriftServerScriptTest.java @@ -49,18 +49,18 @@ public void testConfigureParamsNull() { @Test public void testStartParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> sparkThriftServerScript.add(params)); + assertThrows(NullPointerException.class, () -> sparkThriftServerScript.start(params)); } @Test public void testStopParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> sparkThriftServerScript.configure(params)); + assertThrows(NullPointerException.class, () -> sparkThriftServerScript.stop(params)); } @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> sparkThriftServerScript.start(params)); + assertThrows(NullPointerException.class, () -> sparkThriftServerScript.status(params)); } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperServerScriptTest.java index 5c6a1a752..ecfdcb094 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/test/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/zookeeper/ZookeeperServerScriptTest.java @@ -61,6 +61,6 @@ public void testStopParamsNull() { @Test public void testStatusParamsNull() { Params params = null; - assertThrows(NullPointerException.class, () -> zookeeperServerScript.start(params)); + assertThrows(NullPointerException.class, () -> zookeeperServerScript.status(params)); } }