URL url = getClass().getClassLoader().getResource("org/apache/servicemix/jbi/installation/testarchive.jar"); if (url != null) { String file = url.getFile(); installComponentTask.setFile(file); installComponentTask.init(); installComponentTask.execute(); File testFile = new File(rootDir, "components" + File.separator + "ComponentTest"); assertTrue(testFile.exists()); FileUtil.deleteFile(rootDir); }
Bootstrap1.setDelegate(new Bootstrap() { public void cleanUp() throws JBIException { } public ObjectName getExtensionMBeanName() { return null; } public void init(InstallationContext installContext) throws JBIException { } public void onInstall() throws JBIException { } public void onUninstall() throws JBIException { } }); String installJarUrl = createInstallerArchive("component1").getAbsolutePath(); installComponentTask.setFile(installJarUrl); installComponentTask.init(); installComponentTask.execute(); File testFile = new File(rootDir, "components" + File.separator + "component1"); assertTrue(testFile.exists()); FileUtil.deleteFile(rootDir);
    public void testInstallation() throws Exception {        URL url = getClass().getClassLoader().getResource("org/apache/servicemix/jbi/installation/testarchive.jar");        if (url != null) {            String file = url.getFile();            installComponentTask.setFile(file);            installComponentTask.init();            installComponentTask.execute();            File testFile = new File(rootDir, "components" + File.separator                    + "ComponentTest");            assertTrue(testFile.exists());            FileUtil.deleteFile(rootDir);        }    }