Author: enridaga
Date: Tue Nov 15 23:01:20 2011
New Revision: 1202461
URL: http://svn.apache.org/viewvc?rev=1202461&view=rev
Log:
Created submodule to host a test framework for the reasoners module
(STANBOL-379)
Adding this to branches because of STANBOL-343
Added:
incubator/stanbol/branches/lto-reasoners/reasoners/test/ (with props)
incubator/stanbol/branches/lto-reasoners/reasoners/test/pom.xml
incubator/stanbol/branches/lto-reasoners/reasoners/test/src/
incubator/stanbol/branches/lto-reasoners/reasoners/test/src/main/
incubator/stanbol/branches/lto-reasoners/reasoners/test/src/main/java/
incubator/stanbol/branches/lto-reasoners/reasoners/test/src/main/java/org/
incubator/stanbol/branches/lto-reasoners/reasoners/test/src/main/java/org/apache/
incubator/stanbol/branches/lto-reasoners/reasoners/test/src/main/java/org/apache/stanbol/
incubator/stanbol/branches/lto-reasoners/reasoners/test/src/main/java/org/apache/stanbol/reasoners/
incubator/stanbol/branches/lto-reasoners/reasoners/test/src/main/java/org/apache/stanbol/reasoners/test/
incubator/stanbol/branches/lto-reasoners/reasoners/test/src/main/java/org/apache/stanbol/reasoners/test/ReasonersTestBase.java
incubator/stanbol/branches/lto-reasoners/reasoners/test/src/main/resources/
Propchange: incubator/stanbol/branches/lto-reasoners/reasoners/test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Nov 15 23:01:20 2011
@@ -0,0 +1,4 @@
+target
+.project
+.settings
+.classpath
Added: incubator/stanbol/branches/lto-reasoners/reasoners/test/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/stanbol/branches/lto-reasoners/reasoners/test/pom.xml?rev=1202461&view=auto
==============================================================================
--- incubator/stanbol/branches/lto-reasoners/reasoners/test/pom.xml (added)
+++ incubator/stanbol/branches/lto-reasoners/reasoners/test/pom.xml Tue Nov 15
23:01:20 2011
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.entityhub.parent</artifactId>
+ <version>0.9.0-incubating-SNAPSHOT</version>
+ <relativePath>../../parent</relativePath>
+ </parent>
+
+ <artifactId>org.apache.stanbol.reasoners.test</artifactId>
+ <packaging>jar</packaging>
+ <name>Apache Stanbol Reasoners - Test Framework</name>
+ <description>Unit test framework for Stanbol Reasoners</description>
+ <inceptionYear>2010</inceptionYear>
+
+ <scm>
+ <connection>
+
scm:svn:http://svn.apache.org/repos/asf/incubator/stanbol/trunk/reasoners/test
+ </connection>
+ <developerConnection>
+
scm:svn:https://svn.apache.org/repos/asf/incubator/stanbol/trunk/reasoners/test
+ </developerConnection>
+ <url>http://incubator.apache.org/stanbol</url>
+ </scm>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <!-- Logging -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.commons.testing.stanbol</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.james</groupId>
+ <artifactId>apache-mime4j</artifactId>
+ <version>0.6</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.0.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore</artifactId>
+ <version>4.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpmime</artifactId>
+ <version>4.0.1</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>
Added:
incubator/stanbol/branches/lto-reasoners/reasoners/test/src/main/java/org/apache/stanbol/reasoners/test/ReasonersTestBase.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/branches/lto-reasoners/reasoners/test/src/main/java/org/apache/stanbol/reasoners/test/ReasonersTestBase.java?rev=1202461&view=auto
==============================================================================
---
incubator/stanbol/branches/lto-reasoners/reasoners/test/src/main/java/org/apache/stanbol/reasoners/test/ReasonersTestBase.java
(added)
+++
incubator/stanbol/branches/lto-reasoners/reasoners/test/src/main/java/org/apache/stanbol/reasoners/test/ReasonersTestBase.java
Tue Nov 15 23:01:20 2011
@@ -0,0 +1,33 @@
+package org.apache.stanbol.reasoners.test;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.mime.MultipartEntity;
+import org.apache.stanbol.commons.testing.http.Request;
+import org.apache.stanbol.commons.testing.stanbol.StanbolTestBase;
+
+public class ReasonersTestBase extends StanbolTestBase{
+ protected final String REASONERS_PATH = "/reasoners";
+ protected final String[] SERVICES = {"/owl", "/owlmini", "/rdfs"};
+ protected final String[] TASKS = {"/check", "/classify", "/enrich"};
+
+
+ protected Request buildMultipartRequest(String path,MultipartEntity
multiPart) {
+ HttpPost httpPost = new HttpPost(builder.buildUrl(path));
+ httpPost.setEntity(multiPart);
+ /**
+ * In case of Multipart requests, we must __NOT__ set the content-type
header to multipart/form-data.
+ * If we do it, we have a 400 response (bad request).
+ */
+ return this.builder.buildOtherRequest(httpPost);
+ }
+
+ protected List<String> allServices() {
+ List<String> sl = new ArrayList<String>();
+ sl.addAll(Arrays.asList(SERVICES));
+ return sl;
+ }
+}