diff --git a/mishell/src/test/java/org/apache/felix/mishell/FelixLauncher.java b/mishell/src/test/java/org/apache/felix/mishell/FelixLauncher.java
deleted file mode 100644
index d2a085f..0000000
--- a/mishell/src/test/java/org/apache/felix/mishell/FelixLauncher.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.apache.felix.mishell;
-/*
- *   Copyright 2005 The Apache Software Foundation
- *
- *   Licensed 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.
- *
- */
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import javax.management.MBeanServerConnection;
-
-import org.apache.felix.framework.Felix;
-import org.apache.felix.framework.util.MutablePropertyResolver;
-import org.apache.felix.framework.util.MutablePropertyResolverImpl;
-import org.osgi.framework.Constants;
-public class FelixLauncher {
-
-    private MutablePropertyResolver props;
-	private Felix framework;
-	private List bundles;
-	private List packages;
-	private File cacheDir;
-	public FelixLauncher() {
-        super();
-    	cacheDir = new File("./cache");
-    	System.out.println(cacheDir.getAbsolutePath());
-		clearCache(cacheDir);
-    	cacheDir.mkdir();
-        
-        framework = new Felix();
-		Map m=new HashMap();
-		bundles=new ArrayList();
-		packages=new ArrayList();
-
-        props = new MutablePropertyResolverImpl(m);
-        props.put("felix.cache.profiledir", cacheDir.getAbsolutePath());
-
-    }
-	public void addBundle(String url){
-		if (!bundles.contains(url))
-		bundles.add(url);
-	}
-	public void addPackage(String packageName){
-		if(!packages.contains(packageName))
-		packages.add(packageName);
-	}
-	public void start(){
-		StringBuffer autostart=new StringBuffer();
-		for (int i=0; i<bundles.size(); i++){
-			String bundle=(String)bundles.get(i);
-			autostart.append(bundle).append(" ");
-		}
-		props.put("felix.auto.start.1", autostart.toString());
-		StringBuffer spkg=new StringBuffer((String)packages.get(0));
-		packages.remove(0);
-		for (int i=0; i<packages.size(); i++){
-			String pkg=(String)packages.get(i);
-			spkg.append(", "+pkg);
-		}
-		
-		
-        props.put(Constants.FRAMEWORK_SYSTEMPACKAGES, spkg.toString());
-
-        framework.start(props,null);
-	}
-	public void blockingStart() throws Exception{
-		this.start();
-        int to=0;
-        while(framework.getStatus()!=Felix.RUNNING_STATUS) {
-            Thread.sleep(10);
-            to++;
-            if(to>100) throw new Exception("timeout");
-        }
-
-	}
-	public void shutdown(){
-		framework.shutdown();
-		clearCache(cacheDir);
-	}
-
-	private void clearCache(File cacheDir) {
-		if(!isCache(cacheDir)){
-			System.out.println("not valid cache");
-			return;
-		}
-		File[] files=cacheDir.listFiles();
-		for(int i=0; i<files.length; i++){
-			recursiveDelete(files[i]);
-		}
-	}
-	private void recursiveDelete(File file){
-	   if(file.isDirectory()){
-			File[] files=file.listFiles();
-			for(int i=0; i<files.length; i++){
-				File f=files[i];	
-				recursiveDelete(f);
-		   }
-	   }
-	   file.delete();
-	}
-	private boolean isCache(File cacheDir){
-		if(!cacheDir.exists()||!cacheDir.isDirectory()) return false;
-		else{
-			String[] names=cacheDir.list();
-			for(int i=0;i<names.length;i++){
-				String name=names[i];
-				if(!name.startsWith("bundle")) return false;
-			}
-			return true;
-		}
-	}
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) throws Exception{
-    	FelixLauncher launcher=new FelixLauncher();
-        String jmood="file:../org.apache.felix.jmood_trunk/target/org.apache.felix.jmood-0.8.0-SNAPSHOT.jar";
-        String jmxintrospector="file:../org.apache.felix.mishell/target/org.apache.felix.mishell-0.8.0-SNAPSHOT.jar";
-    	launcher.addBundle(jmood);
-    	launcher.addBundle(jmxintrospector);
-        launcher.addPackage("org.osgi.framework");
-        launcher.addPackage("org.osgi.util.tracker");
-        launcher.addPackage("org.osgi.service.log");
-        launcher.addPackage("org.osgi.service.packageadmin");
-        launcher.addPackage("org.osgi.service.startlevel");
-        launcher.addPackage("org.osgi.service.permissionadmin");
-        launcher.addPackage("org.osgi.service.useradmin");
-        launcher.addPackage("org.osgi.service.cm");
-        launcher.addPackage("javax.management");
-        launcher.addPackage("javax.management.remote");
-        launcher.addPackage("javax.management.openmbean");  
-        launcher.addPackage("javax.script");
-    	launcher.start();
-    }
-	public Felix getFramework() {
-		return framework;
-	}
-}
