@Test public void testServerHomeSet() { assertNotNull(typeId); IServerType type = ServerCore.findServerType(typeId); if (type != null) { if (type.getRuntimeType() == null) fail("Server type " + typeId + " does not have an associated runtime"); String rtType = type.getRuntimeType().getId(); if (rtType == null) { fail("Runtime type for servertype " + typeId + " has a null id."); } assertTrue(Arrays.asList(IJBossToolingConstants.ALL_JBOSS_RUNTIMES).contains(rtType)); } else { IRuntimeType t = ServerCore.findRuntimeType(typeId); assertNotNull(t); assertTrue(Arrays.asList(IJBossToolingConstants.ALL_JBOSS_RUNTIMES).contains(typeId)); } }
public static IServerWorkingCopy createServerForRuntime(IRuntime runtime) { for (IServerType serverType : ServerCore.getServerTypes()) { if (serverType.getRuntimeType().equals(runtime.getRuntimeType())) { try { return serverType.createServer("server", null, runtime, null); } catch (CoreException e) { } } } return null; }