OpenTSDB/opentsdb — pull request #273 by nickman (2014-01-25 23:21:51+00:00)
Title: Mavenview

This is a modified implementation of this mavenization proposal https://groups.google.com/forum/#!topic/opentsdb/lQQgU6hf6rU.

The basics are:

1. The shell file **maven-view.sh** which creates a subdirectory in the opentsdb root called **mavenview** and then builds a mavenized view of the project using symbolic links. (Obviously this will not work for Windows). Changes and additions in the maven view will be reflected in the root project (in all but src/tsd). The mavenview directory can then be used for fully functional maven building (of the FatJar), running unit tests and supporting IDE projects like eclipse and intellij. **No** changes occur in the root when running this shell file. The shell file can be run in the project root as **./maven-view.sh .**.
2. The pom file **maven-view.pom.xml** is copied into the mavenview root as **pom.xml** when the shell file is run.

3. Added mavenview to .gitignore, since there are no SCM controlled artifacts in there.

Running unit tests in the mavenview created a couple of issues, addressed with the following changes in src/test:

1. A new test utility class called **PluginJARFactory** auto-generates the plugin jar used for testing. This appears duplicative in the code right now but I feel this will simplify and offer more flexible options for generating dynamic test plugin jars. The utility implementations look like this:

```java
/**
* Creates the plugin jar
*/
@BeforeClass
public static void initPluginJar() {
PluginJARFactory.newBuilder("plugin_test.jar")
.service("net.opentsdb.plugin.DummyPlugin", "net.opentsdb.plugin.DummyPluginA", "net.opentsdb.plugin.DummyPluginB")
.service("net.opentsdb.search.SearchPlugin", "net.opentsdb.search.DummySearchPlugin")
.service("net.opentsdb.tsd.HttpSerializer", "net.opentsdb.tsd.DummyHttpSerializer")
.service("net.opentsdb.tsd.RpcPlugin", "net.opentsdb.tsd.DummyRpcPlugin")
.service("net.opentsdb.tsd.RTPublisher", "net.opentsdb.tsd.DummyRTPublisher")
.build();
}

/**
* Clears the created plugin jar
*/
@AfterClass
public static void clearPluginJar() {
PluginJARFactory.purge();
}
```

Currently 18 out of 1362 unit tests are failing, mostly because **mygnuplot.sh** is not in the CLASSPATH. I propose that this be addressed as part of making the FatJar executable ( issue #272 ).

In two cases, the **@PowerMockIgnore** annotation had to be updated to add a new package.

```java
@PowerMockIgnore({"javax.management.*", "javax.xml.*",
"ch.qos.*", "org.slf4j.*",
"com.sum.*", "org.xml.*", "com.sun.org.apache.xerces.internal.jaxp.*"})
```