Search in sources :

Example 1 with ServerTypeDefinitionManager

use of org.eclipse.jst.server.generic.core.internal.ServerTypeDefinitionManager in project webtools.servertools by eclipse.

the class ServerDefinitionTypeTest method testResolve.

public void testResolve() {
    ServerTypeDefinitionManager serverTypeDefinitionManager = CorePlugin.getDefault().getServerTypeDefinitionManager();
    assertNotNull(serverTypeDefinitionManager);
    ServerRuntime[] types = serverTypeDefinitionManager.getServerTypeDefinitions();
    assertNotNull(types);
    assertTrue(types.length > 0);
    for (int i = 0; i < types.length; i++) {
        ServerRuntime definition = types[i];
        String wd = definition.getStart().getWorkingDirectory();
        String resolved = definition.getResolver().resolveProperties(wd);
        assertFalse(resolved.indexOf("${") >= 0);
    }
}
Also used : ServerTypeDefinitionManager(org.eclipse.jst.server.generic.core.internal.ServerTypeDefinitionManager) ServerRuntime(org.eclipse.jst.server.generic.servertype.definition.ServerRuntime)

Example 2 with ServerTypeDefinitionManager

use of org.eclipse.jst.server.generic.core.internal.ServerTypeDefinitionManager in project webtools.servertools by eclipse.

the class ServerDefinitionTypeTest method testGetTypes.

public void testGetTypes() {
    IExtension[] extensions = ExtensionPointUtil.getGenericServerDefinitionExtensions();
    int noOfExtensions = 0;
    for (int i = 0; i < extensions.length; i++) {
        noOfExtensions += ExtensionPointUtil.getConfigurationElements(extensions[i]).length;
    }
    ServerTypeDefinitionManager serverTypeDefinitionManager = CorePlugin.getDefault().getServerTypeDefinitionManager();
    assertNotNull(serverTypeDefinitionManager);
    ServerRuntime[] types = serverTypeDefinitionManager.getServerTypeDefinitions();
    assertNotNull(types);
    assertEquals(noOfExtensions, types.length);
}
Also used : ServerTypeDefinitionManager(org.eclipse.jst.server.generic.core.internal.ServerTypeDefinitionManager) IExtension(org.eclipse.core.runtime.IExtension) ServerRuntime(org.eclipse.jst.server.generic.servertype.definition.ServerRuntime)

Aggregations

ServerTypeDefinitionManager (org.eclipse.jst.server.generic.core.internal.ServerTypeDefinitionManager)2 ServerRuntime (org.eclipse.jst.server.generic.servertype.definition.ServerRuntime)2 IExtension (org.eclipse.core.runtime.IExtension)1