Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add CLI plugins

  • Loading branch information...
commit 47891ff8fa4320e01195b06bdcb8140e90c04d42 1 parent 719f4cf
@leejianwei leejianwei authored
Showing with 2,278 additions and 29 deletions.
  1. +27 −0 CLI/common/build.gradle
  2. +9 −0 CLI/common/gradle.properties
  3. 0  CLI/{ → common}/src/main/java/org/springframework/data/hadoop/admin/cli/util/Log.java
  4. 0  CLI/{ → common}/src/main/java/org/springframework/data/hadoop/admin/cli/util/PropertyUtil.java
  5. 0  CLI/{ → common}/src/main/resources/META-INF/spring/spring-shell-plugin.xml
  6. 0  CLI/{ → common}/src/main/resources/rest-context.xml
  7. 0  CLI/{ → common}/src/test/java/org/springframework/data/hadoop/admin/cli/util/PropertyUtilTest.java
  8. 0  CLI/{ → plugin-admin}/README.txt
  9. +6 −3 CLI/{ → plugin-admin}/build.gradle
  10. 0  CLI/{ → plugin-admin}/gradle.properties
  11. 0  CLI/{ → plugin-admin}/src/main/java/org/springframework/data/hadoop/admin/cli/commands/BaseCommand.java
  12. +1 −0  ...rarr; plugin-admin}/src/main/java/org/springframework/data/hadoop/admin/cli/commands/ExecutionsCommand.java
  13. 0  CLI/{ → plugin-admin}/src/main/java/org/springframework/data/hadoop/admin/cli/commands/InfoCommand.java
  14. +1 −0  CLI/{ → plugin-admin}/src/main/java/org/springframework/data/hadoop/admin/cli/commands/JobsCommand.java
  15. +2 −0  ...{ → plugin-admin}/src/main/java/org/springframework/data/hadoop/admin/cli/commands/ProjectCommand.java
  16. 0  CLI/{ → plugin-admin}/src/main/java/org/springframework/data/hadoop/admin/cli/commands/ProjectType.java
  17. +0 −13 CLI/{ → plugin-admin}/src/main/java/org/springframework/data/hadoop/admin/cli/commands/TargetCommand.java
  18. +1 −0  ... → plugin-admin}/src/main/java/org/springframework/data/hadoop/admin/cli/commands/TemplateCommand.java
  19. +1 −0  ... → plugin-admin}/src/main/java/org/springframework/data/hadoop/admin/cli/commands/WorkflowCommand.java
  20. +1 −1  ...-admin}/src/main/java/org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminBannerProvider.java
  21. +1 −1  ...rc/main/java/org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminHistoryFileNameProvider.java
  22. +1 −1  ...-admin}/src/main/java/org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminPromptProvider.java
  23. +12 −0 CLI/plugin-admin/src/main/resources/META-INF/spring/spring-shell-plugin.xml
  24. +23 −0 CLI/plugin-admin/src/main/resources/rest-context.xml
  25. +2 −1  ... → plugin-admin}/src/test/java/org/springframework/data/hadoop/admin/cli/commands/BaseCommandTest.java
  26. +5 −4 ... → plugin-admin}/src/test/java/org/springframework/data/hadoop/admin/cli/commands/FileCommandTest.java
  27. +1 −0  ...arr; plugin-admin}/src/test/java/org/springframework/data/hadoop/admin/cli/commands/ProjectCommandTest.java
  28. 0  ...in}/src/test/java/org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminBannerProviderTest.java
  29. 0  ...est/java/org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminHistoryFileNameProviderTest.java
  30. 0  ...in}/src/test/java/org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminPromptProviderTest.java
  31. +24 −0 CLI/plugin-hdfs/build.gradle
  32. +7 −0 CLI/plugin-hdfs/gradle.properties
  33. +1 −1  ...arr; plugin-hdfs/src/main/java/org/springframework/data/hadoop/admin/cli/hdfs}/commands/FsShellCommand.java
  34. +49 −0 CLI/plugin-hdfs/src/main/java/org/springframework/data/hadoop/admin/cli/hdfs/commands/HdfsTargetCommand.java
  35. +75 −0 ...ugin-hdfs/src/main/java/org/springframework/data/hadoop/admin/cli/hdfs/plugin/HDFSPluginBannerProvider.java
  36. +43 −0 .../src/main/java/org/springframework/data/hadoop/admin/cli/hdfs/plugin/HDFSPluginHistoryFileNameProvider.java
  37. +45 −0 ...ugin-hdfs/src/main/java/org/springframework/data/hadoop/admin/cli/hdfs/plugin/HDFSPluginPromptProvider.java
  38. +12 −0 CLI/plugin-hdfs/src/main/resources/META-INF/spring/spring-shell-plugin.xml
  39. +87 −0 ...dfs/src/test/java/org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminBannerProviderTest.java
  40. +65 −0 ...est/java/org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminHistoryFileNameProviderTest.java
  41. +66 −0 ...dfs/src/test/java/org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminPromptProviderTest.java
  42. +23 −0 CLI/plugin-mapreduce/build.gradle
  43. +7 −0 CLI/plugin-mapreduce/gradle.properties
  44. +40 −0 ...ugin-mapreduce/src/main/java/org/springframework/data/hadoop/admin/cli/mapreduce/commands/MRJobCommand.java
  45. +75 −0 ...src/main/java/org/springframework/data/hadoop/admin/cli/mapreduce/plugin/MapReducePluginBannerProvider.java
  46. +43 −0 ...java/org/springframework/data/hadoop/admin/cli/mapreduce/plugin/MapReducePluginHistoryFileNameProvider.java
  47. +45 −0 ...src/main/java/org/springframework/data/hadoop/admin/cli/mapreduce/plugin/MapReducePluginPromptProvider.java
  48. +12 −0 CLI/plugin-mapreduce/src/main/resources/META-INF/spring/spring-shell-plugin.xml
  49. +87 −0 ...uce/src/test/java/org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminBannerProviderTest.java
  50. +65 −0 ...est/java/org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminHistoryFileNameProviderTest.java
  51. +66 −0 ...uce/src/test/java/org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminPromptProviderTest.java
  52. +2 −1  build.gradle
  53. +2 −1  scalable-service/master/build.gradle
  54. +1,236 −0 scalable-service/master/example.log
  55. +2 −0  service/build.gradle
  56. +5 −2 settings.gradle
