How to do Unit Testing of SmartPaste override
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 40
- Joined: Wed Jan 29, 2014 4:30 pm
How to do Unit Testing of SmartPaste override
Hi,
We have a custom doctype, and have customized the SmartPaste feature by taking a copy of the Docbook XSLT files in our ${framework}/resources folder and we have updated them to adapt the conversion to our DTD. In Oxygen Author, I can now copy a section, table or list from MS Word and paste it as a valid XML fragment in my document. So far, so good...
Now, I would like to do some Unit Testing of the XSLT stylesheets in my Eclipse project.
I tried to use Juxy, but when my test case is loading the XSLT it crashes with an exception
Note that I have some simple test cases, based on Juxy and using a rather modest XSLT, that work OK.
Therefore, my interpretation of the error is that the SmartPaste XSLT requires some function which is available only in Saxon EE and this version of Saxon is embedded in the Oxygen Auhor, which explain why it runs with no error in the editor; but is not included in the SDK, which causes the exception when running my unit test.
Is this correct ?
If yes, shouldn't you provide Saxon EE also in the SDK ?
Or is there another way to do unit testing of the XHTML2zzz.xsl stylesheet ?
Thanks for your help,
Pascale
We have a custom doctype, and have customized the SmartPaste feature by taking a copy of the Docbook XSLT files in our ${framework}/resources folder and we have updated them to adapt the conversion to our DTD. In Oxygen Author, I can now copy a section, table or list from MS Word and paste it as a valid XML fragment in my document. So far, so good...
Now, I would like to do some Unit Testing of the XSLT stylesheets in my Eclipse project.
I tried to use Juxy, but when my test case is loading the XSLT it crashes with an exception
Code: Select all
java.lang.NoClassDefFoundError: com/saxonica/bytecode/ExpressionCompiler
at net.sf.saxon.style.XSLMessage.compile(XSLMessage.java:130)
...
at org.tigris.juxy.JuxyTestCase.applyTemplates(JuxyTestCase.java:82)
...
Caused by: java.lang.ClassNotFoundException: com.saxonica.bytecode.ExpressionCompiler
...
Therefore, my interpretation of the error is that the SmartPaste XSLT requires some function which is available only in Saxon EE and this version of Saxon is embedded in the Oxygen Auhor, which explain why it runs with no error in the editor; but is not included in the SDK, which causes the exception when running my unit test.
Is this correct ?
If yes, shouldn't you provide Saxon EE also in the SDK ?
Or is there another way to do unit testing of the XHTML2zzz.xsl stylesheet ?
Thanks for your help,
Pascale
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: How to do Unit Testing of SmartPaste override
Post by sorin_ristache »
Hi,
Regards,
Sorin
The com/saxonica/bytecode/ExpressionCompiler class looks like a juxy requirement. The XSLT stylesheets used for the smart paste work with Saxon PE too. Saxon EE is not required.Pascale wrote:I tried to use Juxy, but when my test case is loading the XSLT it crashes with an exceptionCode: Select all
java.lang.NoClassDefFoundError: com/saxonica/bytecode/ExpressionCompiler
at net.sf.saxon.style.XSLMessage.compile(XSLMessage.java:130)
...
at org.tigris.juxy.JuxyTestCase.applyTemplates(JuxyTestCase.java:82)
...
Caused by: java.lang.ClassNotFoundException: com.saxonica.bytecode.ExpressionCompiler
...
Did you try to set Saxon PE instead of Saxon EE as the XSLT processor in juxy? That should remove any Saxon EE class requirement and should run the smart paste stylesheets without errors.Pascale wrote:Therefore, my interpretation of the error is that the SmartPaste XSLT requires some function which is available only in Saxon EE and this version of Saxon is embedded in the Oxygen Auhor, which explain why it runs with no error in the editor
...
Or is there another way to do unit testing of the XHTML2zzz.xsl stylesheet ?
Regards,
Sorin
-
- Posts: 40
- Joined: Wed Jan 29, 2014 4:30 pm
Re: How to do Unit Testing of SmartPaste override
Hi Sorin,
thanks for your answer.
We investigated a bit around Juxy and could not find a solution for our case, so we are wondering if we could use XSpec instead.
We however want to run the Unit Tests from our Eclipse/Jenkins integrated development environment.
Do you have any experience doing this, and any tip or advice to share with us ?
Kind regards,
Pascale
thanks for your answer.
We investigated a bit around Juxy and could not find a solution for our case, so we are wondering if we could use XSpec instead.
We however want to run the Unit Tests from our Eclipse/Jenkins integrated development environment.
Do you have any experience doing this, and any tip or advice to share with us ?
Kind regards,
Pascale
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: How to do Unit Testing of SmartPaste override
Post by sorin_ristache »
Hi Pascale,
We have only JUnit tests for the Smart Paste transformations. I think you can add XSpec tests to your code and run them on a Jenkins server by using this Maven plugin for XSpec. This Maven plugin allows you to add your tests in the src/test/xspec subdirectory of the plugin directory and after that just declare this plugin for XSpec in your pom.xml, because it is already deployed on Maven Central. I have not tested it, but I think there are people that already use it.
Regards,
Sorin
We have only JUnit tests for the Smart Paste transformations. I think you can add XSpec tests to your code and run them on a Jenkins server by using this Maven plugin for XSpec. This Maven plugin allows you to add your tests in the src/test/xspec subdirectory of the plugin directory and after that just declare this plugin for XSpec in your pom.xml, because it is already deployed on Maven Central. I have not tested it, but I think there are people that already use it.
Regards,
Sorin
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service