Move mongodb tests from jetty-nosql module to common test module. Activate during build with -Dmongodb.enabled=true

This commit is contained in:
Jan Bartel 2012-02-10 14:19:13 +11:00
parent e1bbb73c11
commit 4a180eef3b
16 changed files with 163 additions and 8 deletions

View File

@ -32,5 +32,6 @@
<module>test-sessions-common</module> <module>test-sessions-common</module>
<module>test-hash-sessions</module> <module>test-hash-sessions</module>
<module>test-jdbc-sessions</module> <module>test-jdbc-sessions</module>
<module>test-mongodb-sessions</module>
</modules> </modules>
</project> </project>

View File

@ -0,0 +1,140 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
// ========================================================================
// Copyright (c) Webtide LLC
//
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.apache.org/licenses/LICENSE-2.0.txt
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
-->
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.jetty.tests</groupId>
<artifactId>test-sessions-parent</artifactId>
<version>7.6.1-SNAPSHOT</version>
</parent>
<artifactId>test-mongo-sessions</artifactId>
<name>Jetty Tests :: Sessions :: Mongo</name>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<!-- DO NOT DEPLOY (or Release) -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>generate-test-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-test-policy</artifactId>
<version>${jetty-test-policy-version}</version>
<type>jar</type>
<overWrite>true</overWrite>
<includes>**/*.keystore,**/*.pem</includes>
<outputDirectory>${jetty.test.policy.loc}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.tests</groupId>
<artifactId>test-sessions-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-nosql</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jmx</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>mongodb</id>
<activation>
<property>
<name>mongodb.enabled</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>false</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -26,7 +26,6 @@ public class ClientCrossContextSessionTest extends AbstractClientCrossContextSes
} }
@Test @Test
@Ignore ("requires mongodb server")
public void testCrossContextDispatch() throws Exception public void testCrossContextDispatch() throws Exception
{ {
super.testCrossContextDispatch(); super.testCrossContextDispatch();

View File

@ -26,7 +26,6 @@ public class LastAccessTimeTest extends AbstractLastAccessTimeTest
} }
@Test @Test
@Ignore ("requires mongodb server")
public void testLastAccessTime() throws Exception public void testLastAccessTime() throws Exception
{ {
super.testLastAccessTime(); super.testLastAccessTime();

View File

@ -30,7 +30,6 @@ public class LightLoadTest extends AbstractLightLoadTest
} }
@Test @Test
@Ignore ("requires mongodb server")
public void testLightLoad() throws Exception public void testLightLoad() throws Exception
{ {
super.testLightLoad(); super.testLightLoad();

View File

@ -30,7 +30,6 @@ public class NewSessionTest extends AbstractNewSessionTest
} }
@Test @Test
@Ignore ("requires mongodb server")
public void testNewSession() throws Exception public void testNewSession() throws Exception
{ {
super.testNewSession(); super.testNewSession();

View File

@ -29,7 +29,6 @@ public class OrphanedSessionTest extends AbstractOrphanedSessionTest
} }
@Test @Test
@Ignore ("requires mongodb server")
public void testOrphanedSession() throws Exception public void testOrphanedSession() throws Exception
{ {
super.testOrphanedSession(); super.testOrphanedSession();

View File

@ -29,7 +29,6 @@ public class ReentrantRequestSessionTest extends AbstractReentrantRequestSession
} }
@Test @Test
@Ignore ("requires mongodb server")
public void testReentrantRequestSession() throws Exception public void testReentrantRequestSession() throws Exception
{ {
super.testReentrantRequestSession(); super.testReentrantRequestSession();

View File

@ -26,7 +26,6 @@ public class RemoveSessionTest extends AbstractRemoveSessionTest
} }
@Test @Test
@Ignore ("requires mongodb server")
public void testRemoveSession() throws Exception public void testRemoveSession() throws Exception
{ {
super.testRemoveSession(); super.testRemoveSession();

View File

@ -26,7 +26,6 @@ public class ServerCrossContextSessionTest extends AbstractServerCrossContextSes
} }
@Test @Test
@Ignore ("requires mongodb server")
public void testCrossContextDispatch() throws Exception public void testCrossContextDispatch() throws Exception
{ {
super.testCrossContextDispatch(); super.testCrossContextDispatch();

View File

@ -0,0 +1,22 @@
#
# This file defines users passwords and roles for a HashUserRealm
#
# The format is
# <username>: <password>[,<rolename> ...]
#
# Passwords may be clear text, obfuscated or checksummed. The class
# org.eclipse.util.Password should be used to generate obfuscated
# passwords or password checksums
#
# If DIGEST Authentication is used, the password must be in a recoverable
# format, either plain text or OBF:.
#
# if using digest authentication, do not MD5-hash the password
jetty: jetty,user
admin: CRYPT:ad1ks..kc.1Ug,server-administrator,content-administrator,admin,user
other: OBF:1xmk1w261u9r1w1c1xmq,user
plain: plain,user
user: password,user
# This entry is for digest auth. The credential is a MD5 hash of username:realmname:password
digest: MD5:6e120743ad67abfbc385bc2bb754e297,user