Skip to content

Commit

Permalink
Moved server plugintest to a separate module.
Browse files Browse the repository at this point in the history
This means that they can be part of the regular build now,
and don't have to be run separately.
  • Loading branch information
thobe committed Jul 30, 2013
1 parent 036edc8 commit 7d44cb6
Show file tree
Hide file tree
Showing 15 changed files with 2,986 additions and 54 deletions.
1 change: 1 addition & 0 deletions community/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<module>graphviz</module>
<module>server</module>
<module>server-examples</module>
<module>server-plugin-test</module>
<module>licensecheck-config</module>
</modules>

Expand Down
2,734 changes: 2,734 additions & 0 deletions community/server-plugin-test/LICENSES.txt

Large diffs are not rendered by default.

147 changes: 147 additions & 0 deletions community/server-plugin-test/NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
Neo4j
Copyright © 2002-2013 Network Engine for Objects in Lund AB (referred to
in this notice as "Neo Technology")
[http://neotechnology.com]

This product includes software ("Software") developed by Neo Technology.

The copyright in the bundled Neo4j graph database (including the
Software) is owned by Neo Technology. The Software developed and owned
by Neo Technology is licensed under the GNU GENERAL PUBLIC LICENSE
Version 3 (http://www.fsf.org/licensing/licenses/gpl-3.0.html) ("GPL")
to all third parties and that license, as required by the GPL, is
included in the LICENSE.txt file.

However, if you have executed an End User Software License and Services
Agreement or an OEM Software License and Support Services Agreement, or
another commercial license agreement with Neo Technology or one of its
affiliates (each, a "Commercial Agreement"), the terms of the license in
such Commercial Agreement will supersede the GPL and you may use the
software solely pursuant to the terms of the relevant Commercial
Agreement.

Full license texts are found in LICENSES.txt.

Third-party licenses
--------------------

ASM License
ASM Core

Apache Software License, Version 2.0
Apache ServiceMix Bundles: jline-0.9.94
Commons BeanUtils
Commons BeanUtils Core
Commons Collections
Commons Configuration
Commons Digester
Commons IO
Commons Lang
Commons Logging
ConcurrentLinkedHashMap
Data Mapper for Jackson
Jackson
JAX-RS provider for JSON content type
Jetty Server
Jetty Utilities
JTA 1.1
Lucene Core
RRD4J
Servlet Specification API

BSD - Scala License
Scala Library

BSD License
Janino

Bouncy Castle License
Legion of the Bouncy Castle Java Cryptography APIs

Common Development and Distribution License Version 1.1
jersey-core
jersey-multipart
jersey-server
jsr311-api
MIME streaming extension

Eclipse Public License, Version 1.0
Jetty Server
Jetty Utilities
Logback Access Module
Logback Classic Module
Logback Core Module

GNU General Public License, version 2 or later
Mozilla Rhino

GNU General Public License, version 2 with the Classpath Exception
jersey-core
jersey-multipart
jersey-server
jsr311-api
MIME streaming extension

GNU Lesser General Public License, Version 2.1
JAX-RS provider for JSON content type
Logback Access Module
Logback Classic Module
Logback Core Module

MIT License
SLF4J API Module

Mozilla Public License, Version 1.1
Mozilla Rhino

Dependencies with multiple licenses
-----------------------------------

JAX-RS provider for JSON content type
Apache Software License, Version 2.0
GNU Lesser General Public License, Version 2.1

Jetty Server
Apache Software License, Version 2.0
Eclipse Public License, Version 1.0

Jetty Utilities
Apache Software License, Version 2.0
Eclipse Public License, Version 1.0

Logback Access Module
Eclipse Public License, Version 1.0
GNU Lesser General Public License, Version 2.1

Logback Classic Module
Eclipse Public License, Version 1.0
GNU Lesser General Public License, Version 2.1

Logback Core Module
Eclipse Public License, Version 1.0
GNU Lesser General Public License, Version 2.1

MIME streaming extension
Common Development and Distribution License Version 1.1
GNU General Public License, version 2 with the Classpath Exception

Mozilla Rhino
GNU General Public License, version 2 or later
Mozilla Public License, Version 1.1

jersey-core
Common Development and Distribution License Version 1.1
GNU General Public License, version 2 with the Classpath Exception

jersey-multipart
Common Development and Distribution License Version 1.1
GNU General Public License, version 2 with the Classpath Exception

jersey-server
Common Development and Distribution License Version 1.1
GNU General Public License, version 2 with the Classpath Exception

jsr311-api
Common Development and Distribution License Version 1.1
GNU General Public License, version 2 with the Classpath Exception

87 changes: 87 additions & 0 deletions community/server-plugin-test/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<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.neo4j</groupId>
<artifactId>parent</artifactId>
<version>1.9.3-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>

<groupId>org.neo4j</groupId>
<artifactId>server-plugin-test</artifactId>
<version>1.9.3-SNAPSHOT</version>
<name>Neo4j - Server Plugin Tests</name>
<description>Tests the server plugin registration functionality.</description>

<properties>
<license-text.header>GPL-3-header.txt</license-text.header>
<docs-plugin.skip>true</docs-plugin.skip>
<licensing.prepend.text>notice-gpl-prefix.txt</licensing.prepend.text>
</properties>

<packaging>jar</packaging>

<scm>
<url>https://github.com/neo4j/neo4j/tree/master/community/server-plugin-test</url>
</scm>

<licenses>
<license>
<name>GNU General Public License, Version 3</name>
<url>http://www.gnu.org/licenses/gpl-3.0-standalone.html</url>
<comments>The software ("Software") developed and owned by Network Engine for
Objects in Lund AB (referred to in this notice as "Neo Technology") is
licensed under the GNU GENERAL PUBLIC LICENSE Version 3 to all third
parties and that license is included below.

However, if you have executed an End User Software License and Services
Agreement or an OEM Software License and Support Services Agreement, or
another commercial license agreement with Neo Technology or one of its
affiliates (each, a "Commercial Agreement"), the terms of the license in
such Commercial Agreement will supersede the GNU GENERAL PUBLIC LICENSE
Version 3 and you may use the Software solely pursuant to the terms of
the relevant Commercial Agreement.
</comments>
</license>
</licenses>

<dependencies>
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import javax.ws.rs.core.MediaType;

import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
Expand Down Expand Up @@ -190,7 +191,7 @@ public void shouldAdvertiseExtenstionThatPluginCreates() throws JsonParseExcepti
response.close();
response = new RestRequest().post( clonedSubgraphUri, "depth=" + CLONE_DEPTH_MUCH_LARGER_THAN_THE_GRAPH, MediaType.APPLICATION_FORM_URLENCODED_TYPE );

assertEquals( 200, response.getStatus() );
Assert.assertEquals( 200, response.getStatus() );

int doubleTheNumberOfNodes = ( originalCount * 2 ) + 1;
assertEquals( doubleTheNumberOfNodes, eagerlyCount( server.getDatabase().getGraph().getAllNodes() ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ public class ExtensionListingFunctionalTest extends SharedServerTestBase
@BeforeClass
public static void setupServer() throws IOException
{
functionalTestHelper = new FunctionalTestHelper( server() );
functionalTestHelper = new FunctionalTestHelper( SharedServerTestBase.server() );
}

@Before
public void cleanTheDatabase()
{
ServerHelper.cleanTheDatabase( server() );
ServerHelper.cleanTheDatabase( SharedServerTestBase.server() );
}

@Test
public void datarootContainsReferenceToExtensions() throws Exception {
JaxRsResponse response = RestRequest.req().get(functionalTestHelper.dataUri());
assertThat(response.getStatus(), equalTo(200));
assertThat(response.getStatus(), equalTo( 200 ));
Map<String, Object> json = JsonHelper.jsonToMap( response.getEntity() );
String extInfo = (String) json.get("extensions_info");
assertNotNull(new URI(extInfo));
Expand All @@ -68,7 +68,7 @@ public void datarootContainsReferenceToExtensions() throws Exception {
@Test
public void canListAllAvailableServerExtensions() throws Exception {
JaxRsResponse response = RestRequest.req().get(functionalTestHelper.extensionUri());
assertThat(response.getStatus(), equalTo(200));
assertThat(response.getStatus(), equalTo( 200 ));
Map<String, Object> json = JsonHelper.jsonToMap( response.getEntity() );
assertFalse(json.isEmpty());
response.close();
Expand All @@ -78,7 +78,7 @@ public void canListAllAvailableServerExtensions() throws Exception {
@Test
public void canListExtensionMethodsForServerExtension() throws Exception {
JaxRsResponse response = RestRequest.req().get(functionalTestHelper.extensionUri());
assertThat(response.getStatus(), equalTo(200));
assertThat(response.getStatus(), equalTo( 200 ));

Map<String, Object> json = JsonHelper.jsonToMap( response.getEntity() );
String refNodeService = (String) json.get(FunctionalTestPlugin.class.getSimpleName());
Expand All @@ -87,11 +87,11 @@ public void canListExtensionMethodsForServerExtension() throws Exception {
response = RestRequest.req().get(refNodeService);
String result = response.getEntity();

assertThat(response.getStatus(), equalTo(200));
assertThat(response.getStatus(), equalTo( 200 ));

json = JsonHelper.jsonToMap(result);
json = (Map<String, Object>) json.get("graphdb");
assertThat(json, hasKey(FunctionalTestPlugin.GET_REFERENCE_NODE));
assertThat(json, hasKey( FunctionalTestPlugin.GET_REFERENCE_NODE ));
response.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ public class PluginFunctionalTest extends SharedServerTestBase
@BeforeClass
public static void setupServer() throws IOException
{
functionalTestHelper = new FunctionalTestHelper( server() );
functionalTestHelper = new FunctionalTestHelper( SharedServerTestBase.server() );
}

@Before
public void cleanTheDatabase()
{
ServerHelper.cleanTheDatabase( server() );
ServerHelper.cleanTheDatabase( SharedServerTestBase.server() );
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@

import javax.ws.rs.core.MediaType;

import org.hamcrest.CoreMatchers;
import org.hamcrest.Description;
import org.hamcrest.Factory;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
import org.junit.Assert;

import org.neo4j.server.rest.JaxRsResponse;
import org.neo4j.server.rest.RestRequest;
import org.neo4j.server.rest.domain.JsonHelper;
Expand All @@ -53,22 +56,22 @@ public static Map<String, Object> makeGet( String url ) throws JsonParseExceptio
protected static Map<String, Object> deserializeMap( final String body ) throws JsonParseException
{
Map<String, Object> result = JsonHelper.jsonToMap( body );
assertThat( result, is( not( nullValue() ) ) );
assertThat( result, CoreMatchers.is( not( nullValue() ) ) );
return result;
}

private static List<Map<String, Object>> deserializeList( final String body ) throws JsonParseException
{
List<Map<String, Object>> result = JsonHelper.jsonToList( body );
assertThat( result, is( not( nullValue() ) ) );
assertThat( result, CoreMatchers.is( not( nullValue() ) ) );
return result;
}

protected static String getResponseText( final JaxRsResponse response )
{
String body = response.getEntity();

assertEquals( body, 200, response.getStatus() );
Assert.assertEquals( body, 200, response.getStatus() );
return body;
}

Expand Down
Loading

0 comments on commit 7d44cb6

Please sign in to comment.