use of org.eclipse.wst.server.core.IServerAttributes in project liferay-ide by liferay.
the class ServerPropertyTester method test.
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
if (receiver instanceof IServerAttributes) {
IServerAttributes server = (IServerAttributes) receiver;
IServerType serverType = server.getServerType();
if (serverType != null) {
String id = serverType.getId();
if (// $NON-NLS-1$
"com.liferay.ide.eclipse.server.remote".equals(id)) {
return true;
}
}
}
return false;
}
use of org.eclipse.wst.server.core.IServerAttributes in project jbosstools-openshift by jbosstools.
the class OpenShiftServerUtilsTest method testGetSourceFromServer.
@Test
public void testGetSourceFromServer() {
// Only tests resolution from server
IServerAttributes server = mock(IServerAttributes.class);
when(server.getAttribute(OpenShiftServerUtils.ATTR_SOURCE_PATH, (String) null)).thenReturn("test1");
assertEquals("test1", OpenShiftServerUtils.getSourcePath(server));
}
use of org.eclipse.wst.server.core.IServerAttributes in project jbosstools-openshift by jbosstools.
the class OpenShiftServerUtilsTest method testGetPodPathFromServer.
@Test
public void testGetPodPathFromServer() {
// Only tests resolution from server
IServerAttributes server = mock(IServerAttributes.class);
when(server.getAttribute(OpenShiftServerUtils.ATTR_POD_PATH, (String) null)).thenReturn("test1");
assertEquals("test1", OpenShiftServerUtils.getPodPath(server));
}
use of org.eclipse.wst.server.core.IServerAttributes in project jbosstools-openshift by jbosstools.
the class OpenShiftServerUtilsTest method testGetRouteURLFromServer.
@Test
public void testGetRouteURLFromServer() {
// Only tests resolution from server
IServerAttributes server = mock(IServerAttributes.class);
when(server.getAttribute(OpenShiftServerUtils.ATTR_ROUTE, (String) null)).thenReturn("test1");
assertEquals("test1", OpenShiftServerUtils.getRouteURL(server));
}
use of org.eclipse.wst.server.core.IServerAttributes in project webtools.servertools by eclipse.
the class ConfigurationPropertyTester method test.
/* (non-Javadoc)
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
*/
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
try {
IServerAttributes server = (IServerAttributes) receiver;
TomcatServer tomcatServer = (TomcatServer) server.loadAdapter(ITomcatServer.class, null);
if (tomcatServer != null)
return tomcatServer.getServerConfiguration() != null;
} catch (Exception e) {
// ignore
}
return false;
}
Aggregations