Author: [email protected]
Date: Thu Apr 14 15:17:45 2011
New Revision: 967
Log:
[AMDATUCASSANDRA-7] Integration test refactoring
Modified:
trunk/amdatu-cassandra/test-integration/pom.xml
trunk/amdatu-cassandra/test-integration/src/test/java/org/amdatu/cassandra/test/integration/base/ConfigProvider.java
trunk/amdatu-cassandra/test-integration/src/test/java/org/amdatu/cassandra/test/integration/base/IntegrationTestBase.java
Modified: trunk/amdatu-cassandra/test-integration/pom.xml
==============================================================================
--- trunk/amdatu-cassandra/test-integration/pom.xml (original)
+++ trunk/amdatu-cassandra/test-integration/pom.xml Thu Apr 14 15:17:45 2011
@@ -72,13 +72,6 @@
<type>bundle</type>
</dependency>
<dependency>
- <groupId>org.amdatu.opensocial</groupId>
- <artifactId>shindig</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <type>bundle</type>
- </dependency>
- <dependency>
<groupId>org.amdatu.core</groupId>
<artifactId>tenant</artifactId>
<version>${project.version}</version>
@@ -93,13 +86,6 @@
<type>bundle</type>
</dependency>
<dependency>
- <groupId>org.amdatu.core</groupId>
- <artifactId>tenantstore-fs</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <type>bundle</type>
- </dependency>
- <dependency>
<groupId>org.amdatu.cassandra</groupId>
<artifactId>application</artifactId>
<version>${project.version}</version>
@@ -155,83 +141,6 @@
<scope>test</scope>
<type>bundle</type>
</dependency>
- <dependency>
- <groupId>org.amdatu.authorization.login</groupId>
- <artifactId>service</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <type>bundle</type>
- </dependency>
- <dependency>
- <groupId>org.amdatu.authorization.useradmin</groupId>
- <artifactId>rest</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <type>bundle</type>
- </dependency>
- <dependency>
- <groupId>org.amdatu.authentication.oauth</groupId>
- <artifactId>api</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <type>bundle</type>
- </dependency>
- <dependency>
- <groupId>org.amdatu.authentication.oauth</groupId>
- <artifactId>server</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <type>bundle</type>
- </dependency>
- <dependency>
- <groupId>org.amdatu.authentication.oauth</groupId>
- <artifactId>client</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <type>bundle</type>
- </dependency>
- <dependency>
- <groupId>org.amdatu.authentication.oauth</groupId>
- <artifactId>consumerregistry-fs</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <type>bundle</type>
- </dependency>
- <dependency>
- <groupId>org.amdatu.authentication</groupId>
- <artifactId>tokenprovider</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <type>bundle</type>
- </dependency>
- <dependency>
- <groupId>org.amdatu.authentication.tokenstore</groupId>
- <artifactId>mem</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <type>bundle</type>
- </dependency>
- <dependency>
- <groupId>org.amdatu.semanticweb</groupId>
- <artifactId>rdf2go.sesamebridge</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <type>bundle</type>
- </dependency>
- <dependency>
- <groupId>org.amdatu.semanticweb</groupId>
- <artifactId>rdf2go.api</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <type>bundle</type>
- </dependency>
- <dependency>
- <groupId>org.amdatu.semanticweb</groupId>
- <artifactId>sesame</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <type>bundle</type>
- </dependency>
<dependency>
<groupId>org.apache.felix</groupId>
@@ -258,12 +167,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
@@ -288,18 +191,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.commons.mime</artifactId>
- <version>${org.apache.sling.commons.mime.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.commons.osgi</artifactId>
- <version>${org.apache.sling.commons.osgi.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
Modified:
trunk/amdatu-cassandra/test-integration/src/test/java/org/amdatu/cassandra/test/integration/base/ConfigProvider.java
==============================================================================
---
trunk/amdatu-cassandra/test-integration/src/test/java/org/amdatu/cassandra/test/integration/base/ConfigProvider.java
(original)
+++
trunk/amdatu-cassandra/test-integration/src/test/java/org/amdatu/cassandra/test/integration/base/ConfigProvider.java
Thu Apr 14 15:17:45 2011
@@ -21,20 +21,11 @@
import java.net.URL;
import java.util.Properties;
-import junit.framework.Assert;
-
-import org.amdatu.authentication.oauth.server.OAuthServerConfig;
-import org.amdatu.authorization.login.service.LoginService;
import org.amdatu.cassandra.application.CassandraConfigurationService;
import org.amdatu.core.config.templates.ConfigTemplateManager;
import org.amdatu.core.tenant.TenantManagementService;
-import org.amdatu.core.tenant.TenantStorageProvider;
-import org.amdatu.opensocial.shindig.ShindigService;
import org.osgi.service.cm.Configuration;
import org.osgi.service.cm.ConfigurationAdmin;
-import org.osgi.service.useradmin.Role;
-import org.osgi.service.useradmin.User;
-import org.osgi.service.useradmin.UserAdmin;
/**
* This class provides the configurations for the bundles under test.
@@ -42,20 +33,6 @@
* @author ivol
*/
public class ConfigProvider {
- public final static String HOSTNAME = "localhost";
- public final static String IP = "127.0.0.1";
- public final static String DEFAULT_PORTNR = "8080";
-
- // NB: Due to issue https://issues.apache.org/jira/browse/FELIX-2714 we
must use the default port for testing
- public final static String PORTNR = "8080";
- public final static String SECURE_PORTNR = "8081";
-
- public final static String TEST_USERNAME = "georged";
- public final static String TEST_PASSWORD = "georged";
-
- public final static String ADMIN_USERNAME = "Administrator";
- public final static String ADMIN_PASSWORD = "Administrator";
-
public void addLogConfig(ConfigurationAdmin configAdmin) throws
IOException {
Configuration config =
configAdmin.getConfiguration("org.amdatu.core.loghandler", null);
Properties properties = new Properties();
@@ -103,131 +80,6 @@
config.update(properties);
}
- public void addFSTenantStoreConfig(ConfigurationAdmin configAdmin) throws
IOException {
- Configuration config =
configAdmin.getConfiguration(TenantStorageProvider.CONFIGURATION_PID, null);
- Properties properties = new Properties();
- properties.put(TenantStorageProvider.DATA_DIRECTORY,
"work/tenantstore");
- config.update(properties);
- }
-
- public void addFSConsumerStoreConfig(ConfigurationAdmin configAdmin)
throws IOException {
- Configuration config =
configAdmin.getConfiguration("org.amdatu.authentication.oauth.consumerregistry.fs",
null);
- Properties properties = new Properties();
- properties.put("datadir", "work/consumerregistrystore");
- config.update(properties);
- }
-
- public void addSesameConfig(ConfigurationAdmin configAdmin) throws
IOException {
- Configuration config =
configAdmin.getConfiguration("org.amdatu.semanticweb.sesame", null);
- Properties properties = new Properties();
- properties.put("datadir", "work/sesame");
- config.update(properties);
- }
-
- public void addShindigConfig(ConfigurationAdmin configAdmin) throws
IOException {
- Configuration config =
configAdmin.getConfiguration(ShindigService.SHINDIG_CONFIG_PID, null);
- Properties properties = new Properties();
- properties.put("shindig.features.default",
"res://features/features.txt");
- properties.put("shindig.containers.default",
"res://conf/container.js");
- properties.put("shindig.blacklist.file", "");
- properties.put("shindig.oauth.base-url", "/oauth/");
- properties.put("shindig.oauth.authorize-action",
"/dashboard/authorize.jsp");
- properties.put("shindig.signing.state-key", "");
- properties.put("shindig.signing.key-name", "amdatu_public_key");
- properties.put("shindig.signing.global-callback-url", "http://" +
HOSTNAME + ":" + PORTNR
- + "/gadgets/oauthcallback");
- properties.put("shindig.signing.enable-signed-callbacks", "true");
- properties.put("shindig.signing.viewer-access-tokens-enabled",
"false");
- properties.put("shindig.locked-domain.enabled", "false");
- properties.put("shindig.content-rewrite.only-allow-excludes", "false");
- properties.put("shindig.content-rewrite.include-urls", ".*");
- properties.put("shindig.content-rewrite.exclude-urls", "");
- properties.put("shindig.content-rewrite.include-tags",
"body,embed,img,input,link,script,style");
- properties.put("shindig.content-rewrite.expires", "86400");
- properties.put("shindig.content-rewrite.proxy-url",
"/gadgets/proxy?container=default&url=");
- properties.put("shindig.content-rewrite.concat-url",
"/gadgets/concat?container=default&");
- properties.put("shindig.content-rewrite.enable-split-js-concat",
"true");
- properties.put("shindig.gadget-rewrite.default-forced-libs",
"core:rpc");
- properties.put("shindig.gadget-rewrite.externalize-feature-libs",
"false");
- properties.put("shindig.image-rewrite.max-inmem-bytes", "1048576");
- properties.put("shindig.image-rewrite.max-palette-size", "256");
- properties.put("shindig.image-rewrite.allow-jpeg-conversion", "true");
- properties.put("shindig.image-rewrite.jpeg-compression", "0.75");
- properties.put("shindig.image-rewrite.min-threshold-bytes", "200");
- properties.put("shindig.flash.min-version", "9.0.115");
- properties.put("shindig.template-rewrite.extension-tag-namespace",
"http://ns.opensocial.org/2009/extensions");
- properties.put("shindig.cache.http.defaultTtl", "0");
- properties.put("shindig.cache.http.negativeCacheTtl", "0");
- properties.put("shindig.cache.xml.refreshInterval", "1");
- properties.put("shindig.cache.lru.default.capacity", "1000");
- properties.put("shindig.cache.lru.expressions.capacity", "1000");
- properties.put("shindig.cache.lru.gadgetSpecs.capacity", "1000");
- properties.put("shindig.cache.lru.messageBundles.capacity", "1000");
- properties.put("shindig.cache.lru.httpResponses.capacity", "10000");
- properties.put("shindig.cache.ehcache.config",
- "res://org/apache/shindig/common/cache/ehcache/ehcacheConfig.xml");
- properties.put("shindig.cache.ehcache.jmx.enabled", "true");
- properties.put("shindig.cache.ehcache.jmx.stats", "true");
- properties.put("shindig.http.fast-encoding-detection", "true");
- properties.put("shindig.http.client.connection-timeout-ms", "15000");
- properties.put("shindig.http.client.max-object-size-bytes", "0");
- properties.put("shindig.uri.proxy.use-strict-parsing", "false");
- properties.put("shindig.uri.concat.use-strict-parsing", "false");
-
properties.put("org.apache.shindig.gadgets.http.basicHttpFetcherProxy", "");
- properties.put("org.apache.shindig.serviceExpirationDurationMinutes",
"60");
- properties.put("shindig.json-rpc.result-field", "result");
- properties.put("shindig.accelerate.remapInternalServerError", "true");
- properties.put("shindig.host", HOSTNAME);
- properties.put("shindig.port", PORTNR);
- properties.put("shindig.proxy.remapInternalServerError", "false");
- config.update(properties);
- }
-
- public void addFelixHttpServiceConfig(ConfigurationAdmin configAdmin)
throws IOException {
- // NB: Due to issue https://issues.apache.org/jira/browse/FELIX-2714
updating the felix http service
- // configuration may cause throwing a connection refused, a service
that still listens to the default
- // port 8080 or returning a 404. Therefore, until this issue has been
fixed, we will not try to change
- // any configuration of the felix http service and just use the
defaults.
- /*
- Configuration config =
configAdmin.getConfiguration("org.apache.felix.http", null);
- Properties properties = new Properties();
- properties.put("org.osgi.service.http.hostname", HOSTNAME);
- properties.put("org.osgi.service.http.port", PORTNR);
- properties.put("org.osgi.service.http.port.secure", SECURE_PORTNR);
- properties.put("org.apache.felix.http.debug", "true");
- properties.put("org.apache.felix.log.storeDebug", "true");
- config.update(properties);
- */
- }
-
- public void addFSUserAdminConfig(ConfigurationAdmin configAdmin) throws
IOException {
- Configuration config =
configAdmin.getConfiguration("org.amdatu.core.useradminstore-fs", null);
- Properties properties = new Properties();
- properties.put(TenantStorageProvider.DATA_DIRECTORY,
"work/useradminstore");
- config.update(properties);
- }
-
- public void addOAuthConfig(ConfigurationAdmin configAdmin) throws
IOException {
- Configuration config =
configAdmin.getConfiguration(OAuthServerConfig.PID, null);
- Properties properties = new Properties();
- properties.put(OAuthServerConfig.HOSTNAME, ConfigProvider.HOSTNAME);
- properties.put(OAuthServerConfig.PORTNR, ConfigProvider.PORTNR);
- properties.put(OAuthServerConfig.AUTHORIZE_URL,
"/oauth-server/jsp/authorize.jsp");
- config.update(properties);
- }
-
- @SuppressWarnings("unchecked")
- public void addTestUser(UserAdmin userAdmin) {
- User user = (User) userAdmin.createRole(TEST_USERNAME, Role.USER);
- user.getCredentials().put(LoginService.PASSWORD_CREDENTIAL_KEY,
TEST_PASSWORD);
- Assert.assertTrue("Test user '" + TEST_USERNAME + "' could not be
created", userAdmin.getRole(TEST_USERNAME) != null);
- }
-
- public void removeTestUser(UserAdmin userAdmin) {
- userAdmin.removeRole(TEST_USERNAME);
- Assert.assertFalse("Test user '" + TEST_USERNAME + "' could not be
removed", userAdmin.getRole(TEST_USERNAME) != null);
- }
-
/**
* Wait until the service at the specified URL returns the specified
response code with a timeout as specified.
*
Modified:
trunk/amdatu-cassandra/test-integration/src/test/java/org/amdatu/cassandra/test/integration/base/IntegrationTestBase.java
==============================================================================
---
trunk/amdatu-cassandra/test-integration/src/test/java/org/amdatu/cassandra/test/integration/base/IntegrationTestBase.java
(original)
+++
trunk/amdatu-cassandra/test-integration/src/test/java/org/amdatu/cassandra/test/integration/base/IntegrationTestBase.java
Thu Apr 14 15:17:45 2011
@@ -305,26 +305,6 @@
return
mavenBundle().groupId("org.amdatu.cassandra").artifactId("gadgetstore").version("0.2.0-SNAPSHOT");
}
- protected static MavenArtifactProvisionOption amdatuUserAdminREST() {
- return
mavenBundle().groupId("org.amdatu.authorization.useradmin").artifactId("rest").version("0.2.0-SNAPSHOT");
- }
-
- protected static MavenArtifactProvisionOption amdatuUserAdminFSStore() {
- return
mavenBundle().groupId("org.amdatu.core").artifactId("useradminstore-fs").version("0.2.0-SNAPSHOT");
- }
-
- protected static MavenArtifactProvisionOption amdatuTenantService() {
- return
mavenBundle().groupId("org.amdatu.core").artifactId("tenant").version("0.2.0-SNAPSHOT");
- }
-
- protected static MavenArtifactProvisionOption
amdatuTenantUserAdminDecoratorService() {
- return
mavenBundle().groupId("org.amdatu.core").artifactId("tenantuseradmindecorator").version("0.2.0-SNAPSHOT");
- }
-
- protected static MavenArtifactProvisionOption amdatuTenantStoreFSService()
{
- return
mavenBundle().groupId("org.amdatu.core").artifactId("tenantstore-fs").version("0.2.0-SNAPSHOT");
- }
-
protected static MavenArtifactProvisionOption
amdatuCassandraPersistenceManager() {
return
mavenBundle().groupId("org.amdatu.cassandra").artifactId("persistencemanager").version("0.2.0-SNAPSHOT");
}
@@ -349,47 +329,6 @@
return
mavenBundle().groupId("org.amdatu.web").artifactId("httpcontext").version("0.2.0-SNAPSHOT");
}
- protected static MavenArtifactProvisionOption amdatuTokenProvider() {
- return
mavenBundle().groupId("org.amdatu.authentication").artifactId("tokenprovider").version("0.2.0-SNAPSHOT");
- }
-
- protected static MavenArtifactProvisionOption amdatuMemTokenStore() {
- return
mavenBundle().groupId("org.amdatu.authentication.tokenstore").artifactId("mem").version("0.2.0-SNAPSHOT");
- }
-
- protected static MavenArtifactProvisionOption amdatuOAuthAPI() {
- return
mavenBundle().groupId("org.amdatu.authentication.oauth").artifactId("api").version("0.2.0-SNAPSHOT");
- }
-
- protected static MavenArtifactProvisionOption amdatuOAuthClient() {
- return
mavenBundle().groupId("org.amdatu.authentication.oauth").artifactId("client").version("0.2.0-SNAPSHOT");
- }
-
- protected static MavenArtifactProvisionOption amdatuOAuthServer() {
- return
mavenBundle().groupId("org.amdatu.authentication.oauth").artifactId("server").version("0.2.0-SNAPSHOT");
- }
-
- protected static MavenArtifactProvisionOption
amdatuOAuthConsumerRegistry() {
- return
mavenBundle().groupId("org.amdatu.authentication.oauth").artifactId("consumerregistry-fs")
- .version("0.2.0-SNAPSHOT");
- }
-
- protected static MavenArtifactProvisionOption fileBasedConfiguration() {
- return
mavenBundle().groupId("org.amdatu.core.config").artifactId("filebased").version("0.2.0-SNAPSHOT");
- }
-
- protected static MavenArtifactProvisionOption felixScr() {
- return
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.scr").versionAsInProject();
- }
-
- protected static MavenArtifactProvisionOption slingCommons() {
- return
mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.commons.osgi").versionAsInProject();
- }
-
- protected static MavenArtifactProvisionOption slingMime() {
- return
mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.commons.mime").versionAsInProject();
- }
-
protected static MavenArtifactProvisionOption paxUserAdmin() {
return
mavenBundle().groupId("org.ops4j.pax.useradmin").artifactId("pax-useradmin-service").versionAsInProject();
}
@@ -402,10 +341,6 @@
return
mavenBundle().groupId("org.ops4j.base").artifactId("ops4j-base-lang").versionAsInProject();
}
- protected static MavenArtifactProvisionOption felixHttpServiceJetty() {
- return
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.jetty").versionAsInProject();
- }
-
protected static MavenArtifactProvisionOption felixLog() {
return
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.log").versionAsInProject();
}
@@ -426,11 +361,6 @@
return
mavenBundle().groupId("org.osgi").artifactId("org.osgi.compendium").versionAsInProject();
}
- // Jar files wrapper in a bundle
- protected static WrappedUrlProvisionOption commonsHttpClient() {
- return
wrappedBundle(mavenBundle().groupId("commons-httpclient").artifactId("commons-httpclient"));
- }
-
protected static WrappedUrlProvisionOption commonsLogging() {
return
wrappedBundle(mavenBundle().groupId("commons-logging").artifactId("commons-logging"));
}
_______________________________________________
Amdatu-commits mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-commits