Return-Path: X-Original-To: apmail-karaf-commits-archive@minotaur.apache.org Delivered-To: apmail-karaf-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4D3C5E094 for ; Fri, 1 Feb 2013 12:46:24 +0000 (UTC) Received: (qmail 27935 invoked by uid 500); 1 Feb 2013 12:38:39 -0000 Delivered-To: apmail-karaf-commits-archive@karaf.apache.org Received: (qmail 27838 invoked by uid 500); 1 Feb 2013 12:38:37 -0000 Mailing-List: contact commits-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list commits@karaf.apache.org Received: (qmail 27806 invoked by uid 99); 1 Feb 2013 12:38:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2013 12:38:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2013 12:38:33 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B095E2388978; Fri, 1 Feb 2013 12:38:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1441425 - /karaf/trunk/main/src/test/java/org/apache/karaf/main/MainStartTest.java Date: Fri, 01 Feb 2013 12:38:13 -0000 To: commits@karaf.apache.org From: pieber@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130201123813.B095E2388978@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: pieber Date: Fri Feb 1 12:38:13 2013 New Revision: 1441425 URL: http://svn.apache.org/viewvc?rev=1441425&view=rev Log: [KARAF-2144] Fixed MainStartTest; Thanks to Christoph Gritschenberger for the Patch Signed-off-by: Andreas Pieber Modified: karaf/trunk/main/src/test/java/org/apache/karaf/main/MainStartTest.java Modified: karaf/trunk/main/src/test/java/org/apache/karaf/main/MainStartTest.java URL: http://svn.apache.org/viewvc/karaf/trunk/main/src/test/java/org/apache/karaf/main/MainStartTest.java?rev=1441425&r1=1441424&r2=1441425&view=diff ============================================================================== --- karaf/trunk/main/src/test/java/org/apache/karaf/main/MainStartTest.java (original) +++ karaf/trunk/main/src/test/java/org/apache/karaf/main/MainStartTest.java Fri Feb 1 12:38:13 2013 @@ -25,6 +25,7 @@ import java.io.File; import junit.framework.Assert; import org.apache.karaf.main.util.Utils; +import org.junit.After; import org.junit.Test; import org.ops4j.pax.tinybundles.core.TinyBundles; import org.osgi.framework.Bundle; @@ -33,7 +34,16 @@ import org.osgi.framework.launch.Framewo public class MainStartTest { - @Test + private Main main; + + @After + public void tearDown() throws Exception { + if(main != null){ + main.destroy(); + } + } + + @Test public void testAutoStart() throws Exception { File basedir = new File(getClass().getClassLoader().getResource("foo").getPath()).getParentFile(); File home = new File(basedir, "test-karaf-home"); @@ -45,7 +55,7 @@ public class MainStartTest { System.setProperty("karaf.home", home.toString()); System.setProperty("karaf.data", data.toString()); - Main main = new Main(args); + main = new Main(args); main.launch(); Framework framework = main.getFramework(); Bundle[] bundles = framework.getBundleContext().getBundles(); @@ -59,8 +69,6 @@ public class MainStartTest { Bundle bundle2 = framework.getBundleContext().getBundle("pax-url-mvn.jar"); Assert.assertEquals(Bundle.ACTIVE, bundle2.getState()); - - main.destroy(); } @Test @@ -76,7 +84,7 @@ public class MainStartTest { System.setProperty("karaf.data", data.toString()); System.setProperty("karaf.framework.factory", "org.apache.felix.framework.FrameworkFactory"); - Main main = new Main(args); + main = new Main(args); main.launch(); Framework framework = main.getFramework(); String activatorName = TimeoutShutdownActivator.class.getName().replace('.', '/') + ".class";