Skip to content

oboehm/maven-ooo-plugin-it

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Integration Test for maven-ooo-plugin

This is the integration test project for the maven-ooo-plugin. The use of this plugin is described on the OpenOffice.org wiki article OpenOffice Maven2 Integration.

This README file is used as input file for FIT which understands only HTML. So don’t wonder about the .textile suffix of this README. It is used because github supports this kind of README but you will find no textile syntax inside, only HTML.

fit.ActionFixture
start org.openoffice.maven.it.fixture.FileFixture
enter deleteDir ooo-ext-test

To begin with the example we must first delete the created artifact directory from the last try.

Features

The structure of this README follows the structure of OpenOffice Maven2 Integration and adds the table neeed for the integration tests of the maven-ooo-plugin.

Generating an Extension project

This will be done, by using a maven archetype for Uno projects.

fit.ActionFixture
start org.openoffice.maven.it.fixture.MvnShell
enter addArgument archetype:generate
enter addArgument -DnewGroupId=org.openoffice.dev.tests
enter addArgument -DnewArtifactId=ooo-ext-test
enter addArgument -DnewVersion=0.1-SNAPSHOT
enter addArgument -Dpackage=org.openoffice.dev
enter addArgument -DarchetypeGroupId=org.openoffice.dev
enter addArgument -DarchetypeArtifactId=maven-ooo-plugin
enter addArgument -DarchetypeVersion=1.1-RC1
press run
check getExitCode 0

As a result you’ll get a Maven project which can be validated using ‘mvn validate’:

fit.ActionFixture
start org.openoffice.maven.it.fixture.MvnShell
enter changeWorkingDir ooo-ext-test
enter addArgument validate
press run
check getExitCode 0

The following files will be generated by ‘mvn archetype:generate -DartifactId=ooo-ext-test…’:

org.openoffice.maven.it.fixture.FileFixture
file type() comment
ooo-ext-test/pom.xml file example POM
ooo-ext-test/src/main/idl dir directory for IDL sources
ooo-ext-test/src/main/idl/hello/WorldInterface.idl file sample IDL
ooo-ext-test/src/main/java dir directory for Java sources
ooo-ext-test/src/main/java/org/openoffice/dev/RegistrationHandler.java file registration handler
ooo-ext-test/src/main/java/org/openoffice/dev/DemoAddOn.java file a little demo addon
ooo-ext-test/src/main/resources dir directory for resources
ooo-ext-test/src/main/resources/org/openoffice/dev/RegistrationHandler.classes file input resource for RegistrationHandler

Creating a new UNO type implementation

This feature is not yet developed.

Building the IDL files

The Java classes corresponding to the UNO types defined in the IDL files are generated before the Java compilation phase.

fit.ActionFixture
start org.openoffice.maven.it.fixture.MvnShell
enter changeWorkingDir ooo-ext-test
enter addArgument generate-sources
press run
check getExitCode 0

The following files will be generated by ‘mvn generate-sources’ (see Components creation process for an overview about the UNO commands):

org.openoffice.maven.it.fixture.FileFixture
file type() comment
ooo-ext-test/target/urd dir output for the idlc command
ooo-ext-test/target/urd/hello/WorldInterface.urd file the compiled WorldInterface.idl
ooo-ext-test/target/types.rdb file result of the regmerge command

Generating the OOo-Plugin

With ‘mvn package’ the OpenOffice extension will be generated:

fit.ActionFixture
start org.openoffice.maven.it.fixture.MvnShell
enter changeWorkingDir ooo-ext-test
enter addArgument package
press run
check getExitCode 0

You’ll find the generated plugin in the target directory:

org.openoffice.maven.it.fixture.FileFixture
file type() comment
ooo-ext-test/target/ooo-ext-test-0.1-SNAPSHOT.oxt file the generated OOo extension

Installation…

Before we test the installation to the local Maven repository we delete first
the directory with the installed artifact:




fit.ActionFixture
start org.openoffice.maven.it.fixture.FileFixture
enter deleteDir ${user.home}/.m2/repository/org/openoffice/dev/tests/ooo-ext-test

…as Maven Artifact

Normally the generated OOo plugin is installed direct as OOo plugin. If you don’t want this and want to install the OOo plugin as artifact into your local Maven repository you can use the system property “org.openoffice.maven.install=repository”:

fit.ActionFixture
start org.openoffice.maven.it.fixture.MvnShell
enter changeWorkingDir ooo-ext-test
enter addArgument install
enter addArgument -Dorg.openoffice.maven.install=repository
press run
check getExitCode 0

In this case the generated OOo plugin is not install into OpenOffice but you find it in your local Maven repository which is normally located into your home directory under “.m2/repository”:

org.openoffice.maven.it.fixture.FileFixture
file type() comment
${user.home}/.m2/repository/org/openoffice/dev/tests/ooo-ext-test/0.1-SNAPSHOT dir directory with artifact of version 0.1-SNAPSHOT
${user.home}/.m2/repository/org/openoffice/dev/tests/ooo-ext-test/0.1-SNAPSHOT/ooo-ext-test-0.1-SNAPSHOT.oxt file installed artifact
${user.home}/.m2/repository/org/openoffice/dev/tests/ooo-ext-test/0.1-SNAPSHOT/ooo-ext-test-0.1-SNAPSHOT.pom file POM file

…as OOo-Plugin

Be sure thet the plugin isn’t installed already. If yes call ‘unopkg remove ooo-ext-test-0.1-SNAPSHOT.oxt’. Then you can install the generated OOo plugin of the previous step with the ‘unopkg’ command (‘unopkg add -v ooo-ext-test-0.1-SNAPSHOT.oxt’). Or you can use the install phase of Maven and call ‘mvn install’:

fit.ActionFixture
start org.openoffice.maven.it.fixture.CmdShell
enter setCommand unopkg
enter addArgument remove
enter addArgument ooo-ext-test-0.1-SNAPSHOT.oxt
press run
start org.openoffice.maven.it.fixture.MvnShell
enter changeWorkingDir ooo-ext-test
enter addArgument install
press run
check getExitCode 0

To verify if the OOo plugin is really installed you can start OpenOffice and select the extension manager of you can use ‘unopkg list’ from the commandline. If you start ‘unopkg’ be sure OpenOpffice is not running!

Uninstalling the OOo-Plugin

You can use OpenOffice’s extension manager or ‘unopkg remove ooo-ext-test-0.1-SNAPSHOT.oxt’ to deinstall the OOo plugin:

fit.ActionFixture
start org.openoffice.maven.it.fixture.CmdShell
enter setCommand unopkg
enter addArgument remove
enter addArgument ooo-ext-test-0.1-SNAPSHOT.oxt
press run
check getExitCode 0

To verify if the OOo plugin is really deinstalled you can start ‘unopkg list’ from the commandline and see if plugin is absent.

Appendix

History

org.openoffice.maven.it.fixture.IgnoreFixture
Date Remarks
02-Nov-2010 created

Summary

The following table will be filled by FIT if you use this document as input file.

fit.Summary