Repository: sqoop Updated Branches: refs/heads/sqoop2 a63da71ad -> 9e8636981
SQOOP-2233: Sqoop2: Move TestHdfsConnector class under test directory (Jarek Jarcec Cecho via Abraham Elmahrek) Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/9e863698 Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/9e863698 Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/9e863698 Branch: refs/heads/sqoop2 Commit: 9e8636981f114d54065d8e4c86829e7d19171c75 Parents: a63da71 Author: Abraham Elmahrek <[email protected]> Authored: Thu Mar 19 11:51:31 2015 -0700 Committer: Abraham Elmahrek <[email protected]> Committed: Thu Mar 19 11:51:31 2015 -0700 ---------------------------------------------------------------------- .../sqoop/connector/hdfs/TestHdfsConnector.java | 77 -------------------- .../sqoop/connector/hdfs/TestHdfsConnector.java | 77 ++++++++++++++++++++ 2 files changed, 77 insertions(+), 77 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sqoop/blob/9e863698/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/TestHdfsConnector.java ---------------------------------------------------------------------- diff --git a/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/TestHdfsConnector.java b/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/TestHdfsConnector.java deleted file mode 100644 index b41bd5a..0000000 --- a/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/TestHdfsConnector.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * 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 - * - * 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. - */ -package org.apache.sqoop.connector.hdfs; - -import org.apache.sqoop.common.Direction; -import org.apache.sqoop.model.ConfigUtils; -import org.apache.sqoop.model.MConfig; -import org.apache.sqoop.model.MInput; -import org.testng.annotations.Test; - -import java.util.List; -import java.util.Locale; -import java.util.ResourceBundle; - -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -/** - */ -public class TestHdfsConnector { - - @Test - public void testBundleForLink() { - HdfsConnector connector = new HdfsConnector(); - verifyBundleForConfigClass(connector.getBundle(Locale.getDefault()), connector.getLinkConfigurationClass()); - } - - @Test - void testBundleForJobToDirection() { - HdfsConnector connector = new HdfsConnector(); - verifyBundleForConfigClass(connector.getBundle(Locale.getDefault()), connector.getJobConfigurationClass(Direction.TO)); - } - - @Test - void testBundleForJobFromDirection() { - HdfsConnector connector = new HdfsConnector(); - verifyBundleForConfigClass(connector.getBundle(Locale.getDefault()), connector.getJobConfigurationClass(Direction.FROM)); - } - - void verifyBundleForConfigClass(ResourceBundle bundle, Class klass) { - assertNotNull(bundle); - assertNotNull(klass); - - List<MConfig> configs = ConfigUtils.toConfigs(klass); - - for(MConfig config : configs) { - assertNotNull(config.getHelpKey()); - assertNotNull(config.getLabelKey()); - - assertTrue(bundle.containsKey(config.getHelpKey()), "Can't find help for " + config.getName()); - assertTrue(bundle.containsKey(config.getLabelKey()), "Can't find label for " + config.getName()); - - for(MInput input : config.getInputs()) { - assertNotNull(input.getHelpKey()); - assertNotNull(input.getLabelKey()); - - assertTrue(bundle.containsKey(input.getHelpKey()), "Can't find help for " + input.getName()); - assertTrue(bundle.containsKey(input.getLabelKey()), "Can't find label for " + input.getName()); - } - } - } -} http://git-wip-us.apache.org/repos/asf/sqoop/blob/9e863698/connector/connector-hdfs/src/test/java/org/apache/sqoop/connector/hdfs/TestHdfsConnector.java ---------------------------------------------------------------------- diff --git a/connector/connector-hdfs/src/test/java/org/apache/sqoop/connector/hdfs/TestHdfsConnector.java b/connector/connector-hdfs/src/test/java/org/apache/sqoop/connector/hdfs/TestHdfsConnector.java new file mode 100644 index 0000000..b41bd5a --- /dev/null +++ b/connector/connector-hdfs/src/test/java/org/apache/sqoop/connector/hdfs/TestHdfsConnector.java @@ -0,0 +1,77 @@ +/** + * 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 + * + * 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. + */ +package org.apache.sqoop.connector.hdfs; + +import org.apache.sqoop.common.Direction; +import org.apache.sqoop.model.ConfigUtils; +import org.apache.sqoop.model.MConfig; +import org.apache.sqoop.model.MInput; +import org.testng.annotations.Test; + +import java.util.List; +import java.util.Locale; +import java.util.ResourceBundle; + +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; + +/** + */ +public class TestHdfsConnector { + + @Test + public void testBundleForLink() { + HdfsConnector connector = new HdfsConnector(); + verifyBundleForConfigClass(connector.getBundle(Locale.getDefault()), connector.getLinkConfigurationClass()); + } + + @Test + void testBundleForJobToDirection() { + HdfsConnector connector = new HdfsConnector(); + verifyBundleForConfigClass(connector.getBundle(Locale.getDefault()), connector.getJobConfigurationClass(Direction.TO)); + } + + @Test + void testBundleForJobFromDirection() { + HdfsConnector connector = new HdfsConnector(); + verifyBundleForConfigClass(connector.getBundle(Locale.getDefault()), connector.getJobConfigurationClass(Direction.FROM)); + } + + void verifyBundleForConfigClass(ResourceBundle bundle, Class klass) { + assertNotNull(bundle); + assertNotNull(klass); + + List<MConfig> configs = ConfigUtils.toConfigs(klass); + + for(MConfig config : configs) { + assertNotNull(config.getHelpKey()); + assertNotNull(config.getLabelKey()); + + assertTrue(bundle.containsKey(config.getHelpKey()), "Can't find help for " + config.getName()); + assertTrue(bundle.containsKey(config.getLabelKey()), "Can't find label for " + config.getName()); + + for(MInput input : config.getInputs()) { + assertNotNull(input.getHelpKey()); + assertNotNull(input.getLabelKey()); + + assertTrue(bundle.containsKey(input.getHelpKey()), "Can't find help for " + input.getName()); + assertTrue(bundle.containsKey(input.getLabelKey()), "Can't find label for " + input.getName()); + } + } + } +}