View
27 CLI/common/build.gradle
@@ -0,0 +1,27 @@
+
+description = 'Spring Hadoop Admin CLI common'
+apply plugin: 'eclipse'
+
+repositories {
+ maven { url "http://spring-roo-repository.springsource.org/release" }
+}
+
+dependencies {
+ compile "org.springframework.shell:spring-shell:$springShellVersion"
+ compile "commons-configuration:commons-configuration:$commonsConfigurationVersion"
+ compile "commons-logging:commons-logging:$commonsLoggingVersion"
+}
+
+jar {
+ baseName "cli-common"
+}
+
+
+eclipse {
+ project {
+ name = "cli-common"
+ }
+}
+
+
+defaultTasks 'clean', 'build'
View
9 CLI/common/gradle.properties
@@ -0,0 +1,9 @@
+springVersion = 3.1.1.RELEASE
+springShellVersion = 1.0.0.BUILD-SNAPSHOT
+commonsConfigurationVersion = 1.8
+commonsLoggingVersion = 1.1.1
+
+
+
+
+
View
0  ...ework/data/hadoop/admin/cli/util/Log.java → ...ework/data/hadoop/admin/cli/util/Log.java
File renamed without changes
View
0  ...a/hadoop/admin/cli/util/PropertyUtil.java → ...a/hadoop/admin/cli/util/PropertyUtil.java
File renamed without changes
View
0  ...s/META-INF/spring/spring-shell-plugin.xml → ...s/META-INF/spring/spring-shell-plugin.xml
File renamed without changes
View
0  CLI/src/main/resources/rest-context.xml → ...ommon/src/main/resources/rest-context.xml
File renamed without changes
View
0  ...doop/admin/cli/util/PropertyUtilTest.java → ...doop/admin/cli/util/PropertyUtilTest.java
File renamed without changes
View
0  CLI/README.txt → CLI/plugin-admin/README.txt
File renamed without changes
View
9 CLI/build.gradle → CLI/plugin-admin/build.gradle
@@ -1,5 +1,5 @@
-description = 'Spring Hadoop Admin CLI'
+description = 'Spring Hadoop Admin CLI admin plugin'
apply plugin: 'eclipse'
repositories {
@@ -7,6 +7,9 @@ repositories {
}
dependencies {
+ compile project(':CLI:common')
+ compile project(':CLI:plugin-hdfs')
+ compile project(':CLI:plugin-mapreduce')
compile "org.springframework.shell:spring-shell:$springShellVersion"
compile "org.springframework:spring-web:$springVersion"
}
@@ -23,7 +26,7 @@ project.ext.manifestClasspath = "dependency/" + springShellJar.name + " "
project.ext.manifestClasspath = project.ext.manifestClasspath + configurations.runtime.collect{ File file -> "dependency/"+file.name}.join(' ')
jar {
- baseName "spring-hadoop-admin-cli"
+ baseName "plugin-admin"
manifest {
attributes 'Main-Class' : 'org.springframework.shell.Bootstrap', "Class-Path" : project.ext.manifestClasspath
}
@@ -32,7 +35,7 @@ jar {
eclipse {
project {
- name = "spring-hadoop-admin-cli"
+ name = "plugin-admin"
}
}
View
0  CLI/gradle.properties → CLI/plugin-admin/gradle.properties
File renamed without changes
View
0  ...adoop/admin/cli/commands/BaseCommand.java → ...adoop/admin/cli/commands/BaseCommand.java
File renamed without changes
View
1  ...admin/cli/commands/ExecutionsCommand.java → ...admin/cli/commands/ExecutionsCommand.java
@@ -17,6 +17,7 @@
import java.util.Date;
+import org.springframework.data.hadoop.admin.cli.commands.BaseCommand;
import org.springframework.roo.shell.CliAvailabilityIndicator;
import org.springframework.roo.shell.CliCommand;
import org.springframework.roo.shell.CliOption;
View
0  ...adoop/admin/cli/commands/InfoCommand.java → ...adoop/admin/cli/commands/InfoCommand.java
File renamed without changes
View
1  ...adoop/admin/cli/commands/JobsCommand.java → ...adoop/admin/cli/commands/JobsCommand.java
@@ -15,6 +15,7 @@
*/
package org.springframework.data.hadoop.admin.cli.commands;
+import org.springframework.data.hadoop.admin.cli.commands.BaseCommand;
import org.springframework.roo.shell.CliAvailabilityIndicator;
import org.springframework.roo.shell.CliCommand;
import org.springframework.roo.shell.CliOption;
View
2  ...op/admin/cli/commands/ProjectCommand.java → ...op/admin/cli/commands/ProjectCommand.java
@@ -25,6 +25,8 @@
import java.util.zip.ZipInputStream;
import org.codehaus.jackson.map.ObjectMapper;
+import org.springframework.data.hadoop.admin.cli.commands.BaseCommand;
+import org.springframework.data.hadoop.admin.cli.commands.ProjectType;
import org.springframework.data.hadoop.admin.cli.util.Log;
import org.springframework.roo.shell.CliCommand;
import org.springframework.roo.shell.CliOption;
View
0  ...adoop/admin/cli/commands/ProjectType.java → ...adoop/admin/cli/commands/ProjectType.java
File renamed without changes
View
13 ...oop/admin/cli/commands/TargetCommand.java → ...oop/admin/cli/commands/TargetCommand.java
@@ -46,17 +46,4 @@ public void target(@CliOption(key = { "url" }, mandatory = true, help = "Spring
}
}
- /**
- * set HDFS URL
- *
- * @param url HDFS url, for example, "hdfs://localhost:9000".
- */
- @CliCommand(value = "hdfs target", help = "set HDFS URL")
- public void dfsName(@CliOption(key = { "url" }, mandatory = true, help = "HDFS URL") final String url) {
- try {
- PropertyUtil.setDfsName(url);
- } catch (ConfigurationException e) {
- Log.error("set target url failed. " + e.getMessage());
- }
- }
}
View
1  ...p/admin/cli/commands/TemplateCommand.java → ...p/admin/cli/commands/TemplateCommand.java
@@ -19,6 +19,7 @@
import java.io.FileFilter;
import org.springframework.core.io.FileSystemResource;
+import org.springframework.data.hadoop.admin.cli.commands.BaseCommand;
import org.springframework.data.hadoop.admin.cli.util.Log;
import org.springframework.roo.shell.CliAvailabilityIndicator;
import org.springframework.roo.shell.CliCommand;
View
1  ...p/admin/cli/commands/WorkflowCommand.java → ...p/admin/cli/commands/WorkflowCommand.java
@@ -19,6 +19,7 @@
import java.io.FileFilter;
import org.springframework.core.io.FileSystemResource;
+import org.springframework.data.hadoop.admin.cli.commands.BaseCommand;
import org.springframework.data.hadoop.admin.cli.util.Log;
import org.springframework.roo.shell.CliAvailabilityIndicator;
import org.springframework.roo.shell.CliCommand;
View
2  ...ugin/SpringHadoopAdminBannerProvider.java → ...ugin/SpringHadoopAdminBannerProvider.java
@@ -30,7 +30,7 @@
*
*/
@Component
-@Order(Ordered.HIGHEST_PRECEDENCE)
+@Order(Ordered.LOWEST_PRECEDENCE -2)
public class SpringHadoopAdminBannerProvider extends DefaultBannerProvider
implements CommandMarker {
View
2  ...ngHadoopAdminHistoryFileNameProvider.java → ...ngHadoopAdminHistoryFileNameProvider.java
@@ -28,7 +28,7 @@
*
*/
@Component
-@Order(Ordered.HIGHEST_PRECEDENCE)
+@Order(Ordered.LOWEST_PRECEDENCE -2)
public class SpringHadoopAdminHistoryFileNameProvider extends DefaultHistoryFileNameProvider{
public String getHistoryFileName() {
View
2  ...ugin/SpringHadoopAdminPromptProvider.java → ...ugin/SpringHadoopAdminPromptProvider.java
@@ -27,7 +27,7 @@
*
*/
@Component
-@Order(Ordered.HIGHEST_PRECEDENCE)
+@Order(Ordered.LOWEST_PRECEDENCE -2)
public class SpringHadoopAdminPromptProvider extends DefaultPromptProvider {
/* (non-Javadoc)
View
12 CLI/plugin-admin/src/main/resources/META-INF/spring/spring-shell-plugin.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
+
+ <context:component-scan base-package="org.springframework.data.hadoop.admin.cli">
+ <context:include-filter type="regex" expression="(commands|plugin)\..*"/>
+ </context:component-scan>
+
+</beans>
View
23 CLI/plugin-admin/src/main/resources/rest-context.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
+
+ <bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
+ <!--
+ <property name="messageConverters">
+ <list>
+ <ref bean="stringHttpMessageConverter"/>
+ <ref bean="jsonConverter" />
+ </list>
+ </property>
+ -->
+ </bean>
+ <bean id="jsonConverter"
+ class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
+ <property name="supportedMediaTypes" value="application/json" />
+ </bean>
+ <bean id="stringHttpMessageConverter"
+ class="org.springframework.http.converter.StringHttpMessageConverter" />
+
+</beans>
View
3  ...p/admin/cli/commands/BaseCommandTest.java → ...p/admin/cli/commands/BaseCommandTest.java
@@ -19,6 +19,7 @@
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import org.springframework.data.hadoop.admin.cli.commands.BaseCommand;
/**
* @author Jarred Li
@@ -45,7 +46,7 @@ public void tearDown() throws Exception {
}
/**
- * Test method for {@link org.springframework.data.hadoop.admin.cli.commands.BaseCommand#setCommandURL(java.lang.String)}.
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.mapreduce.commands.BaseCommand#setCommandURL(java.lang.String)}.
*/
@Test
public void testSetCommandURL() {
View
9 ...p/admin/cli/commands/FileCommandTest.java → ...p/admin/cli/commands/FileCommandTest.java
@@ -18,6 +18,7 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.springframework.data.hadoop.admin.cli.commands.WorkflowCommand;
/**
* @author Jarred Li
@@ -44,7 +45,7 @@ public void tearDown() throws Exception {
}
/**
- * Test method for {@link org.springframework.data.hadoop.admin.cli.commands.WorkflowCommand#listFiles()}.
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.mapreduce.commands.WorkflowCommand#listFiles()}.
*/
@Test
public void testListFiles() {
@@ -52,7 +53,7 @@ public void testListFiles() {
}
/**
- * Test method for {@link org.springframework.data.hadoop.admin.cli.commands.WorkflowCommand#downloadFile(java.lang.String)}.
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.mapreduce.commands.WorkflowCommand#downloadFile(java.lang.String)}.
*/
@Test
public void testDownloadFile() {
@@ -60,7 +61,7 @@ public void testDownloadFile() {
}
/**
- * Test method for {@link org.springframework.data.hadoop.admin.cli.commands.WorkflowCommand#uploadFile(java.lang.String, java.lang.String)}.
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.mapreduce.commands.WorkflowCommand#uploadFile(java.lang.String, java.lang.String)}.
*/
@Test
public void testUploadFile() {
@@ -68,7 +69,7 @@ public void testUploadFile() {
}
/**
- * Test method for {@link org.springframework.data.hadoop.admin.cli.commands.WorkflowCommand#deleteFile(java.lang.String)}.
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.mapreduce.commands.WorkflowCommand#deleteFile(java.lang.String)}.
*/
@Test
public void testDeleteFile() {
View
1  ...dmin/cli/commands/ProjectCommandTest.java → ...dmin/cli/commands/ProjectCommandTest.java
@@ -23,6 +23,7 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.springframework.data.hadoop.admin.cli.commands.ProjectCommand;
/**
* @author Jarred Li
View
0  .../SpringHadoopAdminBannerProviderTest.java → .../SpringHadoopAdminBannerProviderTest.java
File renamed without changes
View
0  ...doopAdminHistoryFileNameProviderTest.java → ...doopAdminHistoryFileNameProviderTest.java
File renamed without changes
View
0  .../SpringHadoopAdminPromptProviderTest.java → .../SpringHadoopAdminPromptProviderTest.java
File renamed without changes
View
24 CLI/plugin-hdfs/build.gradle
@@ -0,0 +1,24 @@
+
+description = 'Spring Hadoop Admin CLI HDFS plugin'
+apply plugin: 'eclipse'
+
+repositories {
+ maven { url "http://spring-roo-repository.springsource.org/release" }
+}
+
+dependencies {
+ compile project(':CLI:common')
+ compile "org.springframework.shell:spring-shell:$springShellVersion"
+ compile "org.apache.hadoop:hadoop-core:$hadoopVersion"
+}
+
+
+
+eclipse {
+ project {
+ name = "plugin-hdfs"
+ }
+}
+
+
+defaultTasks 'clean', 'build'
View
7 CLI/plugin-hdfs/gradle.properties
@@ -0,0 +1,7 @@
+springVersion = 3.1.1.RELEASE
+springShellVersion = 1.0.0.BUILD-SNAPSHOT
+hadoopVersion = 1.0.3
+
+
+
+
View
2  ...op/admin/cli/commands/FsShellCommand.java → ...min/cli/hdfs/commands/FsShellCommand.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.springframework.data.hadoop.admin.cli.commands;
+package org.springframework.data.hadoop.admin.cli.hdfs.commands;
import java.util.ArrayList;
import java.util.Arrays;
View
49 .../main/java/org/springframework/data/hadoop/admin/cli/hdfs/commands/HdfsTargetCommand.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ *
+ * 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.
+ */
+package org.springframework.data.hadoop.admin.cli.hdfs.commands;
+
+import org.apache.commons.configuration.ConfigurationException;
+import org.springframework.data.hadoop.admin.cli.util.Log;
+import org.springframework.data.hadoop.admin.cli.util.PropertyUtil;
+import org.springframework.roo.shell.CliCommand;
+import org.springframework.roo.shell.CliOption;
+import org.springframework.roo.shell.CommandMarker;
+import org.springframework.stereotype.Component;
+
+/**
+ * Target command to set HDFS URL
+ *
+ * @author Jarred Li
+ *
+ */
+@Component
+public class HdfsTargetCommand implements CommandMarker {
+
+
+ /**
+ * set HDFS URL
+ *
+ * @param url HDFS url, for example, "hdfs://localhost:9000".
+ */
+ @CliCommand(value = "hdfs target", help = "set HDFS URL")
+ public void dfsName(@CliOption(key = { "url" }, mandatory = true, help = "HDFS URL") final String url) {
+ try {
+ PropertyUtil.setDfsName(url);
+ } catch (ConfigurationException e) {
+ Log.error("set target url failed. " + e.getMessage());
+ }
+ }
+}
View
75 .../java/org/springframework/data/hadoop/admin/cli/hdfs/plugin/HDFSPluginBannerProvider.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ *
+ * 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.
+ */
+package org.springframework.data.hadoop.admin.cli.hdfs.plugin;
+
+import org.springframework.core.Ordered;
+import org.springframework.core.annotation.Order;
+import org.springframework.roo.shell.CliCommand;
+import org.springframework.roo.shell.CommandMarker;
+import org.springframework.roo.support.util.StringUtils;
+import org.springframework.shell.plugin.support.DefaultBannerProvider;
+import org.springframework.stereotype.Component;
+
+/**
+ * Banner Provider to customize Spring Shell Banner
+ *
+ * @author Jarred Li
+ *
+ */
+@Component
+@Order(Ordered.LOWEST_PRECEDENCE)
+public class HDFSPluginBannerProvider extends DefaultBannerProvider
+ implements CommandMarker {
+
+ /* (non-Javadoc)
+ * @see org.springframework.shell.plugin.BannerProvider#getBanner()
+ */
+ @CliCommand(value = { "version" }, help = "Displays current CLI version")
+ public String getBanner() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("=======================================" + StringUtils.LINE_SEPARATOR);
+ buf.append("* *"+ StringUtils.LINE_SEPARATOR);
+ buf.append("* *"+ StringUtils.LINE_SEPARATOR);
+ buf.append("* CLI Plugin for HDFS *" +StringUtils.LINE_SEPARATOR);
+ buf.append("* *"+ StringUtils.LINE_SEPARATOR);
+ buf.append("* *"+ StringUtils.LINE_SEPARATOR);
+ buf.append("=======================================" + StringUtils.LINE_SEPARATOR);
+ buf.append("Verson:" + this.getVersion());
+ return buf.toString();
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.springframework.shell.plugin.BannerProvider#getVersion()
+ */
+ public String getVersion() {
+ return "1.0.0";
+ }
+
+ /* (non-Javadoc)
+ * @see org.springframework.shell.plugin.BannerProvider#getWelcomeMessage()
+ */
+ public String getWelcomeMessage() {
+ return "Welcome to HDFS CLI";
+ }
+
+ @Override
+ public String name() {
+ return "hdfs cli banner provider";
+ }
+
+
+}
View
43 .../springframework/data/hadoop/admin/cli/hdfs/plugin/HDFSPluginHistoryFileNameProvider.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ *
+ * 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.
+ */
+
+package org.springframework.data.hadoop.admin.cli.hdfs.plugin;
+
+import org.springframework.core.Ordered;
+import org.springframework.core.annotation.Order;
+import org.springframework.shell.plugin.support.DefaultHistoryFileNameProvider;
+import org.springframework.stereotype.Component;
+
+/**
+ * history file name provider to customize Spring Shell's log file
+ *
+ * @author Jarred Li
+ *
+ */
+@Component
+@Order(Ordered.LOWEST_PRECEDENCE)
+public class HDFSPluginHistoryFileNameProvider extends DefaultHistoryFileNameProvider{
+
+ public String getHistoryFileName() {
+ return "hdfs-cli.log";
+ }
+
+ @Override
+ public String name() {
+ return "hdfs cli history file name provider";
+ }
+
+}
View
45 .../java/org/springframework/data/hadoop/admin/cli/hdfs/plugin/HDFSPluginPromptProvider.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ *
+ * 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.
+ */
+package org.springframework.data.hadoop.admin.cli.hdfs.plugin;
+
+import org.springframework.core.Ordered;
+import org.springframework.core.annotation.Order;
+import org.springframework.shell.plugin.support.DefaultPromptProvider;
+import org.springframework.stereotype.Component;
+
+/**
+ * Propmpt provider to customize Spring Shell's prompt text
+ *
+ * @author Jarred Li
+ *
+ */
+@Component
+@Order(Ordered.LOWEST_PRECEDENCE)
+public class HDFSPluginPromptProvider extends DefaultPromptProvider {
+
+ /* (non-Javadoc)
+ * @see org.springframework.shell.plugin.PromptProvider#getPromptText()
+ */
+ public String getPromptText() {
+ return "HDFS-CLI>";
+ }
+
+ @Override
+ public String name() {
+ return "hdfs cli prompt provider";
+ }
+
+}
View
12 CLI/plugin-hdfs/src/main/resources/META-INF/spring/spring-shell-plugin.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
+
+ <context:component-scan base-package="org.springframework.data.hadoop.admin.cli.hdfs">
+ <context:include-filter type="regex" expression="(commands|plugin)\..*"/>
+ </context:component-scan>
+
+</beans>
View
87 ...org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminBannerProviderTest.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ *
+ * 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.
+ */
+package org.springframework.data.hadoop.admin.cli.plugin;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.data.hadoop.admin.cli.hdfs.plugin.HDFSPluginBannerProvider;
+
+
+/**
+ * @author Jarred Li
+ *
+ */
+public class SpringHadoopAdminBannerProviderTest{
+
+ private HDFSPluginBannerProvider bannerProvider;
+
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ bannerProvider = new HDFSPluginBannerProvider();
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ bannerProvider = null;
+ }
+
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.hdfs.plugin.HDFSPluginBannerProvider#getBanner()}.
+ */
+ @Test
+ public void testGetBanner() {
+ String banner = bannerProvider.getBanner();
+ Assert.assertNotNull(banner);
+ }
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.hdfs.plugin.HDFSPluginBannerProvider#getVersion()}.
+ */
+ @Test
+ public void testGetVersion() {
+ String version = bannerProvider.getVersion();
+ Assert.assertNotNull(version);
+ }
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.hdfs.plugin.HDFSPluginBannerProvider#getWelcomMessage()}.
+ */
+ @Test
+ public void testGetWelcomMessage() {
+ String msg = bannerProvider.getWelcomeMessage();
+ Assert.assertNotNull(msg);
+ }
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.hdfs.plugin.HDFSPluginBannerProvider#name()}.
+ */
+ @Test
+ public void testName() {
+ String name = bannerProvider.name();
+ Assert.assertNotNull(name);
+ }
+
+}
View
65 ...gframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminHistoryFileNameProviderTest.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ *
+ * 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.
+ */
+package org.springframework.data.hadoop.admin.cli.plugin;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.data.hadoop.admin.cli.hdfs.plugin.HDFSPluginHistoryFileNameProvider;
+
+/**
+ * @author Jarred Li
+ *
+ */
+public class SpringHadoopAdminHistoryFileNameProviderTest {
+
+ private HDFSPluginHistoryFileNameProvider fileNameProvider;
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ fileNameProvider = new HDFSPluginHistoryFileNameProvider();
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ fileNameProvider = null;
+ }
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.hdfs.plugin.HDFSPluginHistoryFileNameProvider#getHistoryFileName()}.
+ */
+ @Test
+ public void testGetHistoryFileName() {
+ String fileName = fileNameProvider.getHistoryFileName();
+ Assert.assertNotNull(fileName);
+ }
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.hdfs.plugin.HDFSPluginHistoryFileNameProvider#name()}.
+ */
+ @Test
+ public void testName() {
+ String name = fileNameProvider.name();
+ Assert.assertNotNull(name);
+ }
+
+}
View
66 ...org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminPromptProviderTest.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ *
+ * 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.
+ */
+package org.springframework.data.hadoop.admin.cli.plugin;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.data.hadoop.admin.cli.hdfs.plugin.HDFSPluginPromptProvider;
+
+/**
+ * @author Jarred Li
+ *
+ */
+public class SpringHadoopAdminPromptProviderTest {
+
+ private HDFSPluginPromptProvider provider;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ provider = new HDFSPluginPromptProvider();
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ provider = null;
+ }
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.hdfs.plugin.HDFSPluginPromptProvider#getPromptText()}.
+ */
+ @Test
+ public void testGetPromptText() {
+ String prompt = provider.getPromptText();
+ Assert.assertNotNull(prompt);
+ }
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.hdfs.plugin.HDFSPluginPromptProvider#name()}.
+ */
+ @Test
+ public void testName() {
+ String name = provider.name();
+ Assert.assertNotNull(name);
+ }
+
+}
View
23 CLI/plugin-mapreduce/build.gradle
@@ -0,0 +1,23 @@
+
+description = 'Spring Hadoop Admin CLI MapReduce plugin'
+apply plugin: 'eclipse'
+
+repositories {
+ maven { url "http://spring-roo-repository.springsource.org/release" }
+}
+
+dependencies {
+ compile project(':CLI:common')
+ compile "org.springframework.shell:spring-shell:$springShellVersion"
+ compile "org.apache.hadoop:hadoop-core:$hadoopVersion"
+}
+
+
+eclipse {
+ project {
+ name = "plugin-mapreduce"
+ }
+}
+
+
+defaultTasks 'clean', 'build'
View
7 CLI/plugin-mapreduce/gradle.properties
@@ -0,0 +1,7 @@
+springVersion = 3.1.1.RELEASE
+springShellVersion = 1.0.0.BUILD-SNAPSHOT
+hadoopVersion = 1.0.3
+
+
+
+
View
40 .../main/java/org/springframework/data/hadoop/admin/cli/mapreduce/commands/MRJobCommand.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ *
+ * 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.
+ */
+package org.springframework.data.hadoop.admin.cli.mapreduce.commands;
+
+import org.springframework.roo.shell.CliCommand;
+import org.springframework.roo.shell.CommandMarker;
+import org.springframework.stereotype.Component;
+
+/**
+ * Commands to show MR jobs
+ *
+ * @author Jarred Li
+ *
+ */
+@Component
+public class MRJobCommand implements CommandMarker {
+
+ /**
+ * show the current service URL
+ *
+ */
+ @CliCommand(value = "mr jobs list", help = "list MapReduce information")
+ public void getMRJobInfo() {
+
+ }
+
+}
View
75 ...springframework/data/hadoop/admin/cli/mapreduce/plugin/MapReducePluginBannerProvider.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ *
+ * 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.
+ */
+package org.springframework.data.hadoop.admin.cli.mapreduce.plugin;
+
+import org.springframework.core.Ordered;
+import org.springframework.core.annotation.Order;
+import org.springframework.roo.shell.CliCommand;
+import org.springframework.roo.shell.CommandMarker;
+import org.springframework.roo.support.util.StringUtils;
+import org.springframework.shell.plugin.support.DefaultBannerProvider;
+import org.springframework.stereotype.Component;
+
+/**
+ * Banner Provider to customize Spring Shell Banner
+ *
+ * @author Jarred Li
+ *
+ */
+@Component
+@Order(Ordered.LOWEST_PRECEDENCE -1)
+public class MapReducePluginBannerProvider extends DefaultBannerProvider
+ implements CommandMarker {
+
+ /* (non-Javadoc)
+ * @see org.springframework.shell.plugin.BannerProvider#getBanner()
+ */
+ @CliCommand(value = { "version" }, help = "Displays current CLI version")
+ public String getBanner() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("=======================================" + StringUtils.LINE_SEPARATOR);
+ buf.append("* *"+ StringUtils.LINE_SEPARATOR);
+ buf.append("* *"+ StringUtils.LINE_SEPARATOR);
+ buf.append("* CLI Plugin for MapReduce *" +StringUtils.LINE_SEPARATOR);
+ buf.append("* *"+ StringUtils.LINE_SEPARATOR);
+ buf.append("* *"+ StringUtils.LINE_SEPARATOR);
+ buf.append("=======================================" + StringUtils.LINE_SEPARATOR);
+ buf.append("Verson:" + this.getVersion());
+ return buf.toString();
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.springframework.shell.plugin.BannerProvider#getVersion()
+ */
+ public String getVersion() {
+ return "1.0.0";
+ }
+
+ /* (non-Javadoc)
+ * @see org.springframework.shell.plugin.BannerProvider#getWelcomeMessage()
+ */
+ public String getWelcomeMessage() {
+ return "Welcome to MapReduce CLI Plugin";
+ }
+
+ @Override
+ public String name() {
+ return "mapreduce cli banner provider";
+ }
+
+
+}
View
43 ...mework/data/hadoop/admin/cli/mapreduce/plugin/MapReducePluginHistoryFileNameProvider.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ *
+ * 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.
+ */
+
+package org.springframework.data.hadoop.admin.cli.mapreduce.plugin;
+
+import org.springframework.core.Ordered;
+import org.springframework.core.annotation.Order;
+import org.springframework.shell.plugin.support.DefaultHistoryFileNameProvider;
+import org.springframework.stereotype.Component;
+
+/**
+ * history file name provider to customize Spring Shell's log file
+ *
+ * @author Jarred Li
+ *
+ */
+@Component
+@Order(Ordered.LOWEST_PRECEDENCE -1)
+public class MapReducePluginHistoryFileNameProvider extends DefaultHistoryFileNameProvider{
+
+ public String getHistoryFileName() {
+ return "mapreduce-cli.log";
+ }
+
+ @Override
+ public String name() {
+ return "mapreduce cli history file name provider";
+ }
+
+}
View
45 ...springframework/data/hadoop/admin/cli/mapreduce/plugin/MapReducePluginPromptProvider.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ *
+ * 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.
+ */
+package org.springframework.data.hadoop.admin.cli.mapreduce.plugin;
+
+import org.springframework.core.Ordered;
+import org.springframework.core.annotation.Order;
+import org.springframework.shell.plugin.support.DefaultPromptProvider;
+import org.springframework.stereotype.Component;
+
+/**
+ * Propmpt provider to customize Spring Shell's prompt text
+ *
+ * @author Jarred Li
+ *
+ */
+@Component
+@Order(Ordered.LOWEST_PRECEDENCE -1)
+public class MapReducePluginPromptProvider extends DefaultPromptProvider {
+
+ /* (non-Javadoc)
+ * @see org.springframework.shell.plugin.PromptProvider#getPromptText()
+ */
+ public String getPromptText() {
+ return "MapReduce-CLI>";
+ }
+
+ @Override
+ public String name() {
+ return "mapreduce cli prompt provider";
+ }
+
+}
View
12 CLI/plugin-mapreduce/src/main/resources/META-INF/spring/spring-shell-plugin.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
+
+ <context:component-scan base-package="org.springframework.data.hadoop.admin.cli.mapreduce">
+ <context:include-filter type="regex" expression="(commands|plugin)\..*"/>
+ </context:component-scan>
+
+</beans>
View
87 ...org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminBannerProviderTest.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ *
+ * 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.
+ */
+package org.springframework.data.hadoop.admin.cli.plugin;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.data.hadoop.admin.cli.mapreduce.plugin.MapReducePluginBannerProvider;
+
+
+/**
+ * @author Jarred Li
+ *
+ */
+public class SpringHadoopAdminBannerProviderTest{
+
+ private MapReducePluginBannerProvider bannerProvider;
+
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ bannerProvider = new MapReducePluginBannerProvider();
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ bannerProvider = null;
+ }
+
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.mapreduce.plugin.MapReducePluginBannerProvider#getBanner()}.
+ */
+ @Test
+ public void testGetBanner() {
+ String banner = bannerProvider.getBanner();
+ Assert.assertNotNull(banner);
+ }
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.mapreduce.plugin.MapReducePluginBannerProvider#getVersion()}.
+ */
+ @Test
+ public void testGetVersion() {
+ String version = bannerProvider.getVersion();
+ Assert.assertNotNull(version);
+ }
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.mapreduce.plugin.MapReducePluginBannerProvider#getWelcomMessage()}.
+ */
+ @Test
+ public void testGetWelcomMessage() {
+ String msg = bannerProvider.getWelcomeMessage();
+ Assert.assertNotNull(msg);
+ }
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.mapreduce.plugin.MapReducePluginBannerProvider#name()}.
+ */
+ @Test
+ public void testName() {
+ String name = bannerProvider.name();
+ Assert.assertNotNull(name);
+ }
+
+}
View
65 ...gframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminHistoryFileNameProviderTest.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ *
+ * 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.
+ */
+package org.springframework.data.hadoop.admin.cli.plugin;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.data.hadoop.admin.cli.mapreduce.plugin.MapReducePluginHistoryFileNameProvider;
+
+/**
+ * @author Jarred Li
+ *
+ */
+public class SpringHadoopAdminHistoryFileNameProviderTest {
+
+ private MapReducePluginHistoryFileNameProvider fileNameProvider;
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ fileNameProvider = new MapReducePluginHistoryFileNameProvider();
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ fileNameProvider = null;
+ }
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.mapreduce.plugin.MapReducePluginHistoryFileNameProvider#getHistoryFileName()}.
+ */
+ @Test
+ public void testGetHistoryFileName() {
+ String fileName = fileNameProvider.getHistoryFileName();
+ Assert.assertNotNull(fileName);
+ }
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.mapreduce.plugin.MapReducePluginHistoryFileNameProvider#name()}.
+ */
+ @Test
+ public void testName() {
+ String name = fileNameProvider.name();
+ Assert.assertNotNull(name);
+ }
+
+}
View
66 ...org/springframework/data/hadoop/admin/cli/plugin/SpringHadoopAdminPromptProviderTest.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ *
+ * 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.
+ */
+package org.springframework.data.hadoop.admin.cli.plugin;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.data.hadoop.admin.cli.mapreduce.plugin.MapReducePluginPromptProvider;
+
+/**
+ * @author Jarred Li
+ *
+ */
+public class SpringHadoopAdminPromptProviderTest {
+
+ private MapReducePluginPromptProvider provider;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ provider = new MapReducePluginPromptProvider();
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ provider = null;
+ }
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.mapreduce.plugin.MapReducePluginPromptProvider#getPromptText()}.
+ */
+ @Test
+ public void testGetPromptText() {
+ String prompt = provider.getPromptText();
+ Assert.assertNotNull(prompt);
+ }
+
+ /**
+ * Test method for {@link org.springframework.data.hadoop.admin.cli.mapreduce.plugin.MapReducePluginPromptProvider#name()}.
+ */
+ @Test
+ public void testName() {
+ String name = provider.name();
+ Assert.assertNotNull(name);
+ }
+
+}
View
3  build.gradle
@@ -7,11 +7,12 @@ allprojects {
apply plugin: 'java'
repositories {
- mavenLocal()
+ //mavenLocal()
mavenCentral()
maven { url "http://repo.springsource.org/snapshot" }
maven { url "http://repo.springsource.org/release" }
maven { url "http://repo.springsource.org/milestone" }
+ maven { url "http://mvnrepository.com/artifact" }
}
dependencies {
View
3  scalable-service/master/build.gradle
@@ -36,7 +36,8 @@ dependencies {
runtime "org.slf4j:slf4j-api:$slf4jVersion"
runtime "org.slf4j:slf4j-log4j12:$slf4jVersion"
runtime "org.slf4j:jcl-over-slf4j:$slf4jVersion"
-
+
+ testCompile "com.google.guava:guava:12.0"
}
war {
View
1,236 scalable-service/master/example.log
1,236 additions, 0 deletions not shown
View
2  service/build.gradle
@@ -10,6 +10,7 @@ repositories {
dependencies {
compile "org.springframework.data:spring-data-hadoop:$springHadoopVersion"
+
runtime "org.codehaus.jackson:jackson-core-asl:$jacksonVersion"
runtime "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
@@ -33,6 +34,7 @@ dependencies {
runtime "org.slf4j:slf4j-log4j12:$slf4jVersion"
runtime "org.slf4j:jcl-over-slf4j:$slf4jVersion"
+ testCompile "com.google.guava:guava:12.0"
}
war {
View
7 settings.gradle
@@ -1,8 +1,11 @@
rootProject.name = 'spring-hadoop-admin'
-include 'service'
-include 'CLI'
+include 'CLI:common'
+include 'CLI:plugin-hdfs'
+include 'CLI:plugin-mapreduce'
+include 'CLI:plugin-admin'
include 'templates'
+include 'service'
include 'scalable-service:common'
include 'scalable-service:master'
include 'scalable-service:slave'
Please sign in to comment.
Something went wrong with that request. Please try again.