Webapp-Rule

Junit Rules for web app integration testing

Лицензия

Лицензия

Категории

Категории

JUnit Тестирование компонентов
Группа

Группа

com.unseenspace.junit
Идентификатор

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

webapp-rule
Последняя версия

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

0.1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Webapp-Rule
Junit Rules for web app integration testing
Система контроля версий

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

http://github.com/bornskilled200/webapp-rule/tree/master

Скачать webapp-rule

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

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

Зависимости

compile (11)

Идентификатор библиотеки Тип Версия
org.eclipse.jetty : jetty-server jar 9.3.7.v20160115
org.eclipse.jetty : jetty-annotations jar 9.3.7.v20160115
org.eclipse.jetty : jetty-webapp jar 9.3.7.v20160115
org.eclipse.jetty : jetty-jndi jar 9.3.7.v20160115
org.eclipse.jetty : jetty-plus jar 9.3.7.v20160115
org.eclipse.jetty : apache-jsp jar 9.3.7.v20160115
org.eclipse.jetty : apache-jstl jar 9.3.7.v20160115
com.h2database : h2 jar 1.4.186
net.sourceforge.htmlunit : htmlunit jar 2.19
commons-io : commons-io jar 2.4
junit : junit jar 4.12

test (2)

Идентификатор библиотеки Тип Версия
org.hamcrest : hamcrest-all jar 1.3
org.mockito : mockito-core jar 2.0.5-beta

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

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

webapp-rule

Simple rules to reduce boilerplate when integration testing for web apps.

public class IntegrationTest {
  public static H2DataSourceRule dataSourceRule = new H2DataSourceRule("test");

  public static JettyRule jettyRule = JettyRule.builder()
          .webapp()
          .jars("shiro-web", "struts")
          .jsp()
          .jndi()
          .jndi("hospital", dataSourceRule.getDataSource())
          .jndi("hibernate.dialect", "org.hibernate.dialect.H2Dialect")
          .jndi("hibernate.hbm2ddl.auto", "update")
          .build();

  @ClassRule
  public static TestRule testRule = RuleChain.outerRule(dataSourceRule).around(jettyRule);
  
  @Rule
  public HtmlUnitRule htmlUnitRule = new HtmlUnitRule();
  
  @Test
  public void testConnection() {
    assertThat(htmlUnitRule.getWebClient().getPage(jettyRule.getUrl()).getWebResponse().getStatusCode(), is(200)));
  }
}

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

Версия
0.1.1
0.1