From 3046b50d4a27fe13334226b4144d99c0d38899a2 Mon Sep 17 00:00:00 2001 From: "Achim D. Brucker" Date: Sat, 15 Oct 2016 01:53:06 +0100 Subject: [PATCH] Ad-hoc markdown conversion. --- .../jtestdataaccessor/{README => README.md} | 55 ++++++++++--------- 1 file changed, 29 insertions(+), 26 deletions(-) rename add-ons/jtestdataaccessor/{README => README.md} (71%) diff --git a/add-ons/jtestdataaccessor/README b/add-ons/jtestdataaccessor/README.md similarity index 71% rename from add-ons/jtestdataaccessor/README rename to add-ons/jtestdataaccessor/README.md index 87530d4..38bb637 100644 --- a/add-ons/jtestdataaccessor/README +++ b/add-ons/jtestdataaccessor/README.md @@ -1,79 +1,82 @@ -jtestdataaccessor -================= +# jtestdataaccessor +This add-on to su4sml provides access to test data in unit tests. -jtestdataaccessor - provide access to test data in unit tests. - -Installation -************ +## Installation Prerequisites: - o Java 1.5 - o Apache Maven 2 [1] or AntLR >= 2.7.6 and JUnit >= 4.0 + * Java 1.5 + * [Apache Maven 2](http://maven.apache.org/) or AntLR >= 2.7.6 and JUnit >= 4.0 After installing the prerequisites, a simple call to +``` $ mvn install +``` in the jtestdataaccessor directory should compile, unit test and install the jtestdataaccessor library into the local Maven repository under ~/.m2. To create a .jar from the project, +``` $ mvn package +``` can be used. The generated .jar file will be stored in the target/ directory. Since the .jar does not include AntLR and JUnit, they need to be on the classpath when using the library. This can be avoided by using +``` $ mvn assembly:assembly +``` which will create target/jtestdataaccessor-bin.jar which includes those two libraries as well. Javadoc documentation (and more) can be created by +``` $ mvn site +``` which creates the target/site/ directory containing an overview of the project as well as the Javadoc documentation and the cross-referenced source code. Unfortunately, there might be a problem with the AntLR version used by the -Maven AntLR plugin [2] - if the unit tests fail (see below if Maven does not +[Maven AntLR plugin](http://maven.apache.org/plugins/maven-antlr-plugin/), if +the unit tests fail (see below if Maven does not even execute them because of missing dependencies), this is most likely the case. A workaround until the real problem is fixed is to modify the file -~/.m2/repository/org/apache/maven/plugins/maven-antlr-plugin/2.0-beta-1/maven-antlr-plugin-2.0-beta-1.pom +`~/.m2/repository/org/apache/maven/plugins/maven-antlr-plugin/2.0-beta-1/maven-antlr-plugin-2.0-beta-1.pom` (or similar, if the problem persists in future releases after adapting the pom.xml file to use such a release) by changing the AntLR dependency of groupId = antlr, artifactId = antlrall to groupId = antlr, artifactId = antlr and version = 2.7.7 - after calling +``` $ mvn clean +``` to cleanup the generated and compiled sources, +``` $ mvn install +``` should succeed. The other problem is the missing support for Junit 4 in the current surefire plugin, so the unit tests might not be executable at all. This can be solved by -adding the settings from [3] in ~/.m2/settings.xml - when doing so, the '...' -need to be replaced by and , respectively. Now +adding the settings from the [Maven Snapshot Guide](http://maven.apache.org/guides/development/guide-plugin-snapshot-repositories.html) +in `~/.m2/settings.xml` - when doing so, the '...' +need to be replaced by `` and ``, respectively. Now +``` $ mvn -Papache install +``` should finally succeed (-Papache should be required only once, and the snapshot will be updated periodically afterwards). -Usage -***** +##Usage To use the library, a depedency in the pom.xml of the project which looks like +```xml ch.ethz.infsec.jtestdataaccessor jtestdataaccessor 1.0-SNAPSHOT test +``` can be used. The library is then added to the classpath during unit testing and may therefore be used in those tests. Some examples of the usage may be found -in the src/test/ subtree. +in the [src/test/](./src/test/) subtree. -References -********** -[1] Apache Maven. - http://maven.apache.org/ -[2] Maven AntLR Plugin - http://maven.apache.org/plugins/maven-antlr-plugin/ -[3] Maven Snapshot Guide. - http://maven.apache.org/guides/development/guide-plugin-snapshot-repositories.html - - -$Id$