PluginWorkspaceTCBase class moved?

Post here questions and problems related to oXygen frameworks/document types.
vanakenm
Posts: 4
Joined: Thu Jun 12, 2014 11:17 am

PluginWorkspaceTCBase class moved?

Post by vanakenm »

Hi Oxygen team,
We've developed a plugin for Oxygen (customization for our specific document type and some custom actions). We've used class PluginWorkspaceTCBase as a base for an integration test.

We recently moved to version 16.0 and updated our plugin according to the API changes.

Our problem is that the PluginWorkspaceTCBase class does no (no more?) exists in the sdk/oxygen.jar that our plugin depends on. Surprisingly, if I open the jar from my Oxygen installation lib folder, the class is there.

So: it exists in the runtime jar, not in the SDK jar. I actually expected the opposite. If we want to continue to use the PluginWorkspaceTCBase what would you advise?

Thanks,

Martin
alex_jitianu
Posts: 1016
Joined: Wed Nov 16, 2005 11:11 am

Re: PluginWorkspaceTCBase class moved?

Post by alex_jitianu »

Hello Martin,

First of all I'm sorry for the late reply. The Oxygen SDK tries to be as lightweight as possible and we didn't add PluginWorkspaceTCBase in it because this class needs a lot more JARs and classes. But I agree that it should be possible in the Maven project to write tests and PluginWorkspaceTCBase is very helpful for that. We will think of a solution, but until then, I can suggest one of the following:
- Create another Eclipse project for writing tests as described in Creating and Running Automated Tests.
- Modify the pom.xml of your Maven project to add the needed libraries from an Oxygen installation directory. We've tried that with one of the sample plugins and we managed to run the test (the dependencies section is of interest):

Code: Select all


<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>apiTest</groupId>
<artifactId>oxygen-sample-plugins</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>oxygen-sample-plugin-impose-options</artifactId>
<dependencies>
<dependency>
<groupId>net.sf.jfcunit</groupId>
<artifactId>jfcunit</artifactId>
<version>2.08</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.oxygenxml</groupId>
<artifactId>oxygen</artifactId>
<version>16.0.0</version>
<scope>system</scope>
<systemPath>D:\Oxygen XML Editor 16\lib\oxygen.jar</systemPath>
</dependency>

<dependency>
<groupId>com.oxygenxml</groupId>
<artifactId>jide</artifactId>
<version>16.0.0</version>
<scope>system</scope>
<systemPath>D:\Oxygen XML Editor 16\lib\jide.jar</systemPath>
</dependency>
<dependency>
<groupId>com.oxygenxml</groupId>
<artifactId>token-markers</artifactId>
<version>16.0.0</version>
<scope>system</scope>
<systemPath>D:\Oxygen XML Editor 16\lib\oxygen-token-markers.jar</systemPath>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>4.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oxygenxml</groupId>
<artifactId>oxygen-text-search</artifactId>
<version>16.0.0</version>
<scope>system</scope>
<systemPath>D:\Oxygen XML Editor 16\lib\oxygen-text-search.jar</systemPath>
</dependency>

<dependency>
<groupId>com.oxygenxml</groupId>
<artifactId>oxygen-sdk</artifactId>
<version>16.0.0</version>
<exclusions>
<exclusion>
<groupId>com.oxygenxml</groupId>
<artifactId>oxygen</artifactId>
<version>16.0.0</version>

</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Best regards,
Alex
vanakenm
Posts: 4
Joined: Thu Jun 12, 2014 11:17 am

Re: PluginWorkspaceTCBase class moved?

Post by vanakenm »

Hi,
Thanks for the answer, this make sense. Just to be sure I understand you well, you propose to add the runtime jar as a dependency, but only for the tests. Is there no risk of conflict between the oxygen-sdk jar and the oxygen-runtime jar?

Martin
alex_jitianu
Posts: 1016
Joined: Wed Nov 16, 2005 11:11 am

Re: PluginWorkspaceTCBase class moved?

Post by alex_jitianu »

Hello,

Something like that. Unfortunately you are forced to use the system scope on the dependency (is required when using systemPath) so you can't just use it for tests. You'll always use these jars instead of the default one. But that's why I've excluded the default oxygen jar:

Code: Select all

<dependency>
<groupId>com.oxygenxml</groupId>
<artifactId>oxygen-sdk</artifactId>
<version>16.0.0</version>
<exclusions>
<exclusion>
<groupId>com.oxygenxml</groupId>
<artifactId>oxygen</artifactId>
<version>16.0.0</version>

</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
If you have an internal maven repository you could publish as artifacts these runtime jars (the ones from an Oxygen installation) and afterwards, when declaring the dependencies, you could use the test scope:

Code: Select all


<dependency>
<groupId>com.oxygenxml</groupId>
<artifactId>oxygen.runtime.jar</artifactId>
<version>16.0.0</version>
<scope>test</scope>
</dependency>
Best regards,
Alex
Post Reply