use of org.eclipse.jst.server.generic.servertype.definition.ServerRuntime 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.servertype.definition.ServerRuntime in project webtools.servertools by eclipse.
the class XMLUtils method refresh.
/**
* Load all the serverdefinition and runtimedefinition extensions.
*/
private void refresh() {
serverDefinitions = new ArrayList<ServerRuntime>();
IExtension[] serverDefExtensions = ExtensionPointUtil.getGenericServerDefinitionExtensions();
for (int i = 0; serverDefExtensions != null && i < serverDefExtensions.length; i++) {
java.net.URI definitionFile = null;
IExtension extension = serverDefExtensions[i];
IConfigurationElement[] elements = ExtensionPointUtil.getConfigurationElements(extension);
for (int j = 0; j < elements.length; j++) {
IConfigurationElement element = elements[j];
definitionFile = getDefinitionFile(element);
ServerRuntime runtime = readFile(definitionFile);
if (runtime != null) {
// $NON-NLS-1$
runtime.setId(element.getAttribute("id"));
runtime.setConfigurationElementNamespace(element.getNamespaceIdentifier());
serverDefinitions.add(runtime);
}
}
}
runtimeDefinitions = new ArrayList<ServerRuntime>();
IExtension[] runtimeDefExtensions = ExtensionPointUtil.getGenericServerRuntimeDefinitionExtensions();
for (int i = 0; runtimeDefExtensions != null && i < runtimeDefExtensions.length; i++) {
java.net.URI definitionFile = null;
IExtension extension = runtimeDefExtensions[i];
IConfigurationElement[] elements = ExtensionPointUtil.getConfigurationElements(extension);
for (int j = 0; j < elements.length; j++) {
IConfigurationElement element = elements[j];
definitionFile = getDefinitionFile(element);
ServerRuntime runtime = readFile(definitionFile);
if (runtime != null) {
// $NON-NLS-1$
runtime.setId(element.getAttribute("id"));
runtime.setConfigurationElementNamespace(element.getNamespaceIdentifier());
runtimeDefinitions.add(runtime);
}
}
}
}
use of org.eclipse.jst.server.generic.servertype.definition.ServerRuntime in project webtools.servertools by eclipse.
the class AntPublisherPropertyTester method test.
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
if (receiver instanceof IServerWorkingCopy) {
IServerWorkingCopy wc = (IServerWorkingCopy) receiver;
ServerRuntime runtimeDefinition = ServerTypeDefinitionUtil.getServerTypeDefinition(wc.getRuntime());
if (runtimeDefinition != null) {
List l = runtimeDefinition.getPublisher();
Iterator r = l.iterator();
while (r.hasNext()) {
Publisher publisher = (Publisher) r.next();
if (AntPublisher.PUBLISHER_ID.equals(publisher.getId())) {
return true;
}
}
}
}
;
return false;
}
use of org.eclipse.jst.server.generic.servertype.definition.ServerRuntime 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.servertype.definition.ServerRuntime in project webtools.servertools by eclipse.
the class XMLUtilsTest method testLoadDefinitions.
public void testLoadDefinitions() {
ServerRuntime definition = xmlUtils.getServerTypeDefinition(TestConstants.TEST_SERVERDEFONLY_RUNTIMETYPE_ID);
assertNotNull(definition);
definition = xmlUtils.getServerTypeDefinition(TestConstants.TEST_SERVERDEFONLY_SERVERTYPE_ID);
assertNull(definition);
definition = xmlUtils.getRuntimeTypeDefinition(TestConstants.TEST_SERVERDEFONLY_RUNTIMETYPE_ID);
assertNull(definition);
definition = xmlUtils.getServerTypeDefinition(TestConstants.TEST_SERVERTYPE_ID);
assertNotNull(definition);
definition = xmlUtils.getRuntimeTypeDefinition(TestConstants.TEST_RUNTIMETYPE_ID);
assertNotNull(definition);
}
Aggregations