You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ace.apache.org by ja...@apache.org on 2016/01/22 15:44:52 UTC

svn commit: r1726222 [2/2] - in /ace/trunk: cnf/lib/ cnf/lib/commons-codec/ cnf/lib/commons-collections/ cnf/lib/commons-io/ cnf/lib/commons-lang/ cnf/lib/commons-logging/ cnf/lib/gson/ cnf/lib/javax.inject/ cnf/lib/junit/ cnf/lib/pax-exam-container-na...

Added: ace/trunk/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/ProcessLauncherServiceIntegrationTest.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/ProcessLauncherServiceIntegrationTest.java?rev=1726222&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/ProcessLauncherServiceIntegrationTest.java (added)
+++ ace/trunk/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/ProcessLauncherServiceIntegrationTest.java Fri Jan 22 14:44:51 2016
@@ -0,0 +1,407 @@
+/*
+ * 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.processlauncher.itest;
+
+import static org.apache.ace.processlauncher.itest.TestUtil.getOSName;
+import static org.apache.ace.processlauncher.itest.TestUtil.sleep;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Properties;
+
+import org.apache.ace.it.IntegrationTestBase;
+import org.apache.ace.processlauncher.LaunchConfiguration;
+import org.apache.ace.processlauncher.ProcessLauncherService;
+import org.apache.ace.processlauncher.ProcessStreamListener;
+import org.apache.felix.dm.Component;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.util.tracker.ServiceTracker;
+
+import junit.framework.AssertionFailedError;
+
+/**
+ * Integration test for {@link ProcessLauncherService}.
+ */
+public class ProcessLauncherServiceIntegrationTest extends IntegrationTestBase {
+
+    private final BundleContext m_context = FrameworkUtil.getBundle(getClass()).getBundleContext();
+    private ProcessLauncherService m_instance;
+
+    /**
+     * Tests that manually providing a launch configuration to a {@link ProcessLauncherService} will
+     * cause a new process to be started and terminated.
+     * 
+     * @throws Exception not part of this test case.
+     */
+    public void testLaunchProcessWithExitValueOneOnUnixBasedHostsOk() throws Exception {
+        // Test will not work on Windows!
+        if (getOSName().contains("windows")) {
+            return;
+        }
+
+        Properties launchConfig = new Properties();
+        launchConfig.put("instance.count", "2");
+        launchConfig.put("executable.name", "/bin/sh");
+        launchConfig.put("executable.args", "-c sleep\\ 1\\ &&\\ exit\\ 1");
+        launchConfig.put("executable.workingDir", "/tmp");
+        launchConfig.put("executable.respawnAutomatically", "false");
+        launchConfig.put("executable.normalExitValue", 1);
+
+        int launchConfigCount = m_instance.getLaunchConfigurationCount();
+        int runningProcessCount = m_instance.getRunningProcessCount();
+
+        configureFactory(ProcessLauncherService.PID, launchConfig);
+
+        // One process...
+        assertEquals(launchConfigCount + 1, m_instance.getLaunchConfigurationCount());
+        // Two instances...
+        assertEquals(runningProcessCount + 2, m_instance.getRunningProcessCount());
+
+        // Wait until the processes are done...
+        sleep(1100);
+
+        // One process...
+        assertEquals(launchConfigCount + 1, m_instance.getLaunchConfigurationCount());
+        // Zero instances...
+        assertEquals(runningProcessCount, m_instance.getRunningProcessCount());
+    }
+
+    /**
+     * Tests that manually providing a launch configuration to a {@link ProcessLauncherService}
+     * will cause a new process to be started and terminated.
+     * 
+     * @throws Exception not part of this test case.
+     */
+    public void testLaunchProcessWithExitValueZeroOnUnixBasedHostsOk() throws Exception {
+        // Test will not work on Windows!
+        if (getOSName().contains("windows")) {
+            return;
+        }
+
+        Properties launchConfig = new Properties();
+        launchConfig.put("instance.count", "2");
+        launchConfig.put("executable.name", "/bin/sh");
+        launchConfig.put("executable.args", "-c sleep\\ 1\\ &&\\ exit\\ 0");
+        launchConfig.put("executable.workingDir", "/tmp");
+        launchConfig.put("executable.respawnAutomatically", "false");
+        launchConfig.put("executable.normalExitValue", 0);
+
+        int launchConfigCount = m_instance.getLaunchConfigurationCount();
+        int runningProcessCount = m_instance.getRunningProcessCount();
+
+        configureFactory(ProcessLauncherService.PID, launchConfig);
+
+        // One process...
+        assertEquals(launchConfigCount + 1, m_instance.getLaunchConfigurationCount());
+        // Two instances...
+        assertEquals(runningProcessCount + 2, m_instance.getRunningProcessCount());
+
+        // Wait until the processes are done...
+        sleep(1100);
+
+        // One process...
+        assertEquals(launchConfigCount + 1, m_instance.getLaunchConfigurationCount());
+        // Zero instances...
+        assertEquals(runningProcessCount, m_instance.getRunningProcessCount());
+    }
+
+    /**
+     * Tests that registering multiple process stream listeners will cause the registered listener
+     * with the highest service-ID to be called when a process is executed.
+     * 
+     * @throws Exception not part of this test case.
+     */
+    public void testLaunchProcessWithMultipleRegisteredProcessStreamListenerOnUnixBasedHostsOk() throws Exception {
+        // Test will not work on Windows!
+        if (getOSName().contains("windows")) {
+            return;
+        }
+
+        TestProcessStreamListener psl1 = new TestProcessStreamListener();
+        registerProcessStreamListener(psl1, "qux", "quu");
+        TestProcessStreamListener psl2 = new TestProcessStreamListener();
+        String filter = registerProcessStreamListener(psl2, "qux", "quu");
+
+        Properties launchConfig = new Properties();
+        launchConfig.put("instance.count", "1");
+        launchConfig.put("executable.name", "/bin/sh");
+        launchConfig.put("executable.args", "-c sleep\\ 1\\ &&\\ exit\\ 0");
+        launchConfig.put("executable.processStreamListener", filter);
+        launchConfig.put("executable.workingDir", "/tmp");
+        launchConfig.put("executable.respawnAutomatically", "false");
+        launchConfig.put("executable.normalExitValue", 0);
+
+        int launchConfigCount = m_instance.getLaunchConfigurationCount();
+        int runningProcessCount = m_instance.getRunningProcessCount();
+
+        configureFactory(ProcessLauncherService.PID, launchConfig);
+
+        // One process...
+        assertEquals(launchConfigCount + 1, m_instance.getLaunchConfigurationCount());
+        // Two instances...
+        assertEquals(runningProcessCount + 1, m_instance.getRunningProcessCount());
+
+        // Wait until the processes are done...
+        sleep(1100);
+
+        // Check whether our PSL is obtained and called...
+        assertEquals(1, psl1.m_setStdoutCallCount);
+        assertEquals(1, psl1.m_setStdinCallCount);
+        assertEquals(0, psl2.m_setStdoutCallCount);
+        assertEquals(0, psl2.m_setStdinCallCount);
+
+        // One process...
+        assertEquals(launchConfigCount + 1, m_instance.getLaunchConfigurationCount());
+        // Zero instances...
+        assertEquals(runningProcessCount, m_instance.getRunningProcessCount());
+    }
+
+    /**
+     * Tests that an unregistered process stream listener will cause an exception to be thrown when
+     * a process is to be started.
+     * 
+     * @throws Exception not part of this test case.
+     */
+    public void testLaunchProcessWithoutRegisteredProcessStreamListenerOnUnixBasedHostsFail() throws Exception {
+        // Test will not work on Windows!
+        if (getOSName().contains("windows")) {
+            return;
+        }
+
+        TestProcessStreamListener psl = new TestProcessStreamListener();
+        String filter =
+            String.format("(&(%s=%s)(qux=quu))", Constants.OBJECTCLASS, ProcessStreamListener.class.getName());
+
+        Properties launchConfig = new Properties();
+        launchConfig.put("instance.count", "1");
+        launchConfig.put("executable.name", "/bin/sh");
+        launchConfig.put("executable.args", "-c sleep\\ 1\\ &&\\ exit\\ 0");
+        launchConfig.put("executable.processStreamListener", filter);
+        launchConfig.put("executable.workingDir", "/tmp");
+        launchConfig.put("executable.respawnAutomatically", "false");
+        launchConfig.put("executable.normalExitValue", 0);
+
+        int launchConfigCount = m_instance.getLaunchConfigurationCount();
+        int runningProcessCount = m_instance.getRunningProcessCount();
+
+        configureFactory(ProcessLauncherService.PID, launchConfig);
+
+        // One process...
+        assertEquals(launchConfigCount + 1, m_instance.getLaunchConfigurationCount());
+        // Two instances...
+        assertEquals(runningProcessCount + 1, m_instance.getRunningProcessCount());
+
+        // Wait until the processes are done...
+        sleep(1100);
+
+        // Check whether our PSL is obtained and called...
+        assertEquals(0, psl.m_setStdoutCallCount);
+        assertEquals(0, psl.m_setStdinCallCount);
+
+        // One process...
+        assertEquals(launchConfigCount + 1, m_instance.getLaunchConfigurationCount());
+        // Zero instances...
+        assertEquals(runningProcessCount, m_instance.getRunningProcessCount());
+    }
+
+    /**
+     * Tests that registering a process stream listener will cause the registered listener to be
+     * called when a process is executed.
+     * 
+     * @throws Exception not part of this test case.
+     */
+    public void testLaunchProcessWithRegisteredProcessStreamListenerOnUnixBasedHostsOk() throws Exception {
+        // Test will not work on Windows!
+        if (getOSName().contains("windows")) {
+            return;
+        }
+
+        TestProcessStreamListener psl = new TestProcessStreamListener();
+        String filter = registerProcessStreamListener(psl, "foo", "bar");
+
+        Properties launchConfig = new Properties();
+        launchConfig.put("instance.count", "1");
+        launchConfig.put("executable.name", "/bin/sh");
+        launchConfig.put("executable.args", "-c sleep\\ 1\\ &&\\ exit\\ 0");
+        launchConfig.put("executable.processStreamListener", filter);
+        launchConfig.put("executable.workingDir", "/tmp");
+        launchConfig.put("executable.respawnAutomatically", "false");
+        launchConfig.put("executable.normalExitValue", 0);
+
+        int launchConfigCount = m_instance.getLaunchConfigurationCount();
+        int runningProcessCount = m_instance.getRunningProcessCount();
+
+        configureFactory(ProcessLauncherService.PID, launchConfig);
+
+        // One process...
+        assertEquals(launchConfigCount + 1, m_instance.getLaunchConfigurationCount());
+        // Two instances...
+        assertEquals(runningProcessCount + 1, m_instance.getRunningProcessCount());
+
+        // Wait until the processes are done...
+        sleep(1100);
+
+        // Check whether our PSL is obtained and called...
+        assertEquals(1, psl.m_setStdoutCallCount);
+        assertEquals(1, psl.m_setStdinCallCount);
+
+        // One process...
+        assertEquals(launchConfigCount + 1, m_instance.getLaunchConfigurationCount());
+        // Zero instances...
+        assertEquals(runningProcessCount, m_instance.getRunningProcessCount());
+    }
+
+    /**
+     * Registers a given process stream listener and returns the filter clause to obtain that same
+     * instance through OSGi.
+     * 
+     * @param processStreamListener the process stream listener to register, cannot be
+     *        <code>null</code>.
+     * @return the filter clause to obtain the exact same process stream listener through OSGi,
+     *         never <code>null</code>.
+     */
+    private String registerProcessStreamListener(TestProcessStreamListener processStreamListener, String... properties) {
+        assertEquals("Number of properties not a multiple of two!", 0, properties.length % 2);
+
+        String className = ProcessStreamListener.class.getName();
+        String extraFilter = "";
+
+        Properties props = new Properties();
+        for (int i = 0; i < properties.length; i += 2) {
+            String key = properties[i];
+            String value = properties[i + 1];
+
+            extraFilter = String.format("%s(%s=%s)", extraFilter, key, value);
+            props.setProperty(key, value);
+        }
+        
+        m_context.registerService(className, processStreamListener, props);
+
+        if (extraFilter.trim().isEmpty()) {
+            return String.format("(%s=%s)", Constants.OBJECTCLASS, className);
+        }
+        return String.format("(&(%s=%s)%s)", Constants.OBJECTCLASS, className, extraFilter);
+    }
+
+    /**
+     * Lazily initializes the configuration admin service and returns it.
+     * 
+     * @return the {@link ConfigurationAdmin} instance, never <code>null</code>.
+     * @throws AssertionFailedError in case the {@link ConfigurationAdmin} service couldn't be
+     *         obtained.
+     */
+    private ConfigurationAdmin getConfigAdmin() {
+        ServiceTracker serviceTracker = new ServiceTracker(m_context, ConfigurationAdmin.class.getName(), null);
+
+        ConfigurationAdmin instance = null;
+
+        serviceTracker.open();
+        try {
+            instance = (ConfigurationAdmin) serviceTracker.waitForService(2 * 1000);
+
+            if (instance == null) {
+                fail("ConfigurationAdmin service not found!");
+            }
+            else {
+                return instance;
+            }
+        }
+        catch (InterruptedException e) {
+            // Make sure the thread administration remains correct!
+            Thread.currentThread().interrupt();
+
+            e.printStackTrace();
+            fail("ConfigurationAdmin service not available: " + e.toString());
+        }
+
+        return instance;
+    }
+
+    @Override
+    protected Component[] getDependencies() {
+        return new Component[] {
+            createComponent()
+                .setImplementation(this)
+                .add(createServiceDependency().setService(ProcessLauncherService.class).setRequired(true))
+        };
+    }
+
+    /**
+     * Creates a factory configuration with the given properties, just like {@link #configure}.
+     * 
+     * @param factoryPid the PID of the factory that should be used to create a configuration;
+     * @param properties the new configuration properties to configure, can be <code>null</code>.
+     * @return The PID of newly created configuration.
+     * @throws IOException when the configuration couldn't be set/updated.
+     * @throws AssertionFailedError in case the {@link ConfigurationAdmin} service couldn't be
+     *         obtained.
+     */
+    private String configureFactory(String factoryPid, Properties properties) throws IOException {
+        assertNotNull("Parameter factoryPid cannot be null!", factoryPid);
+
+        org.osgi.service.cm.Configuration config = getConfigAdmin().createFactoryConfiguration(factoryPid, null);
+        config.update(properties);
+
+        // Delay a bit to allow configuration to be propagated...
+        sleep(500);
+
+        return config.getPid();
+    }
+
+    /**
+     * {@link ProcessStreamListener} implementation for the test cases in this test.
+     */
+    static class TestProcessStreamListener implements ProcessStreamListener {
+
+        private volatile int m_setStdinCallCount = 0;
+        private volatile int m_setStdoutCallCount = 0;
+
+        /**
+         * {@inheritDoc}
+         */
+        public void setStdin(LaunchConfiguration launchConfiguration, OutputStream outputStream) {
+            m_setStdinCallCount++;
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public void setStdout(LaunchConfiguration launchConfiguration, InputStream inputStream) {
+            m_setStdoutCallCount++;
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public boolean wantsStdin() {
+            return true;
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public boolean wantsStdout() {
+            return true;
+        }
+    }
+}

Propchange: ace/trunk/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/ProcessLauncherServiceIntegrationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: ace/trunk/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/TestUtil.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/TestUtil.java?rev=1726222&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/TestUtil.java (added)
+++ ace/trunk/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/TestUtil.java Fri Jan 22 14:44:51 2016
@@ -0,0 +1,125 @@
+/*
+ * 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.processlauncher.itest;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+/**
+ * Provides some convenience methods commonly used in the unit tests of ace-launcher.
+ */
+public final class TestUtil {
+
+    /**
+     * Creates a new {@link TestUtil} instance, not used.
+     */
+    private TestUtil() {
+        // No-op
+    }
+
+    /**
+     * Returns the name of the running operating system.
+     * 
+     * @return the OS-name, in lower case.
+     */
+    public static String getOSName() {
+        return System.getProperty("os.name", "").toLowerCase();
+    }
+
+    /**
+     * Obtains the file denoted by the given path as resource, and treats it as properties file.
+     * 
+     * @param path the path to the resource to load, cannot be <code>null</code>.
+     * @return a properties file, never <code>null</code>.
+     * @throws IOException in case of I/O problems reading the properties file;
+     * @throws RuntimeException in case the given path is not a valid resource file.
+     */
+    public static Properties getProperties(String path) throws IOException {
+        InputStream is = TestUtil.class.getResourceAsStream(path);
+        if (is == null) {
+            throw new RuntimeException("File not found: " + path);
+        }
+        try {
+            Properties props = new Properties();
+            props.load(is);
+            return props;
+        }
+        finally {
+            is.close();
+        }
+    }
+
+    /**
+     * Sleeps for a given amount of milliseconds.
+     * 
+     * @param delayInMillis the delay to sleep, in milliseconds.
+     */
+    public static void sleep(int delayInMillis) {
+        try {
+            Thread.sleep(delayInMillis);
+        }
+        catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+        }
+    }
+
+    /**
+     * Reads an entire file denoted by the given argument and returns its content as string.
+     * 
+     * @param file the file to read, cannot be <code>null</code>.
+     * @return the file contents, never <code>null</code>.
+     * @throws IOException in case of I/O problems reading the file.
+     */
+    public static String slurpFile(File file) throws IOException {
+        StringBuilder sb = new StringBuilder();
+        FileReader fr = new FileReader(file);
+        int ch;
+        try {
+            while ((ch = fr.read()) >= 0) {
+                sb.append((char) ch);
+            }
+        }
+        finally {
+            fr.close();
+        }
+        return sb.toString();
+    }
+    
+    /**
+     * Creates a unique temporary directory.
+     * 
+     * @return the unique temporary directory
+     */
+    public static File createTempDir() throws IOException {
+
+        File baseDir = new File(System.getProperty("java.io.tmpdir"));
+        String baseName = System.currentTimeMillis() + "-";
+
+        for (int counter = 0; counter < 1000; counter++) {
+            File tempDir = new File(baseDir, baseName + counter);
+            if (tempDir.mkdir()) {
+                return tempDir;
+            }
+        }
+        throw new IOException("Failed to create tmp directory");
+    }
+}

Propchange: ace/trunk/org.apache.ace.processlauncher.itest/src/org/apache/ace/processlauncher/itest/TestUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ace/trunk/org.apache.ace.processlauncher/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.processlauncher/bnd.bnd?rev=1726222&r1=1726221&r2=1726222&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.processlauncher/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.processlauncher/bnd.bnd Fri Jan 22 14:44:51 2016
@@ -1,25 +1,17 @@
--buildpath: ${^-buildpath},\
+-buildpath: \
+	${^-buildpath},\
 	org.apache.felix.dependencymanager,\
 	org.mockito.mockito-all,\
 	osgi.core,\
 	osgi.cmpn,\
-	junit;version=4.8.2,\
-	javax.inject;version=1.0.0,\
-	org.ops4j.pax.exam;version=2.3.0,\
-	pax-exam-container-native;version=2.3.0,\
-	org.ops4j.pax.exam.inject;version=2.3.0,\
-	pax-exam-junit4;version=2.3.0,\
-	pax-exam-link-mvn;version=2.3.0,\
-	org.ops4j.pax.url.mvn;version=1.3.5,\
-	org.ops4j.pax.url.assembly;version=1.3.5,\
-	org.ops4j.pax.url.link;version=1.3.5,\
-	org.ops4j.pax.url.wrap;version=1.3.5,\
-	slf4j.simple,\
 	org.apache.ace.test;version=latest
-Private-Package: org.apache.ace.processlauncher.osgi,\
+Private-Package: \
+	org.apache.ace.processlauncher.osgi,\
 	org.apache.ace.processlauncher.impl
-Bundle-Activator: org.apache.ace.processlauncher.osgi.Activator
-Export-Package: org.apache.ace.processlauncher,\
+Bundle-Activator: \
+	org.apache.ace.processlauncher.osgi.Activator
+Export-Package: \
+	org.apache.ace.processlauncher,\
 	org.apache.ace.processlauncher.util
 Bundle-Version: 1.0.1
 Bundle-Name: Apache ACE ProcessLauncher

Modified: ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/LaunchConfigurationFactoryTest.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/LaunchConfigurationFactoryTest.java?rev=1726222&r1=1726221&r2=1726222&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/LaunchConfigurationFactoryTest.java (original)
+++ ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/LaunchConfigurationFactoryTest.java Fri Jan 22 14:44:51 2016
@@ -18,23 +18,29 @@
  */
 package org.apache.ace.processlauncher.test.impl;
 
-import java.util.Properties;
+import static org.apache.ace.test.utils.TestUtils.UNIT;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.fail;
 
-import junit.framework.TestCase;
+import java.util.Properties;
 
 import org.apache.ace.processlauncher.LaunchConfiguration;
 import org.apache.ace.processlauncher.impl.LaunchConfigurationFactory;
 import org.osgi.service.cm.ConfigurationException;
+import org.testng.annotations.Test;
 
 /**
  * Test cases for {@link LaunchConfigurationFactory}.
  */
-public final class LaunchConfigurationFactoryTest extends TestCase {
+public final class LaunchConfigurationFactoryTest {
 
     private static void assertArrayEquals(Object[] expected, Object[] actual) {
-        assertEquals("Array length mismatch!", expected.length, actual.length);
+        assertEquals(expected.length, actual.length, "Array length mismatch!");
         for (int i = 0; i < expected.length; i++) {
-            assertEquals("Array element (" + i + ") mismatch!", expected[i], actual[i]);
+            assertEquals(expected[i], actual[i], "Array element (" + i + ") mismatch!");
         }
     }
 
@@ -43,6 +49,7 @@ public final class LaunchConfigurationFa
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testCreateLaunchConfigurationBasedOnPropertiesFileOk() throws Exception {
         Properties props = TestUtil.getProperties("launch.properties");
         assertNotNull(props);
@@ -62,6 +69,7 @@ public final class LaunchConfigurationFa
      * 
      * @throws ConfigurationException not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testCreateWithCompleteConfigOk() throws ConfigurationException {
         Properties props = new Properties();
         props.put(LaunchConfigurationFactory.INSTANCE_COUNT, "1");
@@ -85,6 +93,7 @@ public final class LaunchConfigurationFa
     /**
      * Tests that an incomplete configuration causes an exception.
      */
+    @Test(groups = { UNIT })
     public void testCreateWithEmptyExecutableNameFail() {
         Properties props = new Properties();
         props.put(LaunchConfigurationFactory.INSTANCE_COUNT, "1");
@@ -104,6 +113,7 @@ public final class LaunchConfigurationFa
     /**
      * Tests that an incomplete configuration causes an exception.
      */
+    @Test(groups = { UNIT })
     public void testCreateWithInvalidInstanceCountFail() {
         Properties props = new Properties();
         props.put(LaunchConfigurationFactory.INSTANCE_COUNT, "0");
@@ -125,6 +135,7 @@ public final class LaunchConfigurationFa
      * 
      * @throws ConfigurationException not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testCreateWithInvalidProcessStreamListenerFilterFail() throws ConfigurationException {
         Properties props = new Properties();
         props.put(LaunchConfigurationFactory.INSTANCE_COUNT, "1");
@@ -167,6 +178,7 @@ public final class LaunchConfigurationFa
     /**
      * Tests that an incomplete configuration causes an exception.
      */
+    @Test(groups = { UNIT })
     public void testCreateWithNonNumericInstanceCountFail() {
         Properties props = new Properties();
         props.put(LaunchConfigurationFactory.INSTANCE_COUNT, "foo");
@@ -188,6 +200,7 @@ public final class LaunchConfigurationFa
      * 
      * @throws ConfigurationException not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testCreateWithNullConfigFail() throws ConfigurationException {
         try {
             LaunchConfigurationFactory.create(null);
@@ -201,6 +214,7 @@ public final class LaunchConfigurationFa
     /**
      * Tests that an incomplete configuration causes an exception.
      */
+    @Test(groups = { UNIT })
     public void testCreateWithNullExecutableArgumentsFail() {
         Properties props = new Properties();
         props.put(LaunchConfigurationFactory.INSTANCE_COUNT, "1");
@@ -219,6 +233,7 @@ public final class LaunchConfigurationFa
     /**
      * Tests that an incomplete configuration causes an exception.
      */
+    @Test(groups = { UNIT })
     public void testCreateWithNullExecutableNameFail() {
         Properties props = new Properties();
         props.put(LaunchConfigurationFactory.INSTANCE_COUNT, "1");
@@ -237,6 +252,7 @@ public final class LaunchConfigurationFa
     /**
      * Tests that an incomplete configuration causes an exception.
      */
+    @Test(groups = { UNIT })
     public void testCreateWithNullInstanceCountFail() {
         Properties props = new Properties();
         props.put(LaunchConfigurationFactory.EXECUTABLE_NAME, "/path/to/foo");

Modified: ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/LaunchConfigurationTest.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/LaunchConfigurationTest.java?rev=1726222&r1=1726221&r2=1726222&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/LaunchConfigurationTest.java (original)
+++ ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/LaunchConfigurationTest.java Fri Jan 22 14:44:51 2016
@@ -18,19 +18,27 @@
  */
 package org.apache.ace.processlauncher.test.impl;
 
-import junit.framework.TestCase;
+import static org.apache.ace.test.utils.TestUtils.UNIT;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
 
 import org.apache.ace.processlauncher.LaunchConfiguration;
 import org.apache.ace.processlauncher.impl.LaunchConfigurationImpl;
+import org.testng.annotations.Test;
 
 /**
  * Test cases for {@link LaunchConfigurationImpl}.
  */
-public final class LaunchConfigurationTest extends TestCase {
+public final class LaunchConfigurationTest {
 
     /**
      * Test that creating a valid {@link LaunchConfigurationImpl} works.
      */
+    @Test(groups = { UNIT })
     public void testCreateLaunchConfigurationOk() {
         LaunchConfiguration launchConfig = new LaunchConfigurationImpl(1, "/path/to/foo", new String[0], null, false);
         assertNotNull(launchConfig);
@@ -40,6 +48,7 @@ public final class LaunchConfigurationTe
      * Test that the {@link LaunchConfigurationImpl} constructor validates the executable name
      * properly.
      */
+    @Test(groups = { UNIT })
     public void testCreateLaunchConfigurationWithEmptyExecutableNameFail() {
         try {
             new LaunchConfigurationImpl(1, "", new String[0], null, false);
@@ -54,6 +63,7 @@ public final class LaunchConfigurationTe
      * Test that the {@link LaunchConfigurationImpl} constructor validates the instance count
      * properly.
      */
+    @Test(groups = { UNIT })
     public void testCreateLaunchConfigurationWithNegativeInstanceCountFail() {
         try {
             new LaunchConfigurationImpl(-1, "/path/to/foo", new String[0], null, false);
@@ -68,6 +78,7 @@ public final class LaunchConfigurationTe
      * Test that the {@link LaunchConfigurationImpl} constructor validates the executable arguments
      * properly.
      */
+    @Test(groups = { UNIT })
     public void testCreateLaunchConfigurationWithNullExecutableArgsFail() {
         try {
             new LaunchConfigurationImpl(1, "/path/to/foo", null, null, false);
@@ -82,6 +93,7 @@ public final class LaunchConfigurationTe
      * Test that the {@link LaunchConfigurationImpl} constructor validates the executable name
      * properly.
      */
+    @Test(groups = { UNIT })
     public void testCreateLaunchConfigurationWithNullExecutableNameFail() {
         try {
             new LaunchConfigurationImpl(1, null, new String[0], null, false);
@@ -96,6 +108,7 @@ public final class LaunchConfigurationTe
      * Test that the {@link LaunchConfigurationImpl} constructor validates the instance count
      * properly.
      */
+    @Test(groups = { UNIT })
     public void testCreateLaunchConfigurationWithZeroInstanceCountFail() {
         try {
             new LaunchConfigurationImpl(0, "/path/to/foo", new String[0], null, false);
@@ -110,6 +123,7 @@ public final class LaunchConfigurationTe
      * Test that the {@link LaunchConfigurationImpl#getCommandLine()} method works properly when one
      * executable arguments are given.
      */
+    @Test(groups = { UNIT })
     public void testGetCommandLineWithOneArgumentsOk() {
         LaunchConfiguration launchConfig =
             new LaunchConfigurationImpl(1, "/path/to/foo", new String[] { "-bar" }, null, false);
@@ -126,6 +140,7 @@ public final class LaunchConfigurationTe
      * Test that the {@link LaunchConfigurationImpl#getCommandLine()} method works properly when no
      * executable arguments are given.
      */
+    @Test(groups = { UNIT })
     public void testGetCommandLineWithoutArgumentsOk() {
         LaunchConfiguration launchConfig =
             new LaunchConfigurationImpl(1, "cwd", "/path/to/foo", new String[0], 0, "(foo=bar)", "(qux=quu)", false);
@@ -144,6 +159,7 @@ public final class LaunchConfigurationTe
      * Test that the {@link LaunchConfigurationImpl#getCommandLine()} method works properly when two
      * executable arguments are given.
      */
+    @Test(groups = { UNIT })
     public void testGetCommandLineWithTwoArgumentsOk() {
         LaunchConfiguration launchConfig =
             new LaunchConfigurationImpl(1, "/path/to/foo", new String[] { "-qux", "-bar" }, null, true);

Modified: ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/ProcessLauncherServiceImplTest.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/ProcessLauncherServiceImplTest.java?rev=1726222&r1=1726221&r2=1726222&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/ProcessLauncherServiceImplTest.java (original)
+++ ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/ProcessLauncherServiceImplTest.java Fri Jan 22 14:44:51 2016
@@ -18,14 +18,17 @@
  */
 package org.apache.ace.processlauncher.test.impl;
 
+import static org.apache.ace.test.utils.TestUtils.UNIT;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
 
 import java.util.Dictionary;
 import java.util.Properties;
 
-import junit.framework.TestCase;
-
 import org.apache.ace.processlauncher.impl.LaunchConfigurationFactory;
 import org.apache.ace.processlauncher.impl.ProcessLauncherServiceImpl;
 import org.apache.ace.processlauncher.impl.ProcessManager;
@@ -33,11 +36,13 @@ import org.apache.ace.processlauncher.im
 import org.apache.ace.test.utils.TestUtils;
 import org.osgi.service.cm.ConfigurationException;
 import org.osgi.service.log.LogService;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 /**
  * Test cases for {@link ProcessLauncherServiceImpl}.
  */
-public class ProcessLauncherServiceImplTest extends TestCase {
+public class ProcessLauncherServiceImplTest {
 
     private ProcessLauncherServiceImpl m_service;
     private Dictionary<Object, Object> m_launchConfig;
@@ -48,6 +53,7 @@ public class ProcessLauncherServiceImplT
      * 
      * @throws ConfigurationException not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testAddConfigurationWorksOk() throws ConfigurationException {
         final String pid = "existing-pid";
 
@@ -62,6 +68,7 @@ public class ProcessLauncherServiceImplT
      * 
      * @throws ConfigurationException not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testDeleteExistingConfigurationOk() throws ConfigurationException {
         final String pid = "existing-pid";
 
@@ -75,6 +82,7 @@ public class ProcessLauncherServiceImplT
     /**
      * Tests that deleting a non-existing launch configuration doesn't cause an exception.
      */
+    @Test(groups = { UNIT })
     public void testDeleteNonExistingConfigurationOk() {
         m_service.deleted("non-existing-pid");
     }
@@ -82,6 +90,7 @@ public class ProcessLauncherServiceImplT
     /**
      * Tests that the getName method doesn't return <code>null</code>.
      */
+    @Test(groups = { UNIT })
     public void testGetNameOk() {
         assertNotNull(m_service.getName());
     }
@@ -91,6 +100,7 @@ public class ProcessLauncherServiceImplT
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testGetRunningProcessCountOk() throws Exception {
         final String pid = "existing-pid";
 
@@ -104,6 +114,7 @@ public class ProcessLauncherServiceImplT
      * 
      * @throws ConfigurationException not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testReplacingConfigurationWorksOk() throws ConfigurationException {
         final String pid = "existing-pid";
 
@@ -122,6 +133,7 @@ public class ProcessLauncherServiceImplT
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testShutdownRemovesAllConfigurationsOk() throws Exception {
         assertEquals(0, m_service.getLaunchConfigurationCount());
 
@@ -141,6 +153,7 @@ public class ProcessLauncherServiceImplT
      * 
      * @throws ConfigurationException not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testUpdateConfigurationWorksOk() throws ConfigurationException {
         final String pid = "existing-pid";
 
@@ -158,7 +171,7 @@ public class ProcessLauncherServiceImplT
      * 
      * @throws Exception not part of this test case.
      */
-    @Override
+    @BeforeMethod
     protected void setUp() throws Exception {
         m_service = new ProcessLauncherServiceImpl();
         m_service.setLogger(TestUtils.createNullObject(LogService.class));

Modified: ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/ProcessLauncherTest.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/ProcessLauncherTest.java?rev=1726222&r1=1726221&r2=1726222&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/ProcessLauncherTest.java (original)
+++ ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/ProcessLauncherTest.java Fri Jan 22 14:44:51 2016
@@ -20,6 +20,13 @@ package org.apache.ace.processlauncher.t
 
 import static org.apache.ace.processlauncher.test.impl.TestUtil.getOSName;
 import static org.apache.ace.processlauncher.test.impl.TestUtil.sleep;
+import static org.apache.ace.test.utils.TestUtils.UNIT;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
 
 import java.io.ByteArrayOutputStream;
 import java.io.File;
@@ -28,19 +35,18 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.Properties;
 
-import junit.framework.TestCase;
-
 import org.apache.ace.processlauncher.LaunchConfiguration;
 import org.apache.ace.processlauncher.ProcessLifecycleListener;
 import org.apache.ace.processlauncher.ProcessStreamListener;
 import org.apache.ace.processlauncher.impl.LaunchConfigurationImpl;
 import org.apache.ace.processlauncher.impl.ProcessLauncher;
 import org.apache.ace.processlauncher.util.InputStreamRedirector;
+import org.testng.annotations.Test;
 
 /**
  * Test cases for {@link ProcessLauncher}.
  */
-public class ProcessLauncherTest extends TestCase {
+public class ProcessLauncherTest {
 
     /**
      * Tests that an existing executable (Java) can be called with valid arguments and its output
@@ -48,6 +54,7 @@ public class ProcessLauncherTest extends
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testCallAlreadyRunningProcessCausesExceptionFail() throws Exception {
         String execName = determineJavaExecutable();
 
@@ -71,6 +78,7 @@ public class ProcessLauncherTest extends
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testLifecycleMethodsAreCalledOk() throws Exception {
         String execName = determineJavaExecutable();
 
@@ -95,6 +103,7 @@ public class ProcessLauncherTest extends
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testCallCleanupOnRunningProcessFails() throws Exception {
         String execName = determineJavaExecutable();
 
@@ -119,6 +128,7 @@ public class ProcessLauncherTest extends
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testCallCleanupOnTerminatedProcessOk() throws Exception {
         String execName = determineJavaExecutable();
 
@@ -139,6 +149,7 @@ public class ProcessLauncherTest extends
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testCallExistingExecutableWithoutArgumentOk() throws Exception {
         String execName = determineJavaExecutable();
 
@@ -150,7 +161,7 @@ public class ProcessLauncherTest extends
         Integer exitValue = launcher.waitForTermination();
 
         assertNotNull(exitValue);
-        assertEquals(0, exitValue.intValue());
+        assertEquals(1, exitValue.intValue());
         // Both methods should return the same exit value!
         assertEquals(exitValue, launcher.getExitValue());
 
@@ -160,7 +171,7 @@ public class ProcessLauncherTest extends
 
         // Make sure the test doesn't fail when the usage text is translated or
         // something...
-        assertTrue(stdout, stdout.contains("Usage: java"));
+        assertTrue(stdout.contains("Usage: java"), stdout);
     }
 
     /**
@@ -169,6 +180,7 @@ public class ProcessLauncherTest extends
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testCallExistingExecutableWithUnknownArgumentsOk() throws Exception {
         String execName = determineJavaExecutable();
         String execArgs = "-nonExistingArg";
@@ -190,6 +202,7 @@ public class ProcessLauncherTest extends
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testCallExistingExecutableWithValidArgumentOk() throws Exception {
         String execName = determineJavaExecutable();
         String execArgs = "-version";
@@ -210,7 +223,7 @@ public class ProcessLauncherTest extends
 
         // Make sure the test doesn't fail when the usage text is translated or
         // something...
-        assertTrue(stdout, stdout.contains("java version"));
+        assertTrue(stdout.contains("java version"), stdout);
     }
 
     /**
@@ -218,6 +231,7 @@ public class ProcessLauncherTest extends
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testCallNonExistingExecutableOk() throws Exception {
         String execName = "/path/to/java";
         String execArgs = "-version";
@@ -237,6 +251,7 @@ public class ProcessLauncherTest extends
      * Tests that attempting to create a new {@link ProcessLauncher} without a valid launch
      * configuration yields an exception.
      */
+    @Test(groups = { UNIT })
     public void testCreateProcessLauncherWithoutLaunchConfigurationFail() {
         try {
             new ProcessLauncher(null);
@@ -251,6 +266,7 @@ public class ProcessLauncherTest extends
      * Tests that attempting to obtain the exit value without a launched process yields a null
      * value.
      */
+    @Test(groups = { UNIT })
     public void testGetExitValueWithoutLaunchedProcessReturnsNull() {
         String execName = determineJavaExecutable();
         String execArgs = "-version";
@@ -266,6 +282,7 @@ public class ProcessLauncherTest extends
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testInteractWithProcessOk() throws Exception {
         // Test will not work on Windows!
         if (getOSName().contains("windows")) {
@@ -304,6 +321,7 @@ public class ProcessLauncherTest extends
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testInteractWithProcessThroughArgumentsOk() throws Exception {
         // Test will not work on Windows!
         if (getOSName().contains("windows")) {
@@ -341,6 +359,7 @@ public class ProcessLauncherTest extends
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testProcessStdinIsProperlyClosedOk() throws Exception {
         // Test will not work on Windows!
         if (getOSName().contains("windows")) {

Modified: ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/ProcessManagerImplTest.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/ProcessManagerImplTest.java?rev=1726222&r1=1726221&r2=1726222&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/ProcessManagerImplTest.java (original)
+++ ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/ProcessManagerImplTest.java Fri Jan 22 14:44:51 2016
@@ -21,22 +21,25 @@ package org.apache.ace.processlauncher.t
 import static org.apache.ace.processlauncher.test.impl.TestUtil.createTempDir;
 import static org.apache.ace.processlauncher.test.impl.TestUtil.getOSName;
 import static org.apache.ace.processlauncher.test.impl.TestUtil.sleep;
+import static org.apache.ace.test.utils.TestUtils.UNIT;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
 
 import java.io.File;
 
-import junit.framework.TestCase;
-
 import org.apache.ace.processlauncher.LaunchConfiguration;
 import org.apache.ace.processlauncher.impl.LaunchConfigurationImpl;
 import org.apache.ace.processlauncher.impl.ProcessManager;
 import org.apache.ace.processlauncher.impl.ProcessManagerImpl;
 import org.apache.ace.test.utils.TestUtils;
 import org.osgi.service.log.LogService;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
 
 /**
  * Test cases for {@link ProcessManager}.
  */
-public class ProcessManagerImplTest extends TestCase {
+public class ProcessManagerImplTest {
     
     private ProcessManagerImpl m_processManager;
 
@@ -45,6 +48,7 @@ public class ProcessManagerImplTest exte
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testLaunchProcessOnUnixDerivativeOk() throws Exception {
         // This test will not work on Windows!
         if (getOSName().contains("windows")) {
@@ -77,6 +81,7 @@ public class ProcessManagerImplTest exte
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testLaunchProcessOnWindowsOk() throws Exception {
         // This test will only work on Windows!
         if (!getOSName().contains("windows")) {
@@ -109,6 +114,7 @@ public class ProcessManagerImplTest exte
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testRespawnProcessOnUnixDerivativeOk() throws Exception {
         // This test will not work on Windows!
         if (getOSName().contains("windows")) {
@@ -146,7 +152,7 @@ public class ProcessManagerImplTest exte
         assertEquals(processCountBefore, m_processManager.getRunningProcessesCount());
 
         String testResult = TestUtil.slurpFile(tmpFile);
-        assertTrue(testResult, testResult.matches("(?s)^0\n1\n2\n$"));
+        assertTrue(testResult.matches("(?s)^0\n1\n2\n$"), testResult);
     }
 
     /**
@@ -154,6 +160,7 @@ public class ProcessManagerImplTest exte
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testShutdownOnUnixDerivativeOk() throws Exception {
         // This test will not work on Windows!
         if (getOSName().contains("windows")) {
@@ -187,6 +194,7 @@ public class ProcessManagerImplTest exte
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testShutdownOnWindowsOk() throws Exception {
         // This test will only work on Windows!
         if (!getOSName().contains("windows")) {
@@ -220,6 +228,7 @@ public class ProcessManagerImplTest exte
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testTerminateProcessOnUnixDerivativeOk() throws Exception {
         // This test will not work on Windows!
         if (getOSName().contains("windows")) {
@@ -252,6 +261,7 @@ public class ProcessManagerImplTest exte
      * 
      * @throws Exception not part of this test case.
      */
+    @Test(groups = { UNIT })
     public void testTerminateProcessOnWindowsOk() throws Exception {
         // This test will not work on Windows!
         if (!getOSName().contains("windows")) {
@@ -282,7 +292,7 @@ public class ProcessManagerImplTest exte
     /**
      * Set up for this test case.
      */
-    @Override
+    @BeforeTest
     protected void setUp() {
         m_processManager = new ProcessManagerImpl();
         TestUtils.configureObject(m_processManager, LogService.class);

Modified: ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/StringSplitterTest.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/StringSplitterTest.java?rev=1726222&r1=1726221&r2=1726222&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/StringSplitterTest.java (original)
+++ ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/impl/StringSplitterTest.java Fri Jan 22 14:44:51 2016
@@ -19,19 +19,21 @@
 package org.apache.ace.processlauncher.test.impl;
 
 import static org.apache.ace.processlauncher.impl.StringSplitter.split;
+import static org.apache.ace.test.utils.TestUtils.UNIT;
+import static org.testng.Assert.assertEquals;
 
 import org.apache.ace.processlauncher.impl.StringSplitter;
-
-import junit.framework.TestCase;
+import org.testng.annotations.Test;
 
 /**
  * Test cases for {@link StringSplitter}.
  */
-public class StringSplitterTest extends TestCase {
+public class StringSplitterTest {
 
     /**
      * Test double quoted command line argument.
      */
+    @Test(groups = { UNIT })
     public void testDoubleQuotedCommandLineArgumentOk() {
         String[] result =
             split("\\\"fwOption=org.osgi.framework.system.packages.extra=org.w3c.dom.tral,org.w3c.dom.html,org.w3c.dom.ranges,sun.reflect,org.osgi.service.deploymentadmin;version=\"1.0\",org.osgi.service.deploymentadmin.spi;version=\"1.0\",org.osgi.service.cm;version=\"1.3\",org.osgi.service.event;version=\"1.2\",org.osgi.service.log;version=\"1.3\",org.osgi.service.metatype;version=\"1.1\",org.apache.ace.log;version=\"0.8.0\"\\\"");
@@ -43,6 +45,7 @@ public class StringSplitterTest extends
     /**
      * Test double quoted string.
      */
+    @Test(groups = { UNIT })
     public void testDoubleQuotedStringOk() {
         String[] result = split("\"hello world\"");
         assertArrayEquals(new String[] { "\"hello world\"" }, result);
@@ -51,6 +54,7 @@ public class StringSplitterTest extends
     /**
      * Test double quoted string with trailing text.
      */
+    @Test(groups = { UNIT })
     public void testDoubleQuotedStringWithTrailingTextOk() {
         String[] result = split("\"hello world\" foo-bar");
         assertArrayEquals(new String[] { "\"hello world\"", "foo-bar" }, result);
@@ -59,6 +63,7 @@ public class StringSplitterTest extends
     /**
      * Test double quoted words.
      */
+    @Test(groups = { UNIT })
     public void testDoubleQuotedWordsOk() {
         String[] result = split("\"hello\" \"world\"");
         assertArrayEquals(new String[] { "\"hello\"", "\"world\"" }, result);
@@ -67,6 +72,7 @@ public class StringSplitterTest extends
     /**
      * Test double quoted words omit quotes.
      */
+    @Test(groups = { UNIT })
     public void testDoubleQuotedWordsOmitQuotesOk() {
         String[] result = split("\"hello\" \"world\"", false /* includeQuotes */);
         assertArrayEquals(new String[] { "hello", "world" }, result);
@@ -75,6 +81,7 @@ public class StringSplitterTest extends
     /**
      * Test escaped backslash in string.
      */
+    @Test(groups = { UNIT })
     public void testEscapedBackslashInStringOk() {
         String[] result = split("hello\\\\ world");
         assertArrayEquals(new String[] { "hello\\", "world" }, result);
@@ -83,6 +90,7 @@ public class StringSplitterTest extends
     /**
      * Test escaped backslash string in double quotes.
      */
+    @Test(groups = { UNIT })
     public void testEscapedBackslashStringInDoubleQuotesOk() {
         String[] result = split("\"hello\\\\ world\"");
         assertArrayEquals(new String[] { "\"hello\\ world\"" }, result);
@@ -91,6 +99,7 @@ public class StringSplitterTest extends
     /**
      * Test escaped double quoted in single quoted string.
      */
+    @Test(groups = { UNIT })
     public void testEscapedDoubleQuotedInSingleQuotedStringOk() {
         String[] result = split("'\"hello world\"'");
         assertArrayEquals(new String[] { "'\"hello world\"'" }, result);
@@ -99,6 +108,7 @@ public class StringSplitterTest extends
     /**
      * Test escaped double quoted string.
      */
+    @Test(groups = { UNIT })
     public void testEscapedDoubleQuotedStringOk() {
         String[] result = split("\\\"hello world\\\"");
         assertArrayEquals(new String[] { "\"hello", "world\"" }, result);
@@ -107,6 +117,7 @@ public class StringSplitterTest extends
     /**
      * Test escaped key value pair.
      */
+    @Test(groups = { UNIT })
     public void testEscapedKeyValuePairOk() {
         String[] result = split("key=\\'qux qoo\\'");
         assertArrayEquals(new String[] { "key='qux", "qoo'" }, result);
@@ -115,6 +126,7 @@ public class StringSplitterTest extends
     /**
      * Test escaped single quoted in double quoted string.
      */
+    @Test(groups = { UNIT })
     public void testEscapedSingleQuotedInDoubleQuotedStringOk() {
         String[] result = split("\"\\'hello world\\'\"");
         assertArrayEquals(new String[] { "\"'hello world'\"" }, result);
@@ -123,6 +135,7 @@ public class StringSplitterTest extends
     /**
      * Test escaped single quoted string.
      */
+    @Test(groups = { UNIT })
     public void testEscapedSingleQuotedStringOk() {
         String[] result = split("\\'hello world\\'");
         assertArrayEquals(new String[] { "\'hello", "world\'" }, result);
@@ -131,6 +144,7 @@ public class StringSplitterTest extends
     /**
      * Test escaped space string in double quotes.
      */
+    @Test(groups = { UNIT })
     public void testEscapedSpaceStringInDoubleQuotesOk() {
         String[] result = split("\"hello\\ world\"");
         assertArrayEquals(new String[] { "\"hello world\"" }, result);
@@ -139,6 +153,7 @@ public class StringSplitterTest extends
     /**
      * Test escaped space string.
      */
+    @Test(groups = { UNIT })
     public void testEscapedSpaceStringOk() {
         String[] result = split("hello\\ world");
         assertArrayEquals(new String[] { "hello world" }, result);
@@ -147,6 +162,7 @@ public class StringSplitterTest extends
     /**
      * Test key value pair in double quotes.
      */
+    @Test(groups = { UNIT })
     public void testKeyValuePairInDoubleQuotesOk() {
         String[] result = split("\"key=\\\"qux qoo\\\"\"");
         assertArrayEquals(new String[] { "\"key=\"qux qoo\"\"" }, result);
@@ -155,6 +171,7 @@ public class StringSplitterTest extends
     /**
      * Test key value pair.
      */
+    @Test(groups = { UNIT })
     public void testKeyValuePairOk() {
         String[] result = split("key='qux qoo'");
         assertArrayEquals(new String[] { "key='qux qoo'" }, result);
@@ -163,6 +180,7 @@ public class StringSplitterTest extends
     /**
      * Test os gi import package value.
      */
+    @Test(groups = { UNIT })
     public void testOSGiImportPackageValueOk() {
         String[] result = split("\"org.foo.bar;version=\"1\",org.qux.quu;version=\"2\"\"");
         assertArrayEquals(new String[] { "\"org.foo.bar;version=\"1\",org.qux.quu;version=\"2\"\"" }, result);
@@ -171,6 +189,7 @@ public class StringSplitterTest extends
     /**
      * Test single quoted string.
      */
+    @Test(groups = { UNIT })
     public void testSingleQuotedStringOk() {
         String[] result = split("'hello world'");
         assertArrayEquals(new String[] { "'hello world'" }, result);
@@ -179,6 +198,7 @@ public class StringSplitterTest extends
     /**
      * Test single quoted words.
      */
+    @Test(groups = { UNIT })
     public void testSingleQuotedWordsOk() {
         String[] result = split("'hello' 'world'");
         assertArrayEquals(new String[] { "'hello'", "'world'" }, result);
@@ -187,6 +207,7 @@ public class StringSplitterTest extends
     /**
      * Test single quoted words omit quotes.
      */
+    @Test(groups = { UNIT })
     public void testSingleQuotedWordsOmitQuotesOk() {
         String[] result = split("'hello' 'world'", false /* includeQuotes */);
         assertArrayEquals(new String[] { "hello", "world" }, result);
@@ -195,6 +216,7 @@ public class StringSplitterTest extends
     /**
      * Test split empty string.
      */
+    @Test(groups = { UNIT })
     public void testSplitEmptyStringOk() {
         String[] result = split("");
         assertArrayEquals(new String[0], result);
@@ -203,6 +225,7 @@ public class StringSplitterTest extends
     /**
      * Test split null value.
      */
+    @Test(groups = { UNIT })
     public void testSplitNullValueOk() {
         String[] result = split(null);
         assertArrayEquals(new String[0], result);
@@ -211,6 +234,7 @@ public class StringSplitterTest extends
     /**
      * Test split on tab.
      */
+    @Test(groups = { UNIT })
     public void testSplitOnTabOk() {
         String[] result = split("hello\tworld");
         assertArrayEquals(new String[] { "hello", "world" }, result);
@@ -219,6 +243,7 @@ public class StringSplitterTest extends
     /**
      * Test split whitespaces only.
      */
+    @Test(groups = { UNIT })
     public void testSplitWhitespacesOnlyOk() {
         String[] result = split(" \t  ");
         assertArrayEquals(new String[0], result);
@@ -227,6 +252,7 @@ public class StringSplitterTest extends
     /**
      * Test unquoted command line argument.
      */
+    @Test(groups = { UNIT })
     public void testUnquotedCommandLineArgumentOk() {
         String[] result =
             split("fwOption=org.osgi.framework.system.packages.extra=org.w3c.dom.tral,org.w3c.dom.html,org.w3c.dom.ranges,sun.reflect,org.osgi.service.deploymentadmin;version=\"1.0\",org.osgi.service.deploymentadmin.spi;version=\"1.0\",org.osgi.service.cm;version=\"1.3\",org.osgi.service.event;version=\"1.2\",org.osgi.service.log;version=\"1.3\",org.osgi.service.metatype;version=\"1.1\",org.apache.ace.log;version=\"0.8.0\"");
@@ -238,6 +264,7 @@ public class StringSplitterTest extends
     /**
      * Test unquoted string.
      */
+    @Test(groups = { UNIT })
     public void testUnquotedStringOk() {
         String[] result = split("hello world");
         assertArrayEquals(new String[] { "hello", "world" }, result);

Modified: ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/util/InputStreamRedirectorTest.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/util/InputStreamRedirectorTest.java?rev=1726222&r1=1726221&r2=1726222&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/util/InputStreamRedirectorTest.java (original)
+++ ace/trunk/org.apache.ace.processlauncher/test/org/apache/ace/processlauncher/test/util/InputStreamRedirectorTest.java Fri Jan 22 14:44:51 2016
@@ -18,14 +18,15 @@
  */
 package org.apache.ace.processlauncher.test.util;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
 import static org.apache.ace.processlauncher.test.impl.TestUtil.sleep;
+import static org.apache.ace.test.utils.TestUtils.UNIT;
 import static org.mockito.Matchers.anyInt;
 import static org.mockito.Mockito.atLeast;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -34,8 +35,8 @@ import java.io.InputStream;
 import java.io.OutputStream;
 
 import org.apache.ace.processlauncher.util.InputStreamRedirector;
-import org.junit.Test;
 import org.mockito.Mockito;
+import org.testng.annotations.Test;
 
 /**
  * Test cases for {@link InputStreamRedirector}.
@@ -47,7 +48,7 @@ public class InputStreamRedirectorTest {
      * 
      * @throws IOException not part of this test case.
      */
-    @Test
+    @Test(groups = { UNIT })
     public void testInputStreamEOFCausesOutputStreamToBeClosedOk() throws IOException {
         InputStream myIS = new ByteArrayInputStream("hello world!".getBytes());
         OutputStream mockOS = mock(OutputStream.class);
@@ -63,7 +64,7 @@ public class InputStreamRedirectorTest {
      * 
      * @throws IOException not part of this test case.
      */
-    @Test
+    @Test(groups = { UNIT })
     public void testInputStreamIsVerbatimelyCopiedToOutputStreamOk() throws IOException {
         String input = "hello world!";
 
@@ -81,7 +82,7 @@ public class InputStreamRedirectorTest {
      * 
      * @throws Exception not part of this test case.
      */
-    @Test
+    @Test(groups = { UNIT })
     public void testInterruptRedirectorOk() throws Exception {
         InputStream myIS = createBlockingInputStream();
         OutputStream myOS = mock(OutputStream.class);
@@ -108,7 +109,7 @@ public class InputStreamRedirectorTest {
      * 
      * @throws Exception not part of this test case.
      */
-    @Test
+    @Test(groups = { UNIT })
     public void testRecoverFromExceptionInInputStreamWithoutOutputStreamOk() throws Exception {
         InputStream myIS = createExceptionThrowingInputStream();
         ByteArrayOutputStream myOS = new ByteArrayOutputStream();
@@ -130,7 +131,7 @@ public class InputStreamRedirectorTest {
      * 
      * @throws Exception not part of this test case.
      */
-    @Test
+    @Test(groups = { UNIT })
     public void testRecoverFromExceptionInInputStreamWithOutputStreamOk() throws Exception {
         InputStream myIS = createExceptionThrowingInputStream();
         OutputStream myOS = mock(OutputStream.class);
@@ -148,7 +149,7 @@ public class InputStreamRedirectorTest {
      * 
      * @throws Exception not part of this test case.
      */
-    @Test
+    @Test(groups = { UNIT })
     public void testWithoutOutputStreamOk() throws Exception {
         InputStream myIS = new ByteArrayInputStream("hello world!".getBytes());
 

Modified: ace/trunk/org.apache.ace.test/src/org/apache/ace/test/utils/FileUtils.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.test/src/org/apache/ace/test/utils/FileUtils.java?rev=1726222&r1=1726221&r2=1726222&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.test/src/org/apache/ace/test/utils/FileUtils.java (original)
+++ ace/trunk/org.apache.ace.test/src/org/apache/ace/test/utils/FileUtils.java Fri Jan 22 14:44:51 2016
@@ -23,6 +23,8 @@ import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.nio.channels.FileChannel;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Manifest;
 
 public class FileUtils {
 
@@ -44,6 +46,18 @@ public class FileUtils {
         return tempFile;
     }
 
+    public static File createEmptyBundle(File baseDirectory, String bsn) throws IOException {
+        File result = createTempFile(baseDirectory, ".jar");
+
+        Manifest m = new Manifest();
+        m.getMainAttributes().putValue("Bundle-ManifestVersion", "2");
+        m.getMainAttributes().putValue("Bundle-SymbolicName", bsn);
+        
+        try (FileOutputStream fos = new FileOutputStream(result); JarOutputStream jos = new JarOutputStream(fos, m)) {
+        }
+        return result;
+    }
+
     public static void copy(File input, File output) throws IOException {
         FileInputStream fis = new FileInputStream(input);
         FileOutputStream fos = new FileOutputStream(output);

Modified: ace/trunk/org.apache.ace.verifier/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.verifier/bnd.bnd?rev=1726222&r1=1726221&r2=1726222&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.verifier/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.verifier/bnd.bnd Fri Jan 22 14:44:51 2016
@@ -3,9 +3,6 @@
 	osgi.cmpn;version=4.3.1,\
 	javax.servlet,\
 	org.apache.felix.dependencymanager,\
-	org.ops4j.pax.swissbox.tinybundles,\
-	org.ops4j.base.store,\
-	commons-logging,\
 	com.vaadin,\
 	org.apache.ace.authentication.api;version=latest,\
 	org.apache.ace.identification.api;version=latest,\

Modified: ace/trunk/org.apache.ace.verifier/test/org/apache/ace/deployment/verifier/impl/VerifierTest.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.verifier/test/org/apache/ace/deployment/verifier/impl/VerifierTest.java?rev=1726222&r1=1726221&r2=1726222&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.verifier/test/org/apache/ace/deployment/verifier/impl/VerifierTest.java (original)
+++ ace/trunk/org.apache.ace.verifier/test/org/apache/ace/deployment/verifier/impl/VerifierTest.java Fri Jan 22 14:44:51 2016
@@ -37,113 +37,113 @@ import org.osgi.service.log.LogEntry;
 import org.testng.AssertJUnit;
 import org.testng.annotations.Test;
 
-@SuppressWarnings({"deprecation"})
+@SuppressWarnings({ "deprecation" })
 public class VerifierTest {
     @Test(groups = { UNIT })
-	public void testResolve() throws BundleException {
-		VerifierService verifier = new VerifierServiceImpl();
-		VerifyEnvironment env = verifier.createEnvironment(new HashMap<String, String>() {
-			{
-				put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, VerifierService.EE_1_6);
-				put(Constants.FRAMEWORK_OS_NAME, "macosx");
-				put(Constants.FRAMEWORK_OS_VERSION, "10.5");
-			}
-		}, new VerifyReporter() {
-			
-			public void reportWire(BundleRevision importer,
-					BundleRequirement reqirement, BundleRevision exporter,
-					BundleCapability capability) {
-				System.out.println("WIRE: " + importer + " - " + reqirement + " - " + capability + " -> " + exporter);
-			}
-			
-			public void reportLog(LogEntry logEntry) {
-				System.out.println("Log(" + logEntry.getTime() + "): " + logEntry.getLevel() + " " + logEntry.getMessage());
-				if (logEntry.getException() != null) {
-					logEntry.getException().printStackTrace();
-				}
-			}
-			
-			public void reportException(Exception ex) {
-				ex.printStackTrace();
-			}
-		});
-		Set<BundleRevision> bundles = new HashSet<BundleRevision>();
-		bundles.add(env.addBundle(0, new HashMap<String, String>(){
-			{
-				put(Constants.BUNDLE_MANIFESTVERSION, "2");
-				put(Constants.BUNDLE_SYMBOLICNAME, FelixConstants.SYSTEM_BUNDLE_SYMBOLICNAME);
-				put(Constants.EXPORT_PACKAGE, VerifierService.SYSTEM_PACKAGES + "," + VerifierService.JRE_1_6_PACKAGES);
-			}
-		}));
-		bundles.add(env.addBundle(1, new HashMap<String, String>() {
-			{
-				put(Constants.BUNDLE_MANIFESTVERSION, "2");
-				put(Constants.BUNDLE_SYMBOLICNAME, "org.test.foo");
-				put(Constants.IMPORT_PACKAGE, "org.foo, org.osgi.framework");
-			}
-		}));
-		bundles.add(env.addBundle(2, new HashMap<String, String>() {
-			{
-				put(Constants.BUNDLE_MANIFESTVERSION, "2");
-				put(Constants.BUNDLE_SYMBOLICNAME, "org.test.foo2");
-				put(Constants.EXPORT_PACKAGE, "org.foo" +
-						"");
-			}
-		}));
-		AssertJUnit.assertTrue(" Unable to resolve resolvable state.", env.verifyResolve(bundles, null, null));
-	}
-	
+    public void testResolve() throws BundleException {
+        VerifierService verifier = new VerifierServiceImpl();
+        VerifyEnvironment env = verifier.createEnvironment(new HashMap<String, String>() {
+            {
+                put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, VerifierService.EE_1_6);
+                put(Constants.FRAMEWORK_OS_NAME, "macosx");
+                put(Constants.FRAMEWORK_OS_VERSION, "10.5");
+            }
+        }, new VerifyReporter() {
+
+            public void reportWire(BundleRevision importer,
+                BundleRequirement reqirement, BundleRevision exporter,
+                BundleCapability capability) {
+                System.out.println("WIRE: " + importer + " - " + reqirement + " - " + capability + " -> " + exporter);
+            }
+
+            public void reportLog(LogEntry logEntry) {
+                System.out.println("Log(" + logEntry.getTime() + "): " + logEntry.getLevel() + " " + logEntry.getMessage());
+                if (logEntry.getException() != null) {
+                    logEntry.getException().printStackTrace();
+                }
+            }
+
+            public void reportException(Exception ex) {
+                ex.printStackTrace();
+            }
+        });
+        Set<BundleRevision> bundles = new HashSet<BundleRevision>();
+        bundles.add(env.addBundle(0, new HashMap<String, String>() {
+            {
+                put(Constants.BUNDLE_MANIFESTVERSION, "2");
+                put(Constants.BUNDLE_SYMBOLICNAME, FelixConstants.SYSTEM_BUNDLE_SYMBOLICNAME);
+                put(Constants.EXPORT_PACKAGE, VerifierService.SYSTEM_PACKAGES + "," + VerifierService.JRE_1_6_PACKAGES);
+            }
+        }));
+        bundles.add(env.addBundle(1, new HashMap<String, String>() {
+            {
+                put(Constants.BUNDLE_MANIFESTVERSION, "2");
+                put(Constants.BUNDLE_SYMBOLICNAME, "org.test.foo");
+                put(Constants.IMPORT_PACKAGE, "org.foo, org.osgi.framework");
+            }
+        }));
+        bundles.add(env.addBundle(2, new HashMap<String, String>() {
+            {
+                put(Constants.BUNDLE_MANIFESTVERSION, "2");
+                put(Constants.BUNDLE_SYMBOLICNAME, "org.test.foo2");
+                put(Constants.EXPORT_PACKAGE, "org.foo" +
+                    "");
+            }
+        }));
+        AssertJUnit.assertTrue(" Unable to resolve resolvable state.", env.verifyResolve(bundles, null, null));
+    }
+
     @Test(groups = { UNIT })
-	public void testResolveFail() throws BundleException {
-		VerifierService verifier = new VerifierServiceImpl();
-		VerifyEnvironment env = verifier.createEnvironment(new HashMap<String, String>(){
-			{
-				put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, VerifierService.EE_1_6);
-				put(Constants.FRAMEWORK_OS_NAME, "macosx");
-				put(Constants.FRAMEWORK_OS_VERSION, "10.5");
-			}
-		}, new VerifyReporter() {
-			
-			public void reportWire(BundleRevision importer,
-					BundleRequirement reqirement, BundleRevision exporter,
-					BundleCapability capability) {
-				System.out.println("WIRE: " + importer + " - " + reqirement + " - " + capability + " -> " + exporter);
-			}
-			
-			public void reportLog(LogEntry logEntry) {
-				System.out.println("Log(" + logEntry.getTime() + "): " + logEntry.getLevel() + " " + logEntry.getMessage());
-				if (logEntry.getException() != null) {
-					logEntry.getException().printStackTrace();
-				}
-			}
-			
-			public void reportException(Exception ex) {
-				ex.printStackTrace();
-			}
-		});
-		Set<BundleRevision> bundles = new HashSet<BundleRevision>();
-		bundles.add(env.addBundle(0, new HashMap<String, String>(){
-			{
-				put(Constants.BUNDLE_MANIFESTVERSION, "2");
-				put(Constants.BUNDLE_SYMBOLICNAME, FelixConstants.SYSTEM_BUNDLE_SYMBOLICNAME);
-				put(Constants.EXPORT_PACKAGE, VerifierService.SYSTEM_PACKAGES + "," + VerifierService.JRE_1_6_PACKAGES);
-			}
-		}));
-		bundles.add(env.addBundle(1, new HashMap<String, String>() {
-			{
-				put(Constants.BUNDLE_MANIFESTVERSION, "2");
-				put(Constants.BUNDLE_SYMBOLICNAME, "org.test.foo");
-				put(Constants.IMPORT_PACKAGE, "org.foo");
-			}
-		}));
-		bundles.add(env.addBundle(2, new HashMap<String, String>() {
-			{
-				put(Constants.BUNDLE_MANIFESTVERSION, "2");
-				put(Constants.BUNDLE_SYMBOLICNAME, "org.test.foo2");
-				put(Constants.EXPORT_PACKAGE, "org.foo2" +
-						"");
-			}
-		}));
-		AssertJUnit.assertFalse("Resolving unresolvable", env.verifyResolve(bundles, null, null));
-	}
+    public void testResolveFail() throws BundleException {
+        VerifierService verifier = new VerifierServiceImpl();
+        VerifyEnvironment env = verifier.createEnvironment(new HashMap<String, String>() {
+            {
+                put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, VerifierService.EE_1_6);
+                put(Constants.FRAMEWORK_OS_NAME, "macosx");
+                put(Constants.FRAMEWORK_OS_VERSION, "10.5");
+            }
+        }, new VerifyReporter() {
+
+            public void reportWire(BundleRevision importer,
+                BundleRequirement reqirement, BundleRevision exporter,
+                BundleCapability capability) {
+                System.out.println("WIRE: " + importer + " - " + reqirement + " - " + capability + " -> " + exporter);
+            }
+
+            public void reportLog(LogEntry logEntry) {
+                System.out.println("Log(" + logEntry.getTime() + "): " + logEntry.getLevel() + " " + logEntry.getMessage());
+                if (logEntry.getException() != null) {
+                    logEntry.getException().printStackTrace();
+                }
+            }
+
+            public void reportException(Exception ex) {
+                ex.printStackTrace();
+            }
+        });
+        Set<BundleRevision> bundles = new HashSet<BundleRevision>();
+        bundles.add(env.addBundle(0, new HashMap<String, String>() {
+            {
+                put(Constants.BUNDLE_MANIFESTVERSION, "2");
+                put(Constants.BUNDLE_SYMBOLICNAME, FelixConstants.SYSTEM_BUNDLE_SYMBOLICNAME);
+                put(Constants.EXPORT_PACKAGE, VerifierService.SYSTEM_PACKAGES + "," + VerifierService.JRE_1_6_PACKAGES);
+            }
+        }));
+        bundles.add(env.addBundle(1, new HashMap<String, String>() {
+            {
+                put(Constants.BUNDLE_MANIFESTVERSION, "2");
+                put(Constants.BUNDLE_SYMBOLICNAME, "org.test.foo");
+                put(Constants.IMPORT_PACKAGE, "org.foo");
+            }
+        }));
+        bundles.add(env.addBundle(2, new HashMap<String, String>() {
+            {
+                put(Constants.BUNDLE_MANIFESTVERSION, "2");
+                put(Constants.BUNDLE_SYMBOLICNAME, "org.test.foo2");
+                put(Constants.EXPORT_PACKAGE, "org.foo2" +
+                    "");
+            }
+        }));
+        AssertJUnit.assertFalse("Resolving unresolvable", env.verifyResolve(bundles, null, null));
+    }
 }