[Releng] First Unit test
- add a plugin plugins/org.eclipse.gendoc.batch.tests/
- implements very basic tests
Change-Id: I38833e9fd81f876e16716a4bc0e930fa7329375b
Signed-off-by: Benoit Maggi <benoit.maggi@cea.fr>
diff --git a/pom.xml b/pom.xml
index fe48e97..5de0d71 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,9 @@
<module>plugins/org.eclipse.gendoc.wizard.gmf</module>
<module>plugins/org.eclipse.gendoc.wizard.papyrus</module>
<module>plugins/org.eclipse.gendoc.documents.image.svg</module>
-
+
+ <module>tests/org.eclipse.gendoc.batch.tests</module>
+
<module>features/org.eclipse.gendoc.feature</module>
<module>features/org.eclipse.gendoc.papyrus.feature</module>
<module>features/org.eclipse.gendoc.sirius.feature</module>
diff --git a/tests/org.eclipse.gendoc.batch.tests/.classpath b/tests/org.eclipse.gendoc.batch.tests/.classpath
new file mode 100755
index 0000000..eca7bdb
--- /dev/null
+++ b/tests/org.eclipse.gendoc.batch.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.gendoc.batch.tests/.project b/tests/org.eclipse.gendoc.batch.tests/.project
new file mode 100755
index 0000000..c164b58
--- /dev/null
+++ b/tests/org.eclipse.gendoc.batch.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.gendoc.batch.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/org.eclipse.gendoc.batch.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.gendoc.batch.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 0000000..0c68a61
--- /dev/null
+++ b/tests/org.eclipse.gendoc.batch.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/tests/org.eclipse.gendoc.batch.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.gendoc.batch.tests/META-INF/MANIFEST.MF
new file mode 100755
index 0000000..98d45ba
--- /dev/null
+++ b/tests/org.eclipse.gendoc.batch.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Gendoc Batch mode tests
+Bundle-SymbolicName: org.eclipse.gendoc.batch.tests
+Bundle-Version: 0.6.0.qualifier
+Fragment-Host: org.eclipse.gendoc.batch
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.junit
diff --git a/tests/org.eclipse.gendoc.batch.tests/build.properties b/tests/org.eclipse.gendoc.batch.tests/build.properties
new file mode 100755
index 0000000..34d2e4d
--- /dev/null
+++ b/tests/org.eclipse.gendoc.batch.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/tests/org.eclipse.gendoc.batch.tests/pom.xml b/tests/org.eclipse.gendoc.batch.tests/pom.xml
new file mode 100755
index 0000000..01836f1
--- /dev/null
+++ b/tests/org.eclipse.gendoc.batch.tests/pom.xml
@@ -0,0 +1,12 @@
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.gendoc</groupId>
+ <artifactId>parent</artifactId>
+ <relativePath>../../pom.xml</relativePath>
+ <version>0.6.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.gendoc.batch.tests</artifactId>
+ <packaging>eclipse-test-plugin</packaging>
+</project>
\ No newline at end of file
diff --git a/tests/org.eclipse.gendoc.batch.tests/src/org/eclipse/gendoc/batch/tests/ArgOptTest.java b/tests/org.eclipse.gendoc.batch.tests/src/org/eclipse/gendoc/batch/tests/ArgOptTest.java
new file mode 100755
index 0000000..fe81300
--- /dev/null
+++ b/tests/org.eclipse.gendoc.batch.tests/src/org/eclipse/gendoc/batch/tests/ArgOptTest.java
@@ -0,0 +1,29 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.gendoc.batch.tests;
+
+import org.eclipse.gendoc.batch.ArgOpt;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ArgOptTest {
+
+ @Test
+ public void testArgOptCreation() {
+ ArgOpt argOpt = new ArgOpt("input_DocTemplate", ArgOpt.REQUIRED_ARGUMENT, ArgOpt.REQUIRED_ARGUMENT_VALUE, "idt",
+ "input document template URL ");
+ Assert.assertEquals("ArgOpt should be required", ArgOpt.REQUIRED_ARGUMENT, argOpt.getArg_type());
+ }
+
+}
+
diff --git a/tests/org.eclipse.gendoc.batch.tests/src/org/eclipse/gendoc/batch/tests/GetOptTest.java b/tests/org.eclipse.gendoc.batch.tests/src/org/eclipse/gendoc/batch/tests/GetOptTest.java
new file mode 100755
index 0000000..49ee049
--- /dev/null
+++ b/tests/org.eclipse.gendoc.batch.tests/src/org/eclipse/gendoc/batch/tests/GetOptTest.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.gendoc.batch.tests;
+
+import static org.junit.Assert.fail;
+
+import org.eclipse.gendoc.batch.GetOpt;
+import org.junit.Test;
+
+public class GetOptTest {
+
+ @Test(expected=Exception.class)
+ public void testGetArguments() throws Exception {
+ GetOpt getOpt = new GetOpt();
+ getOpt.getArguments(null, null);
+ }
+
+ @Test
+ public void testGetFlatArguments() {
+ //TODO fail("Not yet implemented");
+ }
+
+ @Test
+ public void testPrintHelpArgOptArrayPrintStream() {
+ //TODO fail("Not yet implemented");
+ }
+
+ @Test
+ public void testPrintHelpArgOptArray() {
+ //TODO fail("Not yet implemented");
+ }
+
+}