Search in sources :

Example 21 with ServerRuntime

use of org.eclipse.jst.server.generic.servertype.definition.ServerRuntime in project webtools.servertools by eclipse.

the class GenericServerRuntimeTest method testRuntimeInfoOnly.

/**
 * runtimeTypeId used as key to .runtimedef
 */
public void testRuntimeInfoOnly() throws Exception {
    GenericServerRuntime runtime = ServerRuntimeUtils.getGenericServerRuntime(TEST_RUNTIMETYPE_ID);
    assertNotNull(runtime);
    ServerRuntime runtimeDef = runtime.getServerTypeDefinition();
    assertNotNull(runtimeDef);
    // Verify runtime info, and *no* server info
    ServerRuntimeUtils.verifyProperty(runtimeDef.getProperty(), "foo.prop.a", "a runtime property value");
    ServerRuntimeUtils.verifyNoProperty(runtimeDef.getProperty(), "foo.prop.b");
}
Also used : GenericServerRuntime(org.eclipse.jst.server.generic.core.internal.GenericServerRuntime) GenericServerRuntime(org.eclipse.jst.server.generic.core.internal.GenericServerRuntime) ServerRuntime(org.eclipse.jst.server.generic.servertype.definition.ServerRuntime)

Example 22 with ServerRuntime

use of org.eclipse.jst.server.generic.servertype.definition.ServerRuntime in project webtools.servertools by eclipse.

the class ServerTypeDefinitionManagerTest method testServerDefAndRuntimeDef.

/**
 * Use ServerTypeDefinitionManager to load a serverdef
 * and runtimedef defined in this plugin.
 */
public void testServerDefAndRuntimeDef() {
    Map properties = Collections.EMPTY_MAP;
    /**
     * Implementation of getServerRuntimeDefinition looks up serverdef extensions
     * using the given id. It checks to see if this is a serverTypeId, or a
     * runtimeTypeId.
     *
     * If it is a serverTypeId, it loads the serverdef and then proceeds to lookup
     * runtimedef using the corresponding runtimeTypeId (a server has one runtime,
     * a runtime may have many servers). It combines the serverdef and the runtimedef
     * to create the ServerRuntime object. If there is no runtimedef this is an error.
     *
     * If the id is a runtimeTypeId, then it loads the serverdef and returns the
     * ServerRuntime.
     */
    ServerRuntime definition = manager.getServerRuntimeDefinition(TEST_SERVERTYPE_ID, TEST_RUNTIMETYPE_ID, properties);
    assertNotNull(definition);
}
Also used : ServerRuntime(org.eclipse.jst.server.generic.servertype.definition.ServerRuntime) Map(java.util.Map)

Example 23 with ServerRuntime

use of org.eclipse.jst.server.generic.servertype.definition.ServerRuntime in project webtools.servertools by eclipse.

the class ServerTypeDefinitionManagerTest method testServerDefOnly.

public void testServerDefOnly() {
    Map properties = Collections.EMPTY_MAP;
    ServerRuntime definition = manager.getServerRuntimeDefinition(TEST_SERVERDEFONLY_RUNTIMETYPE_ID, properties);
    assertNotNull(definition);
    definition = manager.getServerRuntimeDefinition(TEST_SERVERDEFONLY_SERVERTYPE_ID, properties);
    assertNull(definition);
}
Also used : ServerRuntime(org.eclipse.jst.server.generic.servertype.definition.ServerRuntime) Map(java.util.Map)

Aggregations

ServerRuntime (org.eclipse.jst.server.generic.servertype.definition.ServerRuntime)23 Map (java.util.Map)8 GenericServerRuntime (org.eclipse.jst.server.generic.core.internal.GenericServerRuntime)8 GenericServer (org.eclipse.jst.server.generic.core.internal.GenericServer)4 Iterator (java.util.Iterator)3 List (java.util.List)3 IServerWorkingCopy (org.eclipse.wst.server.core.IServerWorkingCopy)3 ArrayList (java.util.ArrayList)2 IExtension (org.eclipse.core.runtime.IExtension)2 IStatus (org.eclipse.core.runtime.IStatus)2 ServerTypeDefinitionManager (org.eclipse.jst.server.generic.core.internal.ServerTypeDefinitionManager)2 Resolver (org.eclipse.jst.server.generic.internal.xml.Resolver)2 HashMap (java.util.HashMap)1 Properties (java.util.Properties)1 StringTokenizer (java.util.StringTokenizer)1 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 Status (org.eclipse.core.runtime.Status)1 URI (org.eclipse.emf.common.util.URI)1 WrappedException (org.eclipse.emf.common.util.WrappedException)1