You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ace.apache.org by ma...@apache.org on 2012/07/11 01:01:35 UTC
svn commit: r1359944 - in /ace/sandbox/marrs:
org.apache.ace.authentication.itest/
org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/
org.apache.ace.configurator.useradmin.itest/
org.apache.ace.configurator.useradmin.itest/.setti...
Author: marrs
Date: Tue Jul 10 23:01:34 2012
New Revision: 1359944
URL: http://svn.apache.org/viewvc?rev=1359944&view=rev
Log:
Migrated another itest.
Added:
ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/
ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.classpath
ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.project
ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.settings/
ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.settings/org.eclipse.jdt.core.prefs
ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/bnd.bnd
ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/build.xml
ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/src/
ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/src/org/
ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/src/org/apache/
ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/src/org/apache/ace/
ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/src/org/apache/ace/it/
ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/src/org/apache/ace/it/useradminconfigurator/
ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/src/org/apache/ace/it/useradminconfigurator/ConfiguratorTest.java
ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/test/
Removed:
ace/sandbox/marrs/org.apache.ace.integrationtests/test/org/apache/ace/it/ExampleTest.java
ace/sandbox/marrs/org.apache.ace.integrationtests/test/org/apache/ace/it/IntegrationTestBase.java
ace/sandbox/marrs/org.apache.ace.integrationtests/test/org/apache/ace/it/Options.java
ace/sandbox/marrs/org.apache.ace.integrationtests/test/org/apache/ace/it/authentication/
ace/sandbox/marrs/org.apache.ace.integrationtests/test/org/apache/ace/it/http/
ace/sandbox/marrs/org.apache.ace.integrationtests/test/org/apache/ace/it/log/
ace/sandbox/marrs/org.apache.ace.integrationtests/test/org/apache/ace/it/useradminconfigurator/
Modified:
ace/sandbox/marrs/org.apache.ace.authentication.itest/bnd.bnd
ace/sandbox/marrs/org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/AuthenticationTestBase.java
ace/sandbox/marrs/org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/LogAuthenticationTest.java
Modified: ace/sandbox/marrs/org.apache.ace.authentication.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.authentication.itest/bnd.bnd?rev=1359944&r1=1359943&r2=1359944&view=diff
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.authentication.itest/bnd.bnd (original)
+++ ace/sandbox/marrs/org.apache.ace.authentication.itest/bnd.bnd Tue Jul 10 23:01:34 2012
@@ -73,7 +73,6 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;o
org.apache.ace.scheduler;resolution=file:/Users/marcel/dev/ace-bndtools/org.apache.ace.scheduler/generated/org.apache.ace.scheduler.jar;version=latest,\
org.apache.ace.log.servlet;resolution=file:/Users/marcel/dev/ace-bndtools/org.apache.ace.log.servlet/generated/org.apache.ace.log.servlet.jar;version=latest,\
org.apache.ace.gateway.log;resolution=file:/Users/marcel/dev/ace-bndtools/org.apache.ace.gateway.log/generated/org.apache.ace.gateway.log.jar;version=latest,\
- biz.aQute.junit;resolution=http://bundles.bndtools.org.s3.amazonaws.com/biz.aQute.junit/biz.aQute.junit-1.0.0.jar;version='[1.0.0,1.0.1)',\
org.apache.ace.obr.metadata;resolution=file:/Users/marcel/dev/ace-bndtools/org.apache.ace.obr.metadata/generated/org.apache.ace.obr.metadata.jar;version=latest,\
org.apache.ace.authentication.api;resolution=file:/Users/marcel/dev/ace-bndtools/org.apache.ace.authentication.api/generated/org.apache.ace.authentication.api.jar;version=latest,\
org.knopflerfish.log;resolution=file:/Users/marcel/dev/ace-bndtools/cnf/repo/org.knopflerfish.log/org.knopflerfish.log-2.0.2.jar;version='[2.0.2,2.0.3)',\
Modified: ace/sandbox/marrs/org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/AuthenticationTestBase.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/AuthenticationTestBase.java?rev=1359944&r1=1359943&r2=1359944&view=diff
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/AuthenticationTestBase.java (original)
+++ ace/sandbox/marrs/org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/AuthenticationTestBase.java Tue Jul 10 23:01:34 2012
@@ -25,6 +25,8 @@ import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
+import junit.framework.Assert;
+
import org.apache.ace.connectionfactory.ConnectionFactory;
import org.apache.ace.it.IntegrationTestBase;
import org.apache.ace.repository.Repository;
@@ -51,7 +53,7 @@ public class AuthenticationTestBase exte
"</user>" +
"</roles>").getBytes());
- assertTrue("Committing test user data failed!", userRepository.commit(bis, userRepository.getRange().getHigh()));
+ Assert.assertTrue("Committing test user data failed!", userRepository.commit(bis, userRepository.getRange().getHigh()));
}
/**
@@ -109,6 +111,6 @@ public class AuthenticationTestBase exte
while ((userAdmin.getRole(userName) == null) && (count++ < 60)) {
Thread.sleep(100);
}
- assertTrue("Failed to obtain user from userAdmin!", count != 60);
+ Assert.assertTrue("Failed to obtain user from userAdmin!", count != 60);
}
}
Modified: ace/sandbox/marrs/org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/LogAuthenticationTest.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/LogAuthenticationTest.java?rev=1359944&r1=1359943&r2=1359944&view=diff
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/LogAuthenticationTest.java (original)
+++ ace/sandbox/marrs/org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/LogAuthenticationTest.java Tue Jul 10 23:01:34 2012
@@ -140,6 +140,8 @@ public class LogAuthenticationTest exten
"authentication.user.password", password);
assertTrue("Failed to access auditlog in time!", waitForURL(m_connectionFactory, testURL, 200, 15000));
+
+ before();
}
/**
Added: ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.classpath
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.classpath?rev=1359944&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.classpath (added)
+++ ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.classpath Tue Jul 10 23:01:34 2012
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" output="bin_test" path="test"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="aQute.bnd.classpath.container"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.project
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.project?rev=1359944&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.project (added)
+++ ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.project Tue Jul 10 23:01:34 2012
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.apache.ace.configurator.useradmin.itest</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>bndtools.core.bndbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>bndtools.core.bndnature</nature>
+ </natures>
+</projectDescription>
Added: ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.settings/org.eclipse.jdt.core.prefs?rev=1359944&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.settings/org.eclipse.jdt.core.prefs (added)
+++ ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/.settings/org.eclipse.jdt.core.prefs Tue Jul 10 23:01:34 2012
@@ -0,0 +1,81 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
Added: ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/bnd.bnd?rev=1359944&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/bnd.bnd (added)
+++ ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/bnd.bnd Tue Jul 10 23:01:34 2012
@@ -0,0 +1,38 @@
+Test-Cases: ${classes;CONCRETE;EXTENDS;org.apache.ace.it.IntegrationTestBase}
+-buildpath: junit.osgi,\
+ osgi.core,\
+ osgi.cmpn,\
+ org.apache.ace.util;version=latest,\
+ org.apache.felix.dependencymanager,\
+ org.apache.ace.itest;version=latest,\
+ org.apache.ace.log;version=latest,\
+ org.apache.ace.httplistener;version=latest,\
+ org.apache.ace.discovery.api;version=latest,\
+ org.apache.ace.discovery.property;version=latest,\
+ org.apache.ace.identification.api;version=latest,\
+ org.apache.ace.identification.property;version=latest,\
+ org.apache.ace.server.log.store;version=latest,\
+ org.apache.ace.repository.api;version=latest,\
+ org.apache.ace.repository.impl;version=latest
+-runfw: org.apache.felix.framework;version='[4,5)'
+-runbundles: org.apache.ace.itest;resolution=file:/Users/marcel/dev/ace-bndtools/org.apache.ace.itest/generated/org.apache.ace.itest.jar;version=latest,\
+ org.apache.felix.dependencymanager;resolution=file:/Users/marcel/dev/ace-bndtools/cnf/repo/org.apache.felix.dependencymanager/org.apache.felix.dependencymanager-3.1.0.jar;version='[3.1.0,3.1.1)',\
+ org.apache.felix.configadmin;resolution=http://bundles.bndtools.org.s3.amazonaws.com/org.apache.felix.configadmin/org.apache.felix.configadmin-1.2.8.jar;version='[1.2.8,1.2.9)',\
+ org.apache.ace.httplistener;resolution=file:/Users/marcel/dev/ace-bndtools/org.apache.ace.httplistener/generated/org.apache.ace.httplistener.jar;version=latest,\
+ org.apache.ace.deployment.provider.api;resolution=file:/Users/marcel/dev/ace-bndtools/org.apache.ace.deployment.provider.api/generated/org.apache.ace.deployment.provider.api.jar;version=latest,\
+ org.apache.ace.authentication.api;resolution=file:/Users/marcel/dev/ace-bndtools/org.apache.ace.authentication.api/generated/org.apache.ace.authentication.api.jar;version=latest,\
+ org.apache.ace.range.api;resolution=file:/Users/marcel/dev/ace-bndtools/org.apache.ace.range.api/generated/org.apache.ace.range.api.jar;version=latest,\
+ osgi.cmpn;resolution=http://bundles.bndtools.org.s3.amazonaws.com/osgi.cmpn/osgi.cmpn-4.2.1.jar;version='[4.2.1,4.2.2)',\
+ org.apache.ace.resourceprocessor.useradmin;resolution=file:/Users/marcel/dev/ace-bndtools/org.apache.ace.resourceprocessor.useradmin/generated/org.apache.ace.resourceprocessor.useradmin.jar;version=latest,\
+ org.apache.ace.repository.api;resolution=file:/Users/marcel/dev/ace-bndtools/org.apache.ace.repository.api/generated/org.apache.ace.repository.api.jar;version=latest,\
+ org.apache.ace.connectionfactory;version=latest,\
+ org.apache.felix.http.jetty,\
+ org.apache.felix.prefs,\
+ org.knopflerfish.bundle.useradmin,\
+ org.knopflerfish.log,\
+ org.apache.ace.scheduler;version=latest,\
+ org.apache.ace.repository.impl;version=latest,\
+ org.apache.ace.repository.servlet;version=latest,\
+ org.apache.ace.configurator.useradmin.task;version=latest
+Private-Package: org.apache.ace.it.useradminconfigurator
+-runvm: -Dorg.osgi.service.http.port=9000 -ea
Added: ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/build.xml
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/build.xml?rev=1359944&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/build.xml (added)
+++ ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/build.xml Tue Jul 10 23:01:34 2012
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="project" default="build">
+ <import file="../cnf/build.xml"/>
+</project>
Added: ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/src/org/apache/ace/it/useradminconfigurator/ConfiguratorTest.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/src/org/apache/ace/it/useradminconfigurator/ConfiguratorTest.java?rev=1359944&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/src/org/apache/ace/it/useradminconfigurator/ConfiguratorTest.java (added)
+++ ace/sandbox/marrs/org.apache.ace.configurator.useradmin.itest/src/org/apache/ace/it/useradminconfigurator/ConfiguratorTest.java Tue Jul 10 23:01:34 2012
@@ -0,0 +1,141 @@
+/*
+ * 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.
+ */
+package org.apache.ace.it.useradminconfigurator;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
+import org.apache.ace.it.IntegrationTestBase;
+import org.apache.ace.repository.Repository;
+import org.apache.ace.repository.impl.constants.RepositoryConstants;
+import org.apache.ace.test.constants.TestConstants;
+import org.apache.felix.dm.Component;
+import org.osgi.service.useradmin.User;
+import org.osgi.service.useradmin.UserAdmin;
+
+public class ConfiguratorTest extends IntegrationTestBase {
+
+// @Configuration
+// public Option[] configuration() {
+// return options(
+// systemProperty("org.osgi.service.http.port").value("" + TestConstants.PORT),
+// junitBundles(),
+// provision(
+// wrappedBundle(maven("org.apache.ace", "org.apache.ace.util")).overwriteManifest(WrappedUrlProvisionOption.OverwriteMode.FULL), // we do this because we need access to some test classes that aren't exported
+// Osgi.compendium(),
+// jetty(),
+// Felix.preferences(),
+// Felix.dependencyManager(),
+// Felix.configAdmin(),
+// Knopflerfish.useradmin(),
+// Knopflerfish.log(),
+// Ace.authenticationApi(),
+// Ace.connectionFactory(),
+// Ace.rangeApi(),
+// Ace.scheduler(),
+// Ace.httplistener(),
+// Ace.repositoryApi(),
+// Ace.repositoryImpl(),
+// Ace.repositoryServlet(),
+// Ace.resourceprocessorUseradmin(),
+// Ace.configuratorUseradminTask(),
+// Ace.deploymentProviderApi()
+// )
+// );
+// }
+
+ protected Component[] getDependencies() {
+ return new Component[] {
+ createComponent()
+ .setImplementation(this)
+ .add(createServiceDependency()
+ .setService(UserAdmin.class)
+ .setRequired(true))
+ .add(createServiceDependency()
+ .setService(Repository.class, "(&(" + RepositoryConstants.REPOSITORY_NAME + "=users)(" + RepositoryConstants.REPOSITORY_CUSTOMER + "=apache))")
+ .setRequired(true))
+ };
+ }
+
+ @Override
+ protected void before() throws Exception {
+ configureFactory("org.apache.ace.server.repository.factory",
+ RepositoryConstants.REPOSITORY_NAME, "users",
+ RepositoryConstants.REPOSITORY_CUSTOMER, "apache",
+ RepositoryConstants.REPOSITORY_MASTER, "true");
+ configure("org.apache.ace.configurator.useradmin.task.UpdateUserAdminTask",
+ "repositoryName", "users",
+ "repositoryCustomer", "apache");
+ configure("org.apache.ace.scheduler",
+ "org.apache.ace.configurator.useradmin.task.UpdateUserAdminTask", "1000");
+ configure("org.apache.ace.repository.servlet.RepositoryServlet",
+ "org.apache.ace.server.servlet.endpoint", "/repository",
+ "authentication.enabled", "false");
+ configure("org.apache.ace.repository.servlet.RepositoryReplicationServlet",
+ "org.apache.ace.server.servlet.endpoint", "/replication",
+ "authentication.enabled", "false");
+ }
+
+ private volatile Repository m_repository;
+ private volatile UserAdmin m_userAdmin;
+
+ /**
+ * Creates a file in the repository, waits for the UserAdmin to have a new user
+ * present, and inspects that user.
+ */
+ public void testConfigurator() throws IllegalArgumentException, IOException, InterruptedException {
+ ByteArrayInputStream bis = new ByteArrayInputStream((
+ "<roles>" +
+ " <user name=\"TestUser\">" +
+ " <properties>" +
+ " <email>testUser@apache.org</email>" +
+ " </properties>" +
+ " <credentials>" +
+ " <password type=\"String\">swordfish</password>" +
+ " <certificate type=\"byte[]\">42</certificate>" +
+ " </credentials>" +
+ " </user>" +
+ "</roles>").getBytes());
+
+ assertTrue("Committing test user data failed.", m_repository.commit(bis, m_repository.getRange().getHigh()));
+
+ User user = (User) m_userAdmin.getRole("TestUser");
+ int count = 0;
+ while ((user == null) && (count < 60)) {
+ Thread.sleep(250);
+ user = (User) m_userAdmin.getRole("TestUser");
+ count++;
+ }
+
+ assertNotNull("Even after fifteen seconds, our user is not present.", user);
+
+ boolean foundPassword = false;
+ boolean foundCertificate = false;
+ count = 0;
+ while (!foundPassword & !foundCertificate && (count < 20)) {
+ // Note: there is a window between the creation of the user and the setting of the properties.
+ Thread.sleep(50);
+ foundPassword = user.hasCredential("password", "swordfish");
+ foundCertificate = user.hasCredential("certificate", new byte[] {'4', '2'});
+ }
+
+ assertTrue("A second after our user becoming available, there is no (correct) password.", foundPassword);
+ assertTrue("A second after our user becoming available, there is no (correct) certificate.", foundCertificate);
+ }
+}