Hippo Unit Tester

Hippo Unit Tester is framework aimed at simplifying unit testing of Hippo CMS

Лицензия

Лицензия

Группа

Группа

nl.openweb.hippo
Идентификатор

Идентификатор

hippo-unit-tester
Последняя версия

Последняя версия

2.2.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Hippo Unit Tester
Hippo Unit Tester is framework aimed at simplifying unit testing of Hippo CMS
Ссылка на сайт

Ссылка на сайт

https://github.com/openweb-nl/hippo-unit-tester
Организация-разработчик

Организация-разработчик

Open Web IT
Система контроля версий

Система контроля версий

https://github.com/openweb-nl/hippo-unit-tester

Скачать hippo-unit-tester

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/nl.openweb.hippo/hippo-unit-tester/ -->
<dependency>
    <groupId>nl.openweb.hippo</groupId>
    <artifactId>hippo-unit-tester</artifactId>
    <version>2.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/nl.openweb.hippo/hippo-unit-tester/
implementation 'nl.openweb.hippo:hippo-unit-tester:2.2.1'
// https://jarcasting.com/artifacts/nl.openweb.hippo/hippo-unit-tester/
implementation ("nl.openweb.hippo:hippo-unit-tester:2.2.1")
'nl.openweb.hippo:hippo-unit-tester:jar:2.2.1'
<dependency org="nl.openweb.hippo" name="hippo-unit-tester" rev="2.2.1">
  <artifact name="hippo-unit-tester" type="jar" />
</dependency>
@Grapes(
@Grab(group='nl.openweb.hippo', module='hippo-unit-tester', version='2.2.1')
)
libraryDependencies += "nl.openweb.hippo" % "hippo-unit-tester" % "2.2.1"
[nl.openweb.hippo/hippo-unit-tester "2.2.1"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
nl.openweb.jcr : jcr-mocking-tool jar 1.3.3
nl.openweb.jcr : in-memory-jcr jar hippo-1.3.3
org.onehippo.cms7.hst » hst-mock jar
org.onehippo.cms7.hst » hst-content-beans jar

provided (3)

Идентификатор библиотеки Тип Версия
org.onehippo.cms7.hst.dependencies » hst-spring-dependencies pom
org.onehippo.cms7.hst.dependencies » hst-client-dependencies pom
org.onehippo.cms7.hst.dependencies » hst-server-dependencies pom

test (3)

Идентификатор библиотеки Тип Версия
org.onehippo.cms7 » hippo-essentials-components-hst jar
junit : junit jar 4.13.1
org.mockito : mockito-core jar 2.10.0

Модули Проекта

Данный проект не имеет модулей.

Hippo Unit Tester

Hippo Unit Tester is a framework that tries to take advantage of JCR mocking solutions and Hippo Mock objects to setup a mock Hippo API. It tries to be as realistic as possible while still be highly manipulatable. In order to enable developers to focus on designing their unit tests scenarios instead of focusing on technical details mocking process.

Installation

  1. Add dependency to pom.xml
<dependencyManagement>
  <dependencies>
    <dependency>
        <groupId>nl.openweb.hippo</groupId>
        <artifactId>hippo-unit-tester</artifactId>
        <version>2.2.0</version>
        <scope>test</scope>
    </dependency>
    ...
  </dependencies>
</dependencyManagement>
  1. Add dependency to site pom.xml.
<dependency>
    <groupId>nl.openweb.hippo</groupId>
    <artifactId>hippo-unit-tester</artifactId>
</dependency>

Usage

Within the package there are classes to extend from:

  • BaseHippoTest
  • SimpleHippoTest

Importer

The importer works with JSON or XML. It will import the file at given location.

XML

<sv:node sv:name="news1">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>hippo:handle</sv:value>
    </sv:property>
    <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
        <sv:value>mix:referenceable</sv:value>
    </sv:property>
    <sv:property sv:name="jcr:uuid" sv:type="String">
        <sv:value>3119bd98-9361-4b78-a81b-ad8228bc8bfb</sv:value>
    </sv:property>
    <sv:node sv:name="news1">
        <sv:property sv:name="jcr:primaryType" sv:type="Name">
            <sv:value>ns:NewsPage</sv:value>
        </sv:property>
        ...
    </sv:node>
</sv:node>

JSON

 

Debug

/**
* prints out the whole JCR structure
*/
printNodeStructure();

/**
* prints out the JCR structure from given path
*/
printNodeStructure("/path");

Explain

/**
* When you want to create you own namespace
*/
registerNodeType("ns:custom");
/**
* eForms needs a Local to be set
*/
request.setLocale(new Locale("nl_NL"));
/**
 * From the given file create a node containing the content of imported file
 * Location should contain the path the node should be created not where you want to import the file
**/
importer.createNodesFromXml(getResourceAsStream("/nl/openweb/hippo/demo/news.xml"), "/content/documents/mychannel/news", "hippostd:folder");

Demo

One of the best ways to learn about how to use this library is by looking at an example

nl.openweb.hippo

Open Web

Software development and open source is in our DNA. Development, contracting, maintenance and management. Discover what Open Web professionals can do for you.

Версии библиотеки

Версия
2.2.1
2.2.0
2.1.2
2.1.1
2.1.0