-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add maven plugin for integration test
- Loading branch information
Showing
5 changed files
with
409 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>hadoop-unit</artifactId> | ||
<groupId>fr.jetoile.hadoop</groupId> | ||
<version>1.1-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>hadoop-unit-maven-plugin</artifactId> | ||
<packaging>maven-plugin</packaging> | ||
|
||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>fr.jetoile.hadoop</groupId> | ||
<artifactId>hadoop-unit-commons</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>fr.jetoile.hadoop</groupId> | ||
<artifactId>hadoop-unit-hbase</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>fr.jetoile.hadoop</groupId> | ||
<artifactId>hadoop-unit-hdfs</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>fr.jetoile.hadoop</groupId> | ||
<artifactId>hadoop-unit-hive</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>fr.jetoile.hadoop</groupId> | ||
<artifactId>hadoop-unit-kafka</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>fr.jetoile.hadoop</groupId> | ||
<artifactId>hadoop-unit-oozie</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>fr.jetoile.hadoop</groupId> | ||
<artifactId>hadoop-unit-solr</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>fr.jetoile.hadoop</groupId> | ||
<artifactId>hadoop-unit-solrcloud</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>fr.jetoile.hadoop</groupId> | ||
<artifactId>hadoop-unit-zookeeper</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.maven</groupId> | ||
<artifactId>maven-plugin-api</artifactId> | ||
<version>3.2.1</version> | ||
</dependency> | ||
|
||
<!-- dependencies to annotations --> | ||
<dependency> | ||
<groupId>org.apache.maven.plugin-tools</groupId> | ||
<artifactId>maven-plugin-annotations</artifactId> | ||
<version>3.4</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-plugin-plugin</artifactId> | ||
<version>3.3</version> | ||
<executions> | ||
<execution> | ||
<id>mojo-descriptor</id> | ||
<goals> | ||
<goal>descriptor</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> | ||
</configuration> | ||
</plugin> | ||
|
||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
|
||
</project> |
41 changes: 41 additions & 0 deletions
41
hadoop-unit-maven-plugin/src/main/java/fr/jetoile/hadoopunit/HadoopBootstrapStarter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package fr.jetoile.hadoopunit; | ||
|
||
import org.apache.maven.plugin.AbstractMojo; | ||
import org.apache.maven.plugin.MojoExecutionException; | ||
import org.apache.maven.plugin.MojoFailureException; | ||
import org.apache.maven.plugins.annotations.LifecyclePhase; | ||
import org.apache.maven.plugins.annotations.Mojo; | ||
import org.apache.maven.plugins.annotations.Parameter; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
|
||
@Mojo(name = "start", defaultPhase = LifecyclePhase.PRE_INTEGRATION_TEST, threadSafe = false) | ||
public class HadoopBootstrapStarter extends AbstractMojo { | ||
|
||
@Parameter(property = "values", required = true) | ||
protected List<String> values; | ||
|
||
@Override | ||
public void execute() throws MojoExecutionException, MojoFailureException { | ||
|
||
HadoopBootstrap bootstrap = HadoopBootstrap.INSTANCE; | ||
|
||
|
||
bootstrap.componentsToStart = bootstrap.componentsToStart.stream().filter(c -> | ||
values.contains(c.getName().toUpperCase()) | ||
).collect(Collectors.toList()); | ||
|
||
bootstrap.componentsToStop = bootstrap.componentsToStop.stream().filter(c -> | ||
values.contains(c.getName().toUpperCase()) | ||
).collect(Collectors.toList()); | ||
|
||
try { | ||
HadoopBootstrap.INSTANCE.startAll(); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.