/** * retrieves the version of the runtime installation * * @param installFolder the installation folder * @return the version string or null on errors */ public static String getVersion(File installFolder) { ServerBeanLoader loader = new ServerBeanLoader(installFolder); if (loader.getServerBeanType() != ServerBeanType.UNKNOWN) { return loader.getFullServerVersion(); } return null; }
/** * creates a mock server directory structure and tests if the server bean loader can handle that * folder structure * * @throws Exception */ @Test public void testFuseESB() throws Exception { IPath dest = FuseServerTestActivator.getDefault().getStateLocation().append(this.fRuntimeType); FuseESBMockRuntimeCreationUtil.create6xRuntimeMock(this.fRuntimeType, dest); ServerBeanLoader l = new ServerBeanLoader(dest.toFile()); ServerBean b = l.getServerBean(); assertTrue(b.getBeanType() == FuseBeanProvider.FUSE_6x); assertEquals(b.getFullVersion(), TYPE_TO_VERSION.get(this.fRuntimeType)); assertEquals( b.getVersion(), ServerBeanLoader.getMajorMinorVersion(TYPE_TO_VERSION.get(this.fRuntimeType))); }
@Override public RuntimeDefinition getRuntimeDefinition(File root, IProgressMonitor monitor) { if (monitor.isCanceled() || root == null) { return null; } ServerBeanLoader loader = new ServerBeanLoader(root); ServerBean serverBean = loader.getServerBean(); if (serverBean.getType().getId() != null) { File esbRoot = null; String type = serverBean.getType().getId(); if (JBossServerType.SOAP.getId().equals(type)) { esbRoot = root; } if (JBossServerType.SOAP_STD.getId().equals(type)) { esbRoot = new File(root, JBOSS_ESB_FOLDER); } return createRuntimeDefinition(esbRoot, root.getName(), monitor); } return null; }