use of org.eclipse.jst.server.generic.core.internal.GenericServer in project webtools.servertools by eclipse.
the class GenericServerTest method testServerAndRuntimeInfoForServerDefOnly.
public void testServerAndRuntimeInfoForServerDefOnly() throws Exception {
GenericServerRuntime runtime = ServerRuntimeUtils.getGenericServerRuntime(TEST_SERVERDEFONLY_RUNTIMETYPE_ID);
GenericServer server = ServerRuntimeUtils.getGenericServer(TEST_SERVERDEFONLY_SERVERTYPE_ID, runtime.getRuntime());
assertNotNull(server);
ServerRuntime serverRuntime = server.getServerDefinition();
// Verify Server and Runtime info
ServerRuntimeUtils.verifyProperty(serverRuntime.getProperty(), "foo.prop.a", "a runtime property value");
ServerRuntimeUtils.verifyProperty(serverRuntime.getProperty(), "foo.prop.b", "a server property value");
ServerRuntimeUtils.verifyClasspath(serverRuntime.getClasspath(), "foo.classpath");
}
use of org.eclipse.jst.server.generic.core.internal.GenericServer in project webtools.servertools by eclipse.
the class GenericServerWizardFragment method createContent.
public void createContent(Composite parent, IWizardHandle handle) {
IServerWorkingCopy server = getServer();
GenericServer dl = (GenericServer) server.loadAdapter(GenericServer.class, null);
ServerRuntime definition = getServerTypeDefinitionFor(server);
fDecorators = new GenericServerCompositeDecorator[1];
fDecorators[0] = new ServerTypeDefinitionServerDecorator(definition, null, getWizard(), dl);
new GenericServerComposite(parent, fDecorators);
}
use of org.eclipse.jst.server.generic.core.internal.GenericServer in project webtools.servertools by eclipse.
the class GenericServerWizardFragment method isComplete.
/**
*/
public boolean isComplete() {
ServerRuntime serverRuntime = getServerTypeDefinitionFor(getServer());
if (serverRuntime == null)
return false;
IServerWorkingCopy server = getServer();
GenericServer dl = (GenericServer) server.loadAdapter(GenericServer.class, null);
IStatus status = dl.validate();
return (status != null && status.isOK());
}
use of org.eclipse.jst.server.generic.core.internal.GenericServer in project webtools.servertools by eclipse.
the class GenericServerTest method testServerAndRuntimeInfoForServerDefAndRuntimeDef.
/**
* serverTypeId used as a key to the .serverdef file, then
* the runtimeTypeId used as key to .runtimedef
*
* @throws Exception
*/
public void testServerAndRuntimeInfoForServerDefAndRuntimeDef() throws Exception {
GenericServerRuntime runtime = ServerRuntimeUtils.getGenericServerRuntime(TEST_RUNTIMETYPE_ID);
GenericServer server = ServerRuntimeUtils.getGenericServer(TEST_SERVERTYPE_ID, runtime.getRuntime());
assertNotNull(server);
ServerRuntime serverRuntime = server.getServerDefinition();
// Verify Server and Runtime info: properties from runtimedef and serverdef are available
ServerRuntimeUtils.verifyProperty(serverRuntime.getProperty(), "foo.prop.a", "a runtime property value");
ServerRuntimeUtils.verifyProperty(serverRuntime.getProperty(), "foo.prop.b", "a server property value");
ServerRuntimeUtils.verifyClasspath(serverRuntime.getClasspath(), "foo.runtime.classpath");
ServerRuntimeUtils.verifyClasspath(serverRuntime.getClasspath(), "foo.server.classpath");
}
use of org.eclipse.jst.server.generic.core.internal.GenericServer in project webtools.servertools by eclipse.
the class ServerRuntimeUtils method getGenericServer.
public static GenericServer getGenericServer(String serverTypeId, IRuntime runtime) throws Exception {
GenericServer serverDelegate = null;
IServerType[] sTypes = ServerCore.getServerTypes();
for (int i = 0; i < sTypes.length; i++) {
IServerType serverType = sTypes[i];
if (serverTypeId.equals(serverType.getId())) {
IServerWorkingCopy serverWorkingCopy = serverType.createServer(serverTypeId, null, runtime, null);
assertNotNull("Could not create server", serverWorkingCopy);
serverDelegate = (GenericServer) serverWorkingCopy.loadAdapter(GenericServer.class, new NullProgressMonitor());
}
}
return serverDelegate;
}
Aggregations