diff options
author | Rama-Huawei <rama.subba.reddy.s@huawei.com> | 2019-04-16 09:59:26 +0530 |
---|---|---|
committer | Rama-Huawei <rama.subba.reddy.s@huawei.com> | 2019-04-16 10:02:23 +0530 |
commit | bca6895e81ceb77a467d3ceeec45b5536c1712df (patch) | |
tree | be411ff8a7a36b35519f8986c7e26dfd63835c24 /components/datalake-handler/feeder/src/test/java | |
parent | a36b7ed7cc57c5dae4c5bd1a21f1143acb0332d6 (diff) |
Unit test code for datalake seed code
Fixed the folder related path for generating
and reading files from correct folder
Issue-ID: DCAEGEN2-1309
Change-Id: I1ec3aae549f484e667eb4048c1ab59b6a60aaf87
Signed-off-by: Rama-Huawei <rama.subba.reddy.s@huawei.com>
Diffstat (limited to 'components/datalake-handler/feeder/src/test/java')
-rw-r--r-- | components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/util/DruidSupervisorGeneratorTest.java | 82 |
1 files changed, 44 insertions, 38 deletions
diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/util/DruidSupervisorGeneratorTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/util/DruidSupervisorGeneratorTest.java index f5a42bbb..8a9f0779 100644 --- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/util/DruidSupervisorGeneratorTest.java +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/util/DruidSupervisorGeneratorTest.java @@ -1,39 +1,41 @@ /*
-* ============LICENSE_START=======================================================
-* ONAP : DataLake
-* ================================================================================
-* Copyright 2019 China Mobile
-*=================================================================================
-* Licensed 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
-*
-* http://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.
-* ============LICENSE_END=========================================================
-*/
+ * ============LICENSE_START=======================================================
+ * ONAP : DataLake
+ * ================================================================================
+ * Copyright 2019 China Mobile
+ *=================================================================================
+ * Licensed 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
+ *
+ * http://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.
+ * ============LICENSE_END=========================================================
+ */
package org.onap.datalake.feeder.util;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
import org.apache.velocity.VelocityContext;
import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.runner.RunWith;
import org.onap.datalake.feeder.config.ApplicationConfiguration;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import java.io.IOException;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+
/**
* Test DruidSupervisorGenerator
- * @author Guobiao Mo
*
+ * @author Guobiao Mo
*/
@RunWith(SpringJUnit4ClassRunner.class)
@@ -41,19 +43,23 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; public class DruidSupervisorGeneratorTest {
- @Autowired
- private ApplicationConfiguration config;
+ @Autowired
+ private ApplicationConfiguration config;
@Test
- public void testConstructor() {
- DruidSupervisorGenerator gen = new DruidSupervisorGenerator();
- VelocityContext context= gen.getContext();
-
- assertNotNull(context);
- assertNotNull(gen.getDimensions() );
- assertNotNull(gen.getTemplate() );
-
- String host = (String) context.get("host");
- assertEquals(host, config.getDmaapKafkaHostPort());
- }
+ public void testConstructor() throws IOException {
+ DruidSupervisorGenerator gen = new DruidSupervisorGenerator();
+ VelocityContext context = gen.getContext();
+
+ assertNotNull(context);
+ assertNotNull(gen.getDimensions());
+ assertNotNull(gen.getTemplate());
+
+ String host = (String) context.get("host");
+ assertEquals(host, config.getDmaapKafkaHostPort());
+
+ String[] strArray2 = {"test1", "test2", "test3"};
+
+ DruidSupervisorGenerator.main(strArray2);
+ }
}
|