Author: jawi
Date: Fri Feb 26 16:55:17 2016
New Revision: 1732517
URL: http://svn.apache.org/viewvc?rev=1732517&view=rev
Log:
Several improvements of the integration/unit tests:
- preconfigure the right OSGi HTTP port for all integration tests using
runproperties instead of doing this from the test setup (this shaves off a
couple of ms per test run);
- remove the unit/performance/broken/... labels from the TestNG tests as they
aren't used consistently and do not give any additional information;
- do not baseline the org.apache.ace.test bundle, as it is only used for the
(integration) tests and not shipped as part of the binaries;
- some formatting applied where necessary.
Modified:
ace/trunk/cnf/ext/defaults.bnd
ace/trunk/org.apache.ace.agent.controller.itest/bnd.bnd
ace/trunk/org.apache.ace.agent.itest/bnd.bnd
ace/trunk/org.apache.ace.agent.update.itest/bnd.bnd
ace/trunk/org.apache.ace.agent/bnd.bnd
ace/trunk/org.apache.ace.authentication.itest/bnd.bnd
ace/trunk/org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/AuthenticationTestBase.java
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/impl/AuthenticationServiceImplTest.java
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/basicauth/BasicHttpAuthenticationProcessorTest.java
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clientcert/ClientCertAuthenticationProcessorTest.java
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/password/PasswordAuthenticationProcessorTest.java
ace/trunk/org.apache.ace.builder/test/org/apache/ace/builder/ArtifactDataTest.java
ace/trunk/org.apache.ace.builder/test/org/apache/ace/builder/DeploymentPackageBuilderTest.java
ace/trunk/org.apache.ace.client.repository.itest/bnd.bnd
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessorTest.java
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/bundle/impl/BundleHelperTest.java
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/configuration/impl/ConfigurationHelperImplTest.java
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/user/impl/UserHelperImplTest.java
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/ACE308Test.java
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/ArtifactTest.java
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/CachedRepositoryImplTest.java
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/FilebasedBackupRepositoryTest.java
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/ModelTest.java
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/RepositoryAdminLoginContextImplTest.java
ace/trunk/org.apache.ace.client.rest.itest/bnd.bnd
ace/trunk/org.apache.ace.client.rest/test/org/apache/ace/client/rest/RESTClientTest.java
ace/trunk/org.apache.ace.client.workspace/bnd.bnd
ace/trunk/org.apache.ace.client.workspace/test/org/apache/ace/client/workspace/impl/WorkspaceManagerImplTest.java
ace/trunk/org.apache.ace.configurator/test/org/apache/ace/configurator/ConfiguratorTest.java
ace/trunk/org.apache.ace.connectionfactory/bnd.bnd
ace/trunk/org.apache.ace.connectionfactory/test/org/apache/ace/connectionfactory/impl/ConnectionFactoryImplTest.java
ace/trunk/org.apache.ace.connectionfactory/test/org/apache/ace/connectionfactory/impl/UrlCredentialsFactoryTest.java
ace/trunk/org.apache.ace.connectionfactory/test/org/apache/ace/connectionfactory/impl/UrlCredentialsTest.java
ace/trunk/org.apache.ace.deployment.itest/bnd.bnd
ace/trunk/org.apache.ace.deployment.itest/test/org/apache/ace/it/deployment/provider/filebased/FileBasedProviderTest.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/provider/repositorybased/BaseRepositoryHandlerTest.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/provider/repositorybased/CacheTest.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/provider/repositorybased/RepositoryBasedProviderConcurrencyTest.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/provider/repositorybased/RepositoryBasedProviderPerformanceTest.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/provider/repositorybased/RepositoryBasedProviderTest.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/servlet/DeploymentServletTest.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/streamgenerator/impl/StreamTest.java
ace/trunk/org.apache.ace.discovery/test/org/apache/ace/discovery/property/PropertyBasedDiscoveryTest.java
ace/trunk/org.apache.ace.discovery/test/org/apache/ace/discovery/property/SimpleDiscoveryTest.java
ace/trunk/org.apache.ace.feedback.common/test/org/apache/ace/feedback/EventTest.java
ace/trunk/org.apache.ace.identification/test/org/apache/ace/identification/ifconfig/IfconfigIdentificationTest.java
ace/trunk/org.apache.ace.identification/test/org/apache/ace/identification/property/PropertyBasedIdentificationTest.java
ace/trunk/org.apache.ace.identification/test/org/apache/ace/identification/property/SimpleIdentificationTest.java
ace/trunk/org.apache.ace.log.itest/bnd.bnd
ace/trunk/org.apache.ace.log/test/org/apache/ace/log/LogDescriptorTest.java
ace/trunk/org.apache.ace.log/test/org/apache/ace/log/LogEventTest.java
ace/trunk/org.apache.ace.log/test/org/apache/ace/log/listener/LogTest.java
ace/trunk/org.apache.ace.log/test/org/apache/ace/log/server/servlet/LogServletTest.java
ace/trunk/org.apache.ace.log/test/org/apache/ace/log/server/store/impl/ServerLogStoreTester.java
ace/trunk/org.apache.ace.log/test/org/apache/ace/log/server/task/LogTaskTest.java
ace/trunk/org.apache.ace.log/test/org/apache/ace/log/target/store/impl/GatewayLogStoreTest.java
ace/trunk/org.apache.ace.log/test/org/apache/ace/log/target/task/LogSyncTaskTest.java
ace/trunk/org.apache.ace.obr/test/org/apache/ace/obr/metadata/repoindeximpl/RepoIndexMetadataTest.java
ace/trunk/org.apache.ace.obr/test/org/apache/ace/obr/metadata/util/ResourceMetaDataTest.java
ace/trunk/org.apache.ace.obr/test/org/apache/ace/obr/servlet/BundleServletTest.java
ace/trunk/org.apache.ace.obr/test/org/apache/ace/obr/storage/file/BundleFileStoreSplitTest.java
ace/trunk/org.apache.ace.obr/test/org/apache/ace/obr/storage/file/BundleFileStoreTest.java
ace/trunk/org.apache.ace.range.api/test/org/apache/ace/range/SortedRangeSetTest.java
ace/trunk/org.apache.ace.repository.itest/bnd.bnd
ace/trunk/org.apache.ace.repository/test/org/apache/ace/repository/impl/RepositoryImplTest.java
ace/trunk/org.apache.ace.scheduler/test/org/apache/ace/scheduler/ExecuterTest.java
ace/trunk/org.apache.ace.scheduler/test/org/apache/ace/scheduler/SchedulerTest.java
ace/trunk/org.apache.ace.test/bnd.bnd
ace/trunk/org.apache.ace.test/src/org/apache/ace/it/IntegrationTestBase.java
ace/trunk/org.apache.ace.test/src/org/apache/ace/test/constants/TestConstants.java
ace/trunk/org.apache.ace.test/src/org/apache/ace/test/constants/packageinfo
ace/trunk/org.apache.ace.test/src/org/apache/ace/test/utils/TestUtils.java
ace/trunk/org.apache.ace.test/src/org/apache/ace/test/utils/packageinfo
ace/trunk/org.apache.ace.useradmin.itest/bnd.bnd
ace/trunk/org.apache.ace.useradmin.ui.itest/bnd.bnd
ace/trunk/org.apache.ace.verifier/test/org/apache/ace/deployment/verifier/impl/VerifierTest.java
Modified: ace/trunk/cnf/ext/defaults.bnd
URL:
http://svn.apache.org/viewvc/ace/trunk/cnf/ext/defaults.bnd?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
--- ace/trunk/cnf/ext/defaults.bnd (original)
+++ ace/trunk/cnf/ext/defaults.bnd Fri Feb 26 16:55:17 2016
@@ -40,7 +40,14 @@ Bundle-Vendor: The Apache Software Found
# Fall back to the "old" method of running integration tests.
-tester: biz.aQute.junit
-# Semantic versioning
+# Common properties used for all integration tests.
+itestrunprops: \
+ org.osgi.service.http.port=28080,\
+ org.apache.felix.eventadmin.Timeout=0,\
+ org.apache.felix.log.storeDebug=true,\
+ org.apache.felix.log.maxSize=1000
+
+# Enable semantic versioning for all bundles
-baseline: *
# Ignore $1.class files generated by javac when diffing resources as ECJ
doesn't create these
Modified: ace/trunk/org.apache.ace.agent.controller.itest/bnd.bnd
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent.controller.itest/bnd.bnd?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent.controller.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.agent.controller.itest/bnd.bnd Fri Feb 26 16:55:17
2016
@@ -1,6 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under the terms of ASLv2
(http://www.apache.org/licenses/LICENSE-2.0).
-Test-Cases: org.apache.ace.agent.itest.CustomAgentControllerTest,\
- org.apache.ace.agent.itest.CustomStandaloneAgentControllerTest
+
+-buildpath: \
+ osgi.core;version=4.3,\
+ org.apache.ace.agent;version=latest,\
+ org.apache.ace.builder;version=latest,\
+ org.apache.ace.test;version=latest,\
+ org.apache.felix.dependencymanager,\
+ org.apache.felix.http.jetty;version='[2.2,3)',\
+ javax.servlet,\
+ junit.osgi
+
+-runfw: org.apache.felix.framework;version='[4,5)'
-runbundles: \
org.apache.ace.test;version=latest,\
org.apache.ace.builder;version=latest,\
@@ -9,6 +19,14 @@ Test-Cases: org.apache.ace.agent.itest.C
org.apache.felix.http.jetty;version='[2.2,3)',\
org.apache.felix.log,\
osgi.cmpn
+-runvm: -ea
+-runee: JavaSE-1.7
+-runsystempackages: sun.reflect
+-runproperties: ${itestrunprops}
+-baseline:
+
+Test-Cases: ${classes;CONCRETE;EXTENDS;org.apache.ace.it.IntegrationTestBase}
+
Private-Package: \
org.apache.ace.range,\
org.apache.ace.agent,\
@@ -22,23 +40,7 @@ Private-Package: \
org.osgi.service.event,\
org.osgi.service.log,\
org.osgi.util.tracker
--runee: JavaSE-1.6
--runvm: -ea
--runfw: org.apache.felix.framework;version='[4,5)'
--buildpath: \
- osgi.core;version=4.3,\
- org.apache.ace.agent;version=latest,\
- org.apache.ace.builder;version=latest,\
- org.apache.ace.test;version=latest,\
- org.apache.felix.dependencymanager,\
- org.apache.felix.http.jetty;version='[2.2,3)',\
- javax.servlet,\
- junit.osgi
--runsystempackages: sun.reflect
--runproperties: \
- org.apache.felix.eventadmin.Timeout=0,\
- org.apache.felix.log.storeDebug=true,\
- org.apache.felix.log.maxSize=1000
+
Import-Package: \
!org.osgi.service.component.annotations,\
!org.apache.tools.ant.*,\
@@ -46,4 +48,4 @@ Import-Package: \
*
Bundle-Version: 1.0.0
Bundle-Name: Apache ACE Agent Custom Controller itest
--baseline:
+Bundle-Category: itest
Modified: ace/trunk/org.apache.ace.agent.itest/bnd.bnd
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent.itest/bnd.bnd?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.agent.itest/bnd.bnd Fri Feb 26 16:55:17 2016
@@ -1,16 +1,5 @@
# Licensed to the Apache Software Foundation (ASF) under the terms of ASLv2
(http://www.apache.org/licenses/LICENSE-2.0).
--runbundles: \
- org.apache.ace.agent;version=latest,\
- org.apache.ace.test;version=latest,\
- org.apache.ace.builder;version=latest,\
- org.apache.felix.configadmin,\
- org.apache.felix.dependencymanager,\
- org.apache.felix.http.jetty;version='[2.2,3)',\
- org.apache.felix.log,\
- osgi.cmpn
--runee: JavaSE-1.7
--runvm: -ea
--runfw: org.apache.felix.framework;version='[4,5)'
+
-buildpath: \
osgi.core;version=4.2,\
org.apache.ace.agent;version=latest,\
@@ -21,12 +10,24 @@
javax.servlet,\
junit.osgi,\
org.mockito.mockito-all
+
+-runfw: org.apache.felix.framework;version='[4,5)'
+-runbundles: \
+ org.apache.ace.agent;version=latest,\
+ org.apache.ace.test;version=latest,\
+ org.apache.ace.builder;version=latest,\
+ org.apache.felix.configadmin,\
+ org.apache.felix.dependencymanager,\
+ org.apache.felix.http.jetty;version='[2.2,3)',\
+ org.apache.felix.log,\
+ osgi.cmpn
+-runvm: -ea
+-runee: JavaSE-1.7
-runsystempackages: sun.reflect
--runproperties: \
- org.apache.felix.eventadmin.Timeout=0,\
- org.apache.felix.log.storeDebug=true,\
- org.apache.felix.log.maxSize=1000,\
-
org.osgi.framework.bootdelegation="com.yourkit.*,com.sun.*,sun.*,apple.*,com.apple.*"
+-runproperties: ${itestrunprops}
+-baseline:
+
+Test-Cases: ${classes;CONCRETE;EXTENDS;org.apache.ace.it.IntegrationTestBase}
Private-Package: \
org.apache.ace.agent.itest
@@ -36,7 +37,4 @@ Import-Package: \
Bundle-Version: 1.0.0
Bundle-Name: Apache ACE Agent itest
Bundle-Description: Integration test bundle for the Apache ACE Agent
-
-Test-Cases: ${classes;CONCRETE;EXTENDS;junit.framework.TestCase}
-
--baseline:
+Bundle-Category: itest
Modified: ace/trunk/org.apache.ace.agent.update.itest/bnd.bnd
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent.update.itest/bnd.bnd?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent.update.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.agent.update.itest/bnd.bnd Fri Feb 26 16:55:17 2016
@@ -3,18 +3,7 @@
# NOTE: This test is stored in a seperate from the main agent itest project
because
# it updates the agent bundle. This causes problems if other tests try to wire
to
# the the api package after the fact.
-Test-Cases: ${classes;CONCRETE;EXTENDS;junit.framework.TestCase}
--runbundles: \
- org.apache.ace.agent;version=latest,\
- org.apache.ace.test;version=latest,\
- org.apache.felix.dependencymanager,\
- org.apache.felix.configadmin,\
- org.apache.felix.http.jetty;version='[2.2,3)',\
- osgi.cmpn
-Private-Package: org.apache.ace.agent.itest
--runee: JavaSE-1.6
--runvm: -ea
--runfw: org.apache.felix.framework;version='[5.2.0,6)'
+
-buildpath: \
osgi.core;version=6.0.0,\
org.apache.ace.agent;version=latest,\
@@ -24,15 +13,30 @@ Private-Package: org.apache.ace.agent.it
javax.servlet,\
junit.osgi,\
org.mockito.mockito-all
+
+-runfw: org.apache.felix.framework;version='[5,6)'
+-runbundles: \
+ org.apache.ace.agent;version=latest,\
+ org.apache.ace.test;version=latest,\
+ org.apache.felix.dependencymanager,\
+ org.apache.felix.configadmin,\
+ org.apache.felix.http.jetty;version='[2.2,3)',\
+ osgi.cmpn
+-runvm: -ea
+-runee: JavaSE-1.7
-runsystempackages: sun.reflect
--runproperties: \
- org.apache.felix.eventadmin.Timeout=0,\
- org.apache.felix.log.storeDebug=true,\
- org.apache.felix.log.maxSize=1000
-Import-Package: org.apache.ace.agent,\
+-runproperties: ${itestrunprops}
+-baseline:
+
+Test-Cases: ${classes;CONCRETE;EXTENDS;org.apache.ace.it.IntegrationTestBase}
+
+Private-Package: org.apache.ace.agent.itest
+
+Import-Package: \
+ org.apache.ace.agent,\
!org.osgi.service.component.annotations,\
*
Bundle-Version: 1.0.0
Bundle-Name: Apache ACE Agent itest
Bundle-Description: Integration test bundle for the Apache ACE Agent
--baseline:
+Bundle-Category: itest
Modified: ace/trunk/org.apache.ace.agent/bnd.bnd
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent/bnd.bnd?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.agent/bnd.bnd Fri Feb 26 16:55:17 2016
@@ -45,6 +45,5 @@ mavenGroupId: org.apache.ace
javax.servlet,\
org.apache.felix.http.jetty;version='[2.2,3)',\
org.apache.felix.deploymentadmin,\
- org.apache.ace.test;version=latest,\
org.apache.ace.range.api;version=latest,\
org.apache.ace.feedback.common;version=latest
Modified: ace/trunk/org.apache.ace.authentication.itest/bnd.bnd
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.authentication.itest/bnd.bnd?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.authentication.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.authentication.itest/bnd.bnd Fri Feb 26 16:55:17
2016
@@ -1,7 +1,7 @@
# Licensed to the Apache Software Foundation (ASF) under the terms of ASLv2
(http://www.apache.org/licenses/LICENSE-2.0).
-Test-Cases: ${classes;CONCRETE;NAMED;*Test}
-buildpath: \
+ ${^-buildpath},\
junit.osgi,\
osgi.core;version=6.0.0,\
osgi.cmpn,\
@@ -20,8 +20,8 @@ Test-Cases: ${classes;CONCRETE;NAMED;*Te
org.apache.ace.obr.storage;version=latest,\
org.apache.ace.log.api;version=latest,\
org.apache.ace.feedback.common;version=latest
--runfw: org.apache.felix.framework;version='[5.2.0,6)'
--runvm: -ea
+
+-runfw: org.apache.felix.framework;version='[5,6)'
-runbundles: \
osgi.cmpn,\
org.apache.felix.log,\
@@ -67,12 +67,16 @@ Test-Cases: ${classes;CONCRETE;NAMED;*Te
org.apache.ace.feedback.common;version=latest,\
org.apache.ace.useradmin.repository;version=latest,\
org.apache.ace.http.context;version=latest
+-runvm: -ea
+-runee: JavaSE-1.7
+-runsystempackages: sun.reflect
+-runproperties: ${itestrunprops}
+-baseline:
+
+Test-Cases: ${classes;CONCRETE;EXTENDS;org.apache.ace.it.IntegrationTestBase}
Private-Package: org.apache.ace.it.authentication
Bundle-Version: 1.0.0
Bundle-Name: Apache ACE Authentication itest
-Bundle-Category: itest
Bundle-Description: Integration tests for Apache ACE Authentication
--baseline:
-
--dependson: org.apache.ace.useradmin
+Bundle-Category: itest
Modified:
ace/trunk/org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/AuthenticationTestBase.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/AuthenticationTestBase.java?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/AuthenticationTestBase.java
(original)
+++
ace/trunk/org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/AuthenticationTestBase.java
Fri Feb 26 16:55:17 2016
@@ -41,7 +41,7 @@ import junit.framework.Assert;
/**
* Provides a common base class for all authentication integration tests.
*/
-public class AuthenticationTestBase extends IntegrationTestBase {
+public abstract class AuthenticationTestBase extends IntegrationTestBase {
protected static void printLog(LogReaderService logReader) {
Enumeration<?> e = logReader.getLog();
Modified:
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/impl/AuthenticationServiceImplTest.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/impl/AuthenticationServiceImplTest.java?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/impl/AuthenticationServiceImplTest.java
(original)
+++
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/impl/AuthenticationServiceImplTest.java
Fri Feb 26 16:55:17 2016
@@ -19,7 +19,6 @@
package org.apache.ace.authentication.impl;
-import static org.apache.ace.test.utils.TestUtils.UNIT;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
@@ -58,7 +57,7 @@ public class AuthenticationServiceImplTe
/**
* Tests that an exception is thrown if a null context is given.
*/
- @Test(groups = { UNIT }, expectedExceptions =
IllegalArgumentException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testAuthenticateFailsWithNullContext() {
new AuthenticationServiceImpl().authenticate((Object[]) null);
}
@@ -66,7 +65,7 @@ public class AuthenticationServiceImplTe
/**
* Tests that without any authentication processors, no authentication
will take place.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateFailsWithoutAuthProcessors() {
assertNull(createAuthenticationService().authenticate("foo", "bar"));
}
@@ -74,7 +73,7 @@ public class AuthenticationServiceImplTe
/**
* Tests that an exception is thrown if no context is given.
*/
- @Test(groups = { UNIT }, expectedExceptions =
IllegalArgumentException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testAuthenticateFailsWithoutContext() {
new AuthenticationServiceImpl().authenticate();
}
@@ -82,7 +81,7 @@ public class AuthenticationServiceImplTe
/**
* Tests that with a single authentication processors, no authentication
will take place if it is the wrong context.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateFailsWithSingleAuthProcessorAndWrongContext() {
AuthenticationServiceImpl authService = createAuthenticationService();
@@ -98,7 +97,7 @@ public class AuthenticationServiceImplTe
* Tests that with multiple authentication processors, authentication will
take place if it is given the correct
* context.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateSucceedsWithMultipleAuthProcessors() {
Date now = new Date();
@@ -141,7 +140,7 @@ public class AuthenticationServiceImplTe
* Tests that with a single authentication processors, authentication will
take place if it is given the correct
* context.
*/
- @Test(groups = { UNIT })
+ @Test()
public void
testAuthenticateSucceedsWithSingleAuthProcessorAndCorrectContext() {
AuthenticationServiceImpl authService = createAuthenticationService();
@@ -159,7 +158,7 @@ public class AuthenticationServiceImplTe
/**
* Tests that with multiple authentication processors, the correct ones
are returned based on the given context.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testGetProcessorsSelectsCorrectProcessorsBasedOnContext() {
Date now = new Date();
Modified:
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/basicauth/BasicHttpAuthenticationProcessorTest.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/basicauth/BasicHttpAuthenticationProcessorTest.java?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/basicauth/BasicHttpAuthenticationProcessorTest.java
(original)
+++
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/basicauth/BasicHttpAuthenticationProcessorTest.java
Fri Feb 26 16:55:17 2016
@@ -21,7 +21,6 @@ package org.apache.ace.authentication.pr
import static
org.apache.ace.authentication.processor.basicauth.BasicHttpAuthenticationProcessor.AUTHORIZATION_HEADER;
import static
org.apache.ace.authentication.processor.basicauth.BasicHttpAuthenticationProcessor.PROPERTY_KEY_PASSWORD;
import static
org.apache.ace.authentication.processor.basicauth.BasicHttpAuthenticationProcessor.PROPERTY_KEY_USERNAME;
-import static org.apache.ace.test.utils.TestUtils.UNIT;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -60,7 +59,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that a null authentication header will yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateEmptyAuthenticationHeaderYieldsNull() {
User result = new
BasicHttpAuthenticationProcessor().authenticate(m_userAdmin, m_servletRequest);
assertNull(result, "Expected no result!");
@@ -69,7 +68,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that an invalid authentication header will yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateInvalidAuthenticationHeaderYieldsNull() {
when(m_servletRequest.getHeader(AUTHORIZATION_HEADER)).thenReturn(createAuthHeaderValue("bob"));
@@ -86,7 +85,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that a known user with an invalid password will yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateKnownUserWithInvalidPasswordYieldsNull() {
when(m_servletRequest.getHeader(AUTHORIZATION_HEADER)).thenReturn(createAuthHeaderValue("bob:secret"));
@@ -103,7 +102,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that a known user will not yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateKnownUserYieldsValidResult() {
when(m_servletRequest.getHeader(AUTHORIZATION_HEADER)).thenReturn(createAuthHeaderValue("bob:secret"));
@@ -122,7 +121,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that a non Base64 authentication header will yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateNonBase64AuthenticationHeaderYieldsNull() {
when(m_servletRequest.getHeader(AUTHORIZATION_HEADER)).thenReturn("foo");
@@ -133,7 +132,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that a class cast exception is thrown for invalid context when
calling authenticate.
*/
- @Test(groups = { UNIT }, expectedExceptions = ClassCastException.class)
+ @Test(expectedExceptions = ClassCastException.class)
public void testAuthenticateThrowsClassCastForInvalidContext() {
new BasicHttpAuthenticationProcessor().authenticate(m_userAdmin, new
Object());
}
@@ -141,7 +140,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that an unknown user will yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateUnknownUserYieldsNull() {
when(m_servletRequest.getHeader(AUTHORIZATION_HEADER)).thenReturn(createAuthHeaderValue("alice:secret"));
@@ -152,7 +151,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that canHandle yields false for any object other than {@link
HttpServletRequest}.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testCanHandleDoesAcceptServletRequest() {
assertTrue(new
BasicHttpAuthenticationProcessor().canHandle(mock(HttpServletRequest.class)));
}
@@ -160,7 +159,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that canHandle throws an {@link IllegalArgumentException} for an
empty context.
*/
- @Test(groups = { UNIT }, expectedExceptions =
IllegalArgumentException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testCanHandleDoesNotAcceptEmptyArray() {
new BasicHttpAuthenticationProcessor().canHandle(new Object[0]);
}
@@ -168,7 +167,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that canHandle throws an {@link IllegalArgumentException} for a
null context.
*/
- @Test(groups = { UNIT }, expectedExceptions =
IllegalArgumentException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testCanHandleDoesNotAcceptNull() {
new BasicHttpAuthenticationProcessor().canHandle((Object[]) null);
}
@@ -176,7 +175,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that canHandle yields false for any object other than {@link
HttpServletRequest}.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testCanHandleDoesNotAcceptUnhandledContext() {
assertFalse(new BasicHttpAuthenticationProcessor().canHandle(new
Object()));
}
@@ -184,7 +183,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that updated throws an exception for missing "key.username"
property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptEmptyKeyUsername() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
props.put(PROPERTY_KEY_USERNAME, "");
@@ -196,7 +195,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that updated throws an exception for missing "key.username"
property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptMissingKeyUsername() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
props.put(PROPERTY_KEY_PASSWORD, "foo");
@@ -207,7 +206,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that updated throws an exception for missing "key.password"
property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptMissingKeyPassword() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
props.put(PROPERTY_KEY_USERNAME, "foo");
@@ -218,7 +217,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that updated throws an exception for missing "key.password"
property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptEmptyKeyPassword() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
props.put(PROPERTY_KEY_USERNAME, "foo");
@@ -230,7 +229,7 @@ public class BasicHttpAuthenticationProc
/**
* Tests that updated does not throw an exception for a correct
configuration.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testUpdatedDoesAcceptCorrectProperties() throws
ConfigurationException {
final String keyUsername = "foo";
final String keyPassword = "bar";
Modified:
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clientcert/ClientCertAuthenticationProcessorTest.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clientcert/ClientCertAuthenticationProcessorTest.java?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clientcert/ClientCertAuthenticationProcessorTest.java
(original)
+++
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clientcert/ClientCertAuthenticationProcessorTest.java
Fri Feb 26 16:55:17 2016
@@ -23,7 +23,6 @@ import static org.apache.ace.authenticat
import static
org.apache.ace.authentication.processor.clientcert.ClientCertAuthenticationProcessor.PROPERTY_USERNAME_LOOKUPKEY;
import static
org.apache.ace.authentication.processor.clientcert.ClientCertAuthenticationProcessor.PROPERTY_USERNAME_MATCH_POLICY;
import static
org.apache.ace.authentication.processor.clientcert.ClientCertAuthenticationProcessor.PROPERTY_VERIFY_CERT_VALIDITY;
-import static org.apache.ace.test.utils.TestUtils.UNIT;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -135,7 +134,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that a null certificate chain will yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateNoCertificateChainYieldsNull() {
User result = createAuthorizationProcessor().authenticate(m_userAdmin,
m_servletRequest);
assertNull(result, "Did not expect a valid user to be returned!");
@@ -144,7 +143,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that an empty certificate chain will yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateEmptyCertificateChainYieldsNull() {
when(m_servletRequest.getAttribute(ATTRIBUTE_X509_CERTIFICATE)).thenReturn(new
X509Certificate[0]);
@@ -155,7 +154,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that authenticating a known user with an invalid (expired)
certificate will yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateKnownUserWithExpiredCertificateYieldsNull() {
X509Certificate[] certificateChain =
createExpiredCertificateChain("bob");
PublicKey publickey = certificateChain[0].getPublicKey();
@@ -175,7 +174,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that authenticating a known user with an invalid (not valid)
certificate will yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateKnownUserWithNotValidCertificateYieldsNull() {
X509Certificate[] certificateChain =
createExpiredCertificateChain("bob");
PublicKey publickey = certificateChain[0].getPublicKey();
@@ -196,7 +195,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that authenticating a known user with a valid certificate will
not yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateKnownUserYieldsValidResult() {
X509Certificate[] certChain = createValidCertificateChain("bob");
@@ -216,7 +215,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that authenticating a known user with a valid certificate chain
will not yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void
testAuthenticateKnownUserWithValidCertificateChainYieldsValidResult() throws
ConfigurationException {
ClientCertAuthenticationProcessor processor =
createAuthorizationProcessor();
@@ -248,7 +247,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that a missing cipher suite header will the authenticate method
to yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateMissingCipherSuiteHeaderYieldsNull() {
when(m_servletRequest.getAttribute(ATTRIBUTE_CIPHER_SUITE)).thenReturn(null);
when(m_servletRequest.getAttribute(ATTRIBUTE_X509_CERTIFICATE)).thenReturn(createValidCertificateChain("bob"));
@@ -260,7 +259,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that a class cast exception is thrown for invalid context when
calling authenticate.
*/
- @Test(groups = { UNIT }, expectedExceptions = ClassCastException.class)
+ @Test(expectedExceptions = ClassCastException.class)
public void testAuthenticateThrowsClassCastForInvalidContext() {
createAuthorizationProcessor().authenticate(m_userAdmin, new Object());
}
@@ -268,7 +267,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that an unknown user will yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateUnknownUserYieldsNull() {
when(m_servletRequest.getAttribute(ATTRIBUTE_X509_CERTIFICATE)).thenReturn(createValidCertificateChain("bob"));
@@ -279,7 +278,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that canHandle yields false for any object other than {@link
HttpServletRequest}.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testCanHandleDoesAcceptServletRequest() {
when(m_servletRequest.getAttribute(ATTRIBUTE_X509_CERTIFICATE)).thenReturn(createValidCertificateChain("alice"));
@@ -289,7 +288,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that canHandle throws an {@link IllegalArgumentException} for an
empty context.
*/
- @Test(groups = { UNIT }, expectedExceptions =
IllegalArgumentException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testCanHandleDoesNotAcceptEmptyArray() {
createAuthorizationProcessor().canHandle(new Object[0]);
}
@@ -297,7 +296,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that canHandle throws an {@link IllegalArgumentException} for a
null context.
*/
- @Test(groups = { UNIT }, expectedExceptions =
IllegalArgumentException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testCanHandleDoesNotAcceptNull() {
createAuthorizationProcessor().canHandle((Object[]) null);
}
@@ -305,7 +304,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that canHandle yields false for any object other than {@link
HttpServletRequest}.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testCanHandleDoesNotAcceptUnhandledContext() {
assertFalse(createAuthorizationProcessor().canHandle(new Object()));
}
@@ -313,7 +312,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that updated does not throw an exception for a correct
configuration.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testUpdatedDoesAcceptCorrectProperties() throws
ConfigurationException {
final String lookupKey = "anyKey";
final String matchPolicy = "cn";
@@ -347,7 +346,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that updated throws an exception for missing "username match
policy" property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptEmptyMatchPolicy() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
@@ -361,7 +360,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that updated throws an exception for missing "username lookup
key" property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptEmptyLookupKey() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
@@ -375,7 +374,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that updated throws an exception for missing "verify cert
validity" property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptEmptyVerifyCertValidity() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
@@ -389,7 +388,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that updated throws an exception for missing "username match
policy" property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptMissingMatchPolicy() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
@@ -402,7 +401,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that updated throws an exception for missing "user name lookup
key" property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptMissingUsernameLookupKey() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
@@ -415,7 +414,7 @@ public class ClientCertAuthenticationPro
/**
* Tests that updated throws an exception for missing "verify cert
validity" property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptMissingVerifyCertValidity() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
Modified:
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/password/PasswordAuthenticationProcessorTest.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/password/PasswordAuthenticationProcessorTest.java?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/password/PasswordAuthenticationProcessorTest.java
(original)
+++
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/password/PasswordAuthenticationProcessorTest.java
Fri Feb 26 16:55:17 2016
@@ -21,7 +21,6 @@ package org.apache.ace.authentication.pr
import static
org.apache.ace.authentication.processor.password.PasswordAuthenticationProcessor.PROPERTY_KEY_PASSWORD;
import static
org.apache.ace.authentication.processor.password.PasswordAuthenticationProcessor.PROPERTY_KEY_USERNAME;
import static
org.apache.ace.authentication.processor.password.PasswordAuthenticationProcessor.PROPERTY_PASSWORD_HASHMETHOD;
-import static org.apache.ace.test.utils.TestUtils.UNIT;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -60,7 +59,7 @@ public class PasswordAuthenticationProce
/**
* Tests that authenticating with a empty username will yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateEmptyUserNameYieldsNull() {
User result = new
PasswordAuthenticationProcessor().authenticate(m_userAdmin, "", "secret");
assertNull(result, "Expected no valid user to be returned!");
@@ -69,7 +68,7 @@ public class PasswordAuthenticationProce
/**
* Tests that authenticating a known user with an invalid password will
yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateKnownUserWithInvalidPasswordYieldsNull() {
User user = mock(User.class);
when(user.getName()).thenReturn("bob");
@@ -84,7 +83,7 @@ public class PasswordAuthenticationProce
/**
* Tests that authenticating a known user with a correct password will not
yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateKnownUserYieldsValidResult() {
User user = mock(User.class);
when(user.getName()).thenReturn("bob");
@@ -101,7 +100,7 @@ public class PasswordAuthenticationProce
/**
* Tests that authenticating with a null password will yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateNullPasswordYieldsNull() {
User result = new
PasswordAuthenticationProcessor().authenticate(m_userAdmin, "bob", null);
assertNull(result, "Expected no valid user to be returned!");
@@ -110,7 +109,7 @@ public class PasswordAuthenticationProce
/**
* Tests that authenticating with a null username will yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateNullUserNameYieldsNull() {
User result = new
PasswordAuthenticationProcessor().authenticate(m_userAdmin, null, "secret");
assertNull(result, "Expected no valid user to be returned!");
@@ -119,7 +118,7 @@ public class PasswordAuthenticationProce
/**
* Tests that a class cast exception is thrown for invalid context when
calling authenticate.
*/
- @Test(groups = { UNIT }, expectedExceptions = ClassCastException.class)
+ @Test(expectedExceptions = ClassCastException.class)
public void testAuthenticateThrowsClassCastForInvalidContext() {
new PasswordAuthenticationProcessor().authenticate(m_userAdmin, new
Object(), "foo");
}
@@ -127,7 +126,7 @@ public class PasswordAuthenticationProce
/**
* Tests that authenticating an unknown user will yield null.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testAuthenticateUnknownUserYieldsNull() {
User result = new
PasswordAuthenticationProcessor().authenticate(m_userAdmin, "alice", "secret");
assertNull(result, "Expected no valid user to be returned!");
@@ -136,7 +135,7 @@ public class PasswordAuthenticationProce
/**
* Tests that canHandle yields true for string and byte array.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testCanHandleDoesAcceptStringAndByteArray() {
assertTrue(new PasswordAuthenticationProcessor().canHandle("foo",
"bar".getBytes()), "Expected the processor to handle a byte array!");
}
@@ -144,7 +143,7 @@ public class PasswordAuthenticationProce
/**
* Tests that canHandle yields true for two strings.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testCanHandleDoesAcceptTwoStrings() {
assertTrue(new PasswordAuthenticationProcessor().canHandle("foo",
"bar"), "Expected the processor to handle a string!");
}
@@ -152,7 +151,7 @@ public class PasswordAuthenticationProce
/**
* Tests that canHandle throws an {@link IllegalArgumentException} for an
empty context.
*/
- @Test(groups = { UNIT }, expectedExceptions =
IllegalArgumentException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testCanHandleDoesNotAcceptEmptyArray() {
new PasswordAuthenticationProcessor().canHandle(new Object[0]);
}
@@ -160,7 +159,7 @@ public class PasswordAuthenticationProce
/**
* Tests that canHandle throws an {@link IllegalArgumentException} for a
null context.
*/
- @Test(groups = { UNIT }, expectedExceptions =
IllegalArgumentException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testCanHandleDoesNotAcceptNull() {
new PasswordAuthenticationProcessor().canHandle((Object[]) null);
}
@@ -168,7 +167,7 @@ public class PasswordAuthenticationProce
/**
* Tests that canHandle yields false for too few arguments.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testCanHandleDoesNotAcceptSingleArgument() {
assertFalse(new PasswordAuthenticationProcessor().canHandle(new
Object()), "Expected the processor to NOT handle any object!");
}
@@ -176,7 +175,7 @@ public class PasswordAuthenticationProce
/**
* Tests that canHandle yields false for a string and other object.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testCanHandleDoesNotAcceptStringAndOtherObject() {
assertFalse(new PasswordAuthenticationProcessor().canHandle("foo", new
Object()), "Expected the processor to NOT handle any object!");
}
@@ -184,7 +183,7 @@ public class PasswordAuthenticationProce
/**
* Tests that canHandle yields false for any object other than {@link
HttpServletRequest}.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testCanHandleDoesNotAcceptWrongTypes() {
assertFalse(new PasswordAuthenticationProcessor().canHandle(new
Object(), new Object()), "Expected the processor to NOT handle any object!");
}
@@ -192,7 +191,7 @@ public class PasswordAuthenticationProce
/**
* Tests that updated does not throw an exception for a correct
configuration.
*/
- @Test(groups = { UNIT })
+ @Test()
public void testUpdatedDoesAcceptCorrectProperties() throws
ConfigurationException {
final String keyUsername = "foo";
final String keyPassword = "bar";
@@ -225,7 +224,7 @@ public class PasswordAuthenticationProce
/**
* Tests that updated throws an exception for missing "key.password"
property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptEmptyKeyPassword() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
@@ -239,7 +238,7 @@ public class PasswordAuthenticationProce
/**
* Tests that updated throws an exception for missing "key.username"
property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptEmptyKeyUsername() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
@@ -253,7 +252,7 @@ public class PasswordAuthenticationProce
/**
* Tests that updated throws an exception for missing "password.hashtype"
property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptEmptyPasswordHashType() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
@@ -267,7 +266,7 @@ public class PasswordAuthenticationProce
/**
* Tests that updated throws an exception for missing "key.password"
property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptMissingKeyPassword() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
@@ -280,7 +279,7 @@ public class PasswordAuthenticationProce
/**
* Tests that updated throws an exception for missing "key.username"
property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptMissingKeyUsername() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
@@ -293,7 +292,7 @@ public class PasswordAuthenticationProce
/**
* Tests that updated throws an exception for missing "password.hashtype"
property.
*/
- @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class)
+ @Test(expectedExceptions = ConfigurationException.class)
public void testUpdatedDoesNotAcceptMissingPasswordHashType() throws
ConfigurationException {
Dictionary<String, Object> props = new Hashtable<>();
Modified:
ace/trunk/org.apache.ace.builder/test/org/apache/ace/builder/ArtifactDataTest.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.builder/test/org/apache/ace/builder/ArtifactDataTest.java?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.builder/test/org/apache/ace/builder/ArtifactDataTest.java
(original)
+++
ace/trunk/org.apache.ace.builder/test/org/apache/ace/builder/ArtifactDataTest.java
Fri Feb 26 16:55:17 2016
@@ -18,7 +18,6 @@
*/
package org.apache.ace.builder;
-import static org.apache.ace.test.utils.TestUtils.UNIT;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.*;
@@ -45,7 +44,7 @@ public class ArtifactDataTest {
m_fakeURL = tmpFile.toURI().toURL();
}
- @Test(groups = { UNIT })
+ @Test()
public void testCreateArtifactWithoutParametersOk() throws Exception {
ArtifactData artifact = ArtifactData.createArtifact(m_fakeURL,
m_filename, "rp");
@@ -57,7 +56,7 @@ public class ArtifactDataTest {
assertFalse(artifact.isBundle());
}
- @Test(groups = { UNIT })
+ @Test()
public void testCreateBundleWithoutParametersOk() throws Exception {
ArtifactData artifact = ArtifactData.createBundle(m_fakeURL,
m_filename, "my.bundle.name", "1.0.0");
@@ -69,7 +68,7 @@ public class ArtifactDataTest {
assertTrue(artifact.isBundle());
}
- @Test(groups = { UNIT })
+ @Test()
public void testCreateBundleWithParametersOk() throws Exception {
ArtifactData artifact = ArtifactData.createBundle(m_fakeURL,
m_filename, "my.bundle.name;singleton:=true, foo:=bar", "1.0.0");
@@ -81,7 +80,7 @@ public class ArtifactDataTest {
assertTrue(artifact.isBundle());
}
- @Test(groups = { UNIT })
+ @Test()
public void testCreateResourceProcessorWithoutParametersOk() throws
Exception {
ArtifactData artifact =
ArtifactData.createResourceProcessor(m_fakeURL, m_filename, "my.bundle.name",
"1.0.0", "rp");
@@ -93,7 +92,7 @@ public class ArtifactDataTest {
assertTrue(artifact.isBundle());
}
- @Test(groups = { UNIT })
+ @Test()
public void testCreateResourceProcessorWithParametersOk() throws Exception
{
ArtifactData artifact =
ArtifactData.createResourceProcessor(m_fakeURL, m_filename,
"my.bundle.name;singleton:=true, foo:=bar", "1.0.0", "rp;qux:=quu");
Modified:
ace/trunk/org.apache.ace.builder/test/org/apache/ace/builder/DeploymentPackageBuilderTest.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.builder/test/org/apache/ace/builder/DeploymentPackageBuilderTest.java?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.builder/test/org/apache/ace/builder/DeploymentPackageBuilderTest.java
(original)
+++
ace/trunk/org.apache.ace.builder/test/org/apache/ace/builder/DeploymentPackageBuilderTest.java
Fri Feb 26 16:55:17 2016
@@ -18,8 +18,6 @@
*/
package org.apache.ace.builder;
-import static org.apache.ace.test.utils.TestUtils.UNIT;
-
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
@@ -35,7 +33,7 @@ import org.testng.Assert;
import org.testng.annotations.Test;
public class DeploymentPackageBuilderTest {
- @Test(groups = { UNIT })
+ @Test()
public void testEmptyDeploymentPackage() throws Exception {
File tempFile = File.createTempFile("output-", ".jar");
System.out.println("File: " + tempFile);
@@ -51,7 +49,7 @@ public class DeploymentPackageBuilderTes
Assert.assertTrue(m.getEntries().isEmpty());
}
- @Test(groups = { UNIT })
+ @Test()
public void testProcessorAndResourceDeploymentPackage() throws Exception {
File tempFile = File.createTempFile("output-", ".jar");
FileOutputStream output = new FileOutputStream(tempFile);
@@ -86,7 +84,7 @@ public class DeploymentPackageBuilderTes
"Resource-Processor", pid);
}
- @Test(groups = { UNIT }, expectedExceptions = { Exception.class })
+ @Test(expectedExceptions = { Exception.class })
public void testResourceWithoutProcessorDeploymentPackage() throws
Exception {
File tempFile = File.createTempFile("output-", ".jar");
FileOutputStream output = new FileOutputStream(tempFile);
@@ -102,7 +100,7 @@ public class DeploymentPackageBuilderTes
.generate(output);
}
- @Test(groups = { UNIT })
+ @Test()
public void testSingleBundleDeploymentPackage() throws Exception {
File tempFile = File.createTempFile("output-", ".jar");
FileOutputStream output = new FileOutputStream(tempFile);
@@ -127,7 +125,7 @@ public class DeploymentPackageBuilderTes
"Bundle-Version", bundleVersion);
}
- @Test(groups = { UNIT })
+ @Test()
public void testTwoBundleDeploymentPackage() throws Exception {
File tempFile = File.createTempFile("output-", ".jar");
FileOutputStream output = new FileOutputStream(tempFile);
Modified: ace/trunk/org.apache.ace.client.repository.itest/bnd.bnd
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository.itest/bnd.bnd?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.client.repository.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.client.repository.itest/bnd.bnd Fri Feb 26
16:55:17 2016
@@ -1,7 +1,7 @@
# Licensed to the Apache Software Foundation (ASF) under the terms of ASLv2
(http://www.apache.org/licenses/LICENSE-2.0).
-Test-Cases: ${classes;CONCRETE;EXTENDS;org.apache.ace.it.IntegrationTestBase}
-buildpath: \
+ ${^-buildpath},\
junit.osgi,\
osgi.core;version=6.0.0,\
osgi.cmpn,\
@@ -21,9 +21,10 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;o
org.apache.ace.client.repository.helper.bundle;version=latest,\
org.apache.ace.log.server.store.api;version=latest,\
org.apache.ace.feedback.common;version=latest
--runfw: org.apache.felix.framework;version='[5.2.0,6)'
--runvm: -ea
--runbundles: osgi.cmpn,\
+
+-runfw: org.apache.felix.framework;version='[5,6)'
+-runbundles: \
+ osgi.cmpn,\
org.apache.felix.dependencymanager,\
org.apache.felix.configadmin,\
org.apache.felix.eventadmin,\
@@ -65,16 +66,16 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;o
org.apache.ace.client.repository.impl;version=latest,\
org.apache.ace.feedback.common;version=latest,\
org.apache.ace.http.context;version=latest
-
--runproperties: \
- org.apache.felix.eventadmin.Timeout=0,\
- org.apache.felix.log.storeDebug=true,\
- org.apache.felix.log.maxSize=-1,\
-
org.osgi.framework.bootdelegation="com.yourkit.*,com.sun.*,sun.*,apple.*,com.apple.*"
+-runvm: -ea
+-runee: JavaSE-1.7
+-runsystempackages: sun.reflect
+-runproperties: ${itestrunprops}
+-baseline:
+
+Test-Cases: ${classes;CONCRETE;EXTENDS;org.apache.ace.it.IntegrationTestBase}
Private-Package: org.apache.ace.it.repositoryadmin
Bundle-Version: 1.0.0
Bundle-Name: Apache ACE Client Repository itest
-Bundle-Category: itest
Bundle-Description: Integration test bundle for the Apache ACE Client
Repository
--baseline:
+Bundle-Category: itest
Modified:
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessorTest.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessorTest.java?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessorTest.java
(original)
+++
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessorTest.java
Fri Feb 26 16:55:17 2016
@@ -18,8 +18,6 @@
*/
package org.apache.ace.client.repository.helper.base;
-import static org.apache.ace.test.utils.TestUtils.UNIT;
-
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@@ -58,7 +56,7 @@ public class VelocityArtifactPreprocesso
/**
* Test case for {@link
VelocityArtifactPreprocessor#needsNewVersion(String, PropertyResolver, String,
String)}
*/
- @Test(groups = { UNIT })
+ @Test()
public void testNeedsNewVersionChangedTemplateOk() throws Exception {
final VelocityArtifactPreprocessor vap = createProcessor();
@@ -79,7 +77,7 @@ public class VelocityArtifactPreprocesso
/**
* Test case for {@link
VelocityArtifactPreprocessor#needsNewVersion(String, PropertyResolver, String,
String)}
*/
- @Test(groups = { UNIT })
+ @Test()
public void testNeedsNewVersionEmptyTemplateOk() throws Exception {
final VelocityArtifactPreprocessor vap = createProcessor();
@@ -95,7 +93,7 @@ public class VelocityArtifactPreprocesso
/**
* Test case for {@link
VelocityArtifactPreprocessor#needsNewVersion(String, PropertyResolver, String,
String)}
*/
- @Test(groups = { UNIT })
+ @Test()
public void testNeedsNewVersionNonExistingTemplateOk() throws Exception {
final VelocityArtifactPreprocessor vap = createProcessor();
@@ -109,7 +107,7 @@ public class VelocityArtifactPreprocesso
/**
* Test case for {@link
VelocityArtifactPreprocessor#needsNewVersion(String, PropertyResolver, String,
String)}
*/
- @Test(groups = { UNIT })
+ @Test()
public void testNeedsNewVersionUnchangedTemplateOk() throws Exception {
final VelocityArtifactPreprocessor vap = createProcessor();
@@ -128,7 +126,7 @@ public class VelocityArtifactPreprocesso
/**
* Test case for {@link VelocityArtifactPreprocessor#preprocess(String,
PropertyResolver, String, String, java.net.URL)}
*/
- @Test(groups = { UNIT })
+ @Test()
public void testPreprocessExistingNoTemplateOk() throws Exception {
String url = createArtifact("Message: [context.msg]");
@@ -141,7 +139,7 @@ public class VelocityArtifactPreprocesso
/**
* Test case for {@link VelocityArtifactPreprocessor#preprocess(String,
PropertyResolver, String, String, java.net.URL)}
*/
- @Test(groups = { UNIT })
+ @Test()
public void testPreprocessExistingRealTemplateOk() throws Exception {
String url = createArtifact("Message: [$context.msg]");
@@ -156,7 +154,7 @@ public class VelocityArtifactPreprocesso
/**
* Test case for {@link VelocityArtifactPreprocessor#preprocess(String,
PropertyResolver, String, String, java.net.URL)}
*/
- @Test(groups = { UNIT }, expectedExceptions = { IOException.class })
+ @Test(expectedExceptions = { IOException.class })
public void testPreprocessNonExistingTemplateOk() throws Exception {
// Should be something that really doesn't exist somehow...
String url = "file:///path/to/nowhere-" + System.currentTimeMillis();
Modified:
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/bundle/impl/BundleHelperTest.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/bundle/impl/BundleHelperTest.java?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/bundle/impl/BundleHelperTest.java
(original)
+++
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/bundle/impl/BundleHelperTest.java
Fri Feb 26 16:55:17 2016
@@ -18,7 +18,6 @@
*/
package org.apache.ace.client.repository.helper.bundle.impl;
-import static org.apache.ace.test.utils.TestUtils.UNIT;
import static org.testng.Assert.*;
import java.io.ByteArrayInputStream;
@@ -47,13 +46,13 @@ public class BundleHelperTest {
m_helper = new BundleHelperImpl();
}
- @Test(groups = { UNIT })
+ @Test()
public void testMimetype() {
assertTrue(m_helper.canHandle("application/vnd.osgi.bundle"), "Should
be able to handle bundle mimetype.");
assertFalse(m_helper.canHandle("somecrazy/mimetype"), "Should not be
able to handle crazy mimetype.");
}
- @Test(groups = { UNIT })
+ @Test()
public void testManifestExtraction() {
ArtifactResource artifact = new ArtifactResource() {
@Override
@@ -86,7 +85,7 @@ public class BundleHelperTest {
assertEquals(map.get(ArtifactObject.KEY_ARTIFACT_NAME), "My Cool
Bundle-1.0.0");
}
- @Test(groups = { UNIT })
+ @Test()
public void testLocalizedManifestExtraction() {
ArtifactResource artifact = new ArtifactResource() {
@Override
@@ -130,7 +129,7 @@ public class BundleHelperTest {
assertEquals(map.get(ArtifactObject.KEY_ARTIFACT_NAME), "The Coolest
Bundle-1.0.0");
}
- @Test(groups = { UNIT })
+ @Test()
public void testLocalizedManifestExtractionWithDefaultBase() {
// note that we do not set the Bundle-Localization header
ArtifactResource artifact = new ArtifactResource() {
@@ -168,7 +167,7 @@ public class BundleHelperTest {
assertEquals(map.get(ArtifactObject.KEY_ARTIFACT_NAME), "The Coolest
Bundle-1.0.0");
}
- @Test(groups = { UNIT })
+ @Test()
public void testLocalizedManifestExtractionWithLocale() {
ArtifactResource artifact = new ArtifactResource() {
@Override
@@ -207,7 +206,7 @@ public class BundleHelperTest {
assertEquals(map.get(ArtifactObject.KEY_ARTIFACT_NAME), "De koelste
Bundle-1.0.0");
}
- @Test(groups = { UNIT })
+ @Test()
public void testLocalizedManifestExtractionWithLocaleOverrule() {
ArtifactResource artifact = new ArtifactResource() {
@Override
Modified:
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/configuration/impl/ConfigurationHelperImplTest.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/configuration/impl/ConfigurationHelperImplTest.java?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/configuration/impl/ConfigurationHelperImplTest.java
(original)
+++
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/configuration/impl/ConfigurationHelperImplTest.java
Fri Feb 26 16:55:17 2016
@@ -18,7 +18,6 @@
*/
package org.apache.ace.client.repository.helper.configuration.impl;
-import static org.apache.ace.test.utils.TestUtils.UNIT;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
@@ -42,7 +41,7 @@ public class ConfigurationHelperImplTest
// ACE-259 Basic recognizer tests
- @Test(groups = { UNIT })
+ @Test()
public void testCanHandleCommentBeforeRoot() throws Exception {
ConfigurationHelperImpl c = createConfigurationHelper();
String mime =
c.recognize(convertToArtifactResource("validWithComment.xml"));
@@ -51,7 +50,7 @@ public class ConfigurationHelperImplTest
verifyZeroInteractions(m_mockLogService);
}
- @Test(groups = { UNIT })
+ @Test()
public void testInvalidXmlContentNotRecognized() throws Exception {
ConfigurationHelperImpl c = createConfigurationHelper();
String mime = c.recognize(convertToArtifactResource("invalid.xml"));
@@ -61,7 +60,7 @@ public class ConfigurationHelperImplTest
verifyNoMoreInteractions(m_mockLogService);
}
- @Test(groups = { UNIT })
+ @Test()
public void testNamespace10Recognized() throws Exception {
ConfigurationHelperImpl c = createConfigurationHelper();
String mime = c.recognize(convertToArtifactResource("valid10.xml"));
@@ -70,7 +69,7 @@ public class ConfigurationHelperImplTest
verifyZeroInteractions(m_mockLogService);
}
- @Test(groups = { UNIT })
+ @Test()
public void testNamespace11Recognized() throws Exception {
ConfigurationHelperImpl c = createConfigurationHelper();
String mime = c.recognize(convertToArtifactResource("valid11.xml"));
@@ -79,7 +78,7 @@ public class ConfigurationHelperImplTest
verifyZeroInteractions(m_mockLogService);
}
- @Test(groups = { UNIT })
+ @Test()
public void testNamespace12Recognized() throws Exception {
ConfigurationHelperImpl c = createConfigurationHelper();
String mime = c.recognize(convertToArtifactResource("valid12.xml"));
@@ -88,7 +87,7 @@ public class ConfigurationHelperImplTest
verifyZeroInteractions(m_mockLogService);
}
- @Test(groups = { UNIT })
+ @Test()
public void testNamespace13NotRecognized() throws Exception {
ConfigurationHelperImpl c = createConfigurationHelper();
String mime = c.recognize(convertToArtifactResource("invalid13.xml"));
@@ -97,7 +96,7 @@ public class ConfigurationHelperImplTest
verifyZeroInteractions(m_mockLogService);
}
- @Test(groups = { UNIT })
+ @Test()
public void testNoXmlContentNotRecognized() throws Exception {
ConfigurationHelperImpl c = createConfigurationHelper();
String mime = c.recognize(convertToArtifactResource("invalid.txt"));
Modified:
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/user/impl/UserHelperImplTest.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/user/impl/UserHelperImplTest.java?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/user/impl/UserHelperImplTest.java
(original)
+++
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/helper/user/impl/UserHelperImplTest.java
Fri Feb 26 16:55:17 2016
@@ -18,7 +18,6 @@
*/
package org.apache.ace.client.repository.helper.user.impl;
-import static org.apache.ace.test.utils.TestUtils.UNIT;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
@@ -43,7 +42,7 @@ import org.testng.annotations.Test;
public class UserHelperImplTest {
private LogService m_mockLogService;
- @Test(groups = { UNIT })
+ @Test()
public void testCanHandleCommentBeforeRoot() throws Exception {
UserHelperImpl uh = createUserHelper();
String mime =
uh.recognize(convertToArtifactResource("validUserAdminWithComment.xml"));
@@ -52,7 +51,7 @@ public class UserHelperImplTest {
verifyZeroInteractions(m_mockLogService);
}
- @Test(groups = { UNIT })
+ @Test()
public void testInvalidUserAdminXmlContent() throws Exception {
UserHelperImpl uh = createUserHelper();
String mime =
uh.recognize(convertToArtifactResource("invalidUserAdmin.xml"));
@@ -61,7 +60,7 @@ public class UserHelperImplTest {
verifyZeroInteractions(m_mockLogService);
}
- @Test(groups = { UNIT })
+ @Test()
public void testInvalidXmlContentNotRecognized() throws Exception {
UserHelperImpl uh = createUserHelper();
String mime = uh.recognize(convertToArtifactResource("invalid.xml"));
@@ -71,7 +70,7 @@ public class UserHelperImplTest {
verifyNoMoreInteractions(m_mockLogService);
}
- @Test(groups = { UNIT })
+ @Test()
public void testNoUserAdminXmlContent() throws Exception {
UserHelperImpl uh = createUserHelper();
String mime = uh.recognize(convertToArtifactResource("valid10.xml"));
@@ -80,7 +79,7 @@ public class UserHelperImplTest {
verifyZeroInteractions(m_mockLogService);
}
- @Test(groups = { UNIT })
+ @Test()
public void testNoXmlContentNotRecognized() throws Exception {
UserHelperImpl uh = createUserHelper();
String mime = uh.recognize(convertToArtifactResource("invalid.txt"));
@@ -90,7 +89,7 @@ public class UserHelperImplTest {
verifyNoMoreInteractions(m_mockLogService);
}
- @Test(groups = { UNIT })
+ @Test()
public void testValidUserAdminXmlContent() throws Exception {
UserHelperImpl uh = createUserHelper();
String mime =
uh.recognize(convertToArtifactResource("validUserAdmin.xml"));
Modified:
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/ACE308Test.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/ACE308Test.java?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/ACE308Test.java
(original)
+++
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/ACE308Test.java
Fri Feb 26 16:55:17 2016
@@ -20,7 +20,6 @@ package org.apache.ace.client.repository
import org.apache.ace.client.repository.stateful.impl.LogEventComparator;
import org.apache.ace.feedback.Event;
-import org.apache.ace.test.utils.TestUtils;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -29,7 +28,7 @@ import org.testng.annotations.Test;
* For this specific case, it would fail. After the fix, it no longer fails.
*/
public class ACE308Test {
- @Test(groups = { TestUtils.UNIT })
+ @Test
public void testLogEvents() {
LogEventComparator c = new LogEventComparator();
Event left = new Event("t", 1, 1, -1000000000000000000L, 0);
Modified:
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/ArtifactTest.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/ArtifactTest.java?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/ArtifactTest.java
(original)
+++
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/ArtifactTest.java
Fri Feb 26 16:55:17 2016
@@ -38,8 +38,8 @@ import org.testng.annotations.BeforeMeth
import org.testng.annotations.Test;
/**
- * Tests the behavior of the ArtifactObject class, most prominently, checking
whether
- * delegation to the Helpers is done at the right moments.
+ * Tests the behavior of the ArtifactObject class, most prominently, checking
whether delegation to the Helpers is done
+ * at the right moments.
*/
public class ArtifactTest {
@@ -59,7 +59,7 @@ public class ArtifactTest {
TestUtils.configureObject(m_artifactRepository, BundleContext.class,
bc);
}
- @Test( groups = { TestUtils.UNIT } )
+ @Test()
public void testAttributeChecking() {
ArtifactHelper helper = new MockHelper("yourURL");
@@ -87,7 +87,7 @@ public class ArtifactTest {
}
}
- @Test( groups = { TestUtils.UNIT } )
+ @Test()
public void testResourceProcessorFiltering() throws InvalidSyntaxException
{
m_artifactRepository.addHelper("myMime", new MockHelper());
m_artifactRepository.addHelper(BundleHelper.MIMETYPE, new
BundleHelperImpl());
@@ -114,14 +114,14 @@ public class ArtifactTest {
assert (list.size() == 0) : "Expected no artifact to match the
requested filter!";
}
- @Test( groups = { TestUtils.UNIT } )
+ @Test()
public void testArtifactSizeDeterminedByRepository() throws
InvalidSyntaxException {
m_artifactRepository.addHelper(BundleHelper.MIMETYPE, new
BundleHelperImpl());
ArtifactObject artifact = createArtifact(BundleHelper.MIMETYPE,
"normalBundle", "normalBundle", null, "10");
List<ArtifactObject> list = m_artifactRepository.get();
assert (list.size() == 1) && list.contains(artifact) : "Expected a
single artifact with the specified mimetype!";
-
+
assert list.get(0).getSize() == 10 : "Expected the size to be filled
in!";
}
@@ -145,8 +145,8 @@ public class ArtifactTest {
}
/**
- * Helper for testing the ArtifactObject. In the constructor, a
<code>replaceURL</code> can
- * be passed in to test the attribute normalization.
+ * Helper for testing the ArtifactObject. In the constructor, a
<code>replaceURL</code> can be passed in to test the
+ * attribute normalization.
*/
class MockHelper implements ArtifactHelper {
private final String m_replaceURL;
@@ -171,11 +171,11 @@ class MockHelper implements ArtifactHelp
}
public String[] getDefiningKeys() {
- return new String[]{ArtifactObject.KEY_URL};
+ return new String[] { ArtifactObject.KEY_URL };
}
public String[] getMandatoryAttributes() {
- return new String[]{ArtifactObject.KEY_URL};
+ return new String[] { ArtifactObject.KEY_URL };
}
public boolean canUse(ArtifactObject object) {
Modified:
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/CachedRepositoryImplTest.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/CachedRepositoryImplTest.java?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/CachedRepositoryImplTest.java
(original)
+++
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/CachedRepositoryImplTest.java
Fri Feb 26 16:55:17 2016
@@ -26,20 +26,18 @@ import org.apache.ace.repository.Reposit
import org.apache.ace.repository.ext.BackupRepository;
import org.apache.ace.repository.ext.CachedRepository;
import org.apache.ace.repository.ext.impl.CachedRepositoryImpl;
-import org.apache.ace.test.utils.TestUtils;
import org.testng.annotations.Test;
public class CachedRepositoryImplTest {
/**
- * Initial checkout: the remote repository contains some data for a given
version,
- * we make the cached repository do a checkout, and check whether all data
arrives at the
- * right places: in getLocal, and in the backup repository.
+ * Initial checkout: the remote repository contains some data for a given
version, we make the cached repository do
+ * a checkout, and check whether all data arrives at the right places: in
getLocal, and in the backup repository.
*/
- @Test( groups = { TestUtils.UNIT } )
+ @Test()
public void testInitialCheckout() throws IllegalArgumentException,
IOException {
Repository m_repository = new MockRepository();
- byte[] testContent = new byte[] {'i', 'n', 'i', 't', 'i', 'a', 'l'};
+ byte[] testContent = new byte[] { 'i', 'n', 'i', 't', 'i', 'a', 'l' };
m_repository.commit(new ByteArrayInputStream(testContent), 0);
BackupRepository m_backupRepository = new MockBackupRepository();
@@ -57,18 +55,17 @@ public class CachedRepositoryImplTest {
}
/**
- * There are two types of commit, one that takes an input stream, and one
that
- * simply flushes whatever is in the current to the remote repository.
- * After each commit, we should be able to renew the cached repository,
- * and checkout the data we put in before.
+ * There are two types of commit, one that takes an input stream, and one
that simply flushes whatever is in the
+ * current to the remote repository. After each commit, we should be able
to renew the cached repository, and
+ * checkout the data we put in before.
*/
- @Test( groups = { TestUtils.UNIT } )
+ @Test()
public void testCommit() throws IllegalArgumentException, IOException {
Repository m_repository = new MockRepository();
BackupRepository m_backupRepository = new MockBackupRepository();
CachedRepository m_cachedRepository = new
CachedRepositoryImpl(m_repository, m_backupRepository, 0);
- byte[] testContent = new byte[] {'i', 'n', 'i', 't', 'i', 'a', 'l'};
+ byte[] testContent = new byte[] { 'i', 'n', 'i', 't', 'i', 'a', 'l' };
InputStream input = new ByteArrayInputStream(testContent);
m_cachedRepository.commit(input, 0);
@@ -78,7 +75,7 @@ public class CachedRepositoryImplTest {
byte[] inputBytes = AdminTestUtil.copy(input);
assert AdminTestUtil.byteArraysEqual(inputBytes, testContent) : "We
got something different than 'initial' from checkout: " + new
String(inputBytes);
- byte[] newTestContent = new byte[] {'n', 'e', 'w'};
+ byte[] newTestContent = new byte[] { 'n', 'e', 'w' };
m_cachedRepository.writeLocal(new
ByteArrayInputStream(newTestContent));
@@ -92,16 +89,17 @@ public class CachedRepositoryImplTest {
/**
* After checking out and changing stuff, we want to revert to the old
version.
+ *
* @throws IOException
* @throws IllegalArgumentException
*/
- @Test( groups = { TestUtils.UNIT } )
+ @Test()
public void testRevert() throws IllegalArgumentException, IOException {
Repository m_repository = new MockRepository();
BackupRepository m_backupRepository = new MockBackupRepository();
CachedRepository m_cachedRepository = new
CachedRepositoryImpl(m_repository, m_backupRepository, 0);
- byte[] testContent = new byte[] {'i', 'n', 'i', 't', 'i', 'a', 'l'};
+ byte[] testContent = new byte[] { 'i', 'n', 'i', 't', 'i', 'a', 'l' };
InputStream input = new ByteArrayInputStream(testContent);
m_cachedRepository.commit(input, 0);
@@ -109,7 +107,7 @@ public class CachedRepositoryImplTest {
m_cachedRepository = new CachedRepositoryImpl(m_repository,
m_backupRepository, 0);
input = m_cachedRepository.checkout(1);
- byte[] newTestContent = new byte[] {'n', 'e', 'w'};
+ byte[] newTestContent = new byte[] { 'n', 'e', 'w' };
m_cachedRepository.writeLocal(new
ByteArrayInputStream(newTestContent));
input = m_cachedRepository.getLocal(false);
Modified:
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/FilebasedBackupRepositoryTest.java
URL:
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/FilebasedBackupRepositoryTest.java?rev=1732517&r1=1732516&r2=1732517&view=diff
==============================================================================
---
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/FilebasedBackupRepositoryTest.java
(original)
+++
ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/FilebasedBackupRepositoryTest.java
Fri Feb 26 16:55:17 2016
@@ -24,7 +24,6 @@ import java.io.IOException;
import java.io.InputStream;
import org.apache.ace.repository.ext.impl.FilebasedBackupRepository;
-import org.apache.ace.test.utils.TestUtils;
import org.testng.annotations.Test;
public class FilebasedBackupRepositoryTest {
@@ -32,7 +31,7 @@ public class FilebasedBackupRepositoryTe
/**
* A basic scenario: we write, backup, write again, and revert.
*/
- @Test( groups = { TestUtils.UNIT } )
+ @Test()
public void testFilebasedBackupRepository() throws IOException {
File current = File.createTempFile("testFilebasedBackupRepository",
null);
File backup = File.createTempFile("testFilebasedBackupRepository",
null);
@@ -41,7 +40,7 @@ public class FilebasedBackupRepositoryTe
FilebasedBackupRepository rep = new FilebasedBackupRepository(current,
backup);
- byte[] testContent = new byte[] {'i', 'n', 'i', 't', 'i', 'a', 'l'};
+ byte[] testContent = new byte[] { 'i', 'n', 'i', 't', 'i', 'a', 'l' };
// write initial content
rep.write(new ByteArrayInputStream(testContent));
@@ -55,7 +54,7 @@ public class FilebasedBackupRepositoryTe
rep.backup();
// write new content
- byte[] newTestContent = new byte[] {'n', 'e', 'w'};
+ byte[] newTestContent = new byte[] { 'n', 'e', 'w' };
rep.write(new ByteArrayInputStream(newTestContent));
// read current content