juxy

Juxy is a library for unit testing XSLT stylesheets from Java using JUnit.

License

License

GroupId

GroupId

de.theess.juxy
ArtifactId

ArtifactId

juxy
Last Version

Last Version

0.9.0
Release Date

Release Date

Type

Type

jar
Description

Description

juxy
Juxy is a library for unit testing XSLT stylesheets from Java using JUnit.
Project URL

Project URL

https://github.com/teetrinkers/juxy
Source Code Management

Source Code Management

https://github.com/teetrinkers/juxy

Download juxy

How to add to project

<!-- https://jarcasting.com/artifacts/de.theess.juxy/juxy/ -->
<dependency>
    <groupId>de.theess.juxy</groupId>
    <artifactId>juxy</artifactId>
    <version>0.9.0</version>
</dependency>
// https://jarcasting.com/artifacts/de.theess.juxy/juxy/
implementation 'de.theess.juxy:juxy:0.9.0'
// https://jarcasting.com/artifacts/de.theess.juxy/juxy/
implementation ("de.theess.juxy:juxy:0.9.0")
'de.theess.juxy:juxy:jar:0.9.0'
<dependency org="de.theess.juxy" name="juxy" rev="0.9.0">
  <artifact name="juxy" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.theess.juxy', module='juxy', version='0.9.0')
)
libraryDependencies += "de.theess.juxy" % "juxy" % "0.9.0"
[de.theess.juxy/juxy "0.9.0"]

Dependencies

compile (2)

Group / Artifact Type Version
commons-logging : commons-logging jar 1.1.1
junit : junit jar 4.10

Project Modules

There are no modules declared in this project.

Juxy

Juxy is a library for unit testing XSLT stylesheets from Java using JUnit.

This is a fork of juxy.tigris.org.

Quick introduction

Changes in this fork:

  • Converted the build system from Ant to Gradle.
  • Added samples written in Groovy.
  • New class JuxyTextSupport for JUnit4 tests.

Sample

The following example is a unit test written in Groovy. It uses the DOMBuilder to generate the input document inline in the test.

import groovy.xml.DOMBuilder
import org.junit.Test
import org.tigris.juxy.JuxyTestSupport;

public class TransformationTest extends JuxyTestSupport {
	@Test
	public void twoAuthors() {
		setStylesheet("src/test/resources/transform.xsl")
		
		setDocument(DOMBuilder.newInstance().books() {
			book() {
				authors() {
					author("Andrews, Bob")
					author("Cooper, Alice")
				} 
			}
		})

		def result = applyTemplates()

		xpathAssert("//author[1]/firstName", "Bob").eval(result)
		xpathAssert("//author[2]/firstName", "Alice").eval(result)
	}
}

Building

You don't need to have Gradle installed to build Juxy. The wrapper script "gradlew" will download Gradle automatically.

Build the sources:

gradlew build

Install the juxy jar into your local Maven repository:

gradlew install

To deploy the juxy jar to a remote Maven repository, set the properties 'uploadRepositoryUrl', 'uploadSnapshotRepositoryUrl', 'uploadRepositoryUsername', and 'uploadRepositoryPassword' in ~/.gradle/gradle.properties and call

gradlew uploadArchives

Generate Eclipse project files:

gradlew eclipse

Versions

Version
0.9.0