Search in sources :

Example 1 with Publisher

use of org.eclipse.jst.server.generic.servertype.definition.Publisher 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;
}
Also used : ServerRuntime(org.eclipse.jst.server.generic.servertype.definition.ServerRuntime) IServerWorkingCopy(org.eclipse.wst.server.core.IServerWorkingCopy) Iterator(java.util.Iterator) List(java.util.List) AntPublisher(org.eclipse.jst.server.generic.core.internal.publishers.AntPublisher) Publisher(org.eclipse.jst.server.generic.servertype.definition.Publisher)

Example 2 with Publisher

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

the class ServerTypeDefinitionModelTest method testPublisher.

public void testPublisher() {
    Publisher publisher = (Publisher) subject.getPublisher().get(0);
    assertNotNull(publisher);
    assertTrue(publisher.getId() != null && publisher.getId().length() > 0);
    assertTrue(publisher.getPublisherdata() != null && publisher.getPublisherdata().size() > 0);
    PublisherData data = (PublisherData) publisher.getPublisherdata().get(0);
    assertNotNull(data);
    assertTrue(data.getDataname() != null && data.getDataname().length() > 0);
    assertTrue(data.getDatavalue() != null && data.getDatavalue().length() > 0);
}
Also used : Publisher(org.eclipse.jst.server.generic.servertype.definition.Publisher) PublisherData(org.eclipse.jst.server.generic.servertype.definition.PublisherData)

Aggregations

Publisher (org.eclipse.jst.server.generic.servertype.definition.Publisher)2 Iterator (java.util.Iterator)1 List (java.util.List)1 AntPublisher (org.eclipse.jst.server.generic.core.internal.publishers.AntPublisher)1 PublisherData (org.eclipse.jst.server.generic.servertype.definition.PublisherData)1 ServerRuntime (org.eclipse.jst.server.generic.servertype.definition.ServerRuntime)1 IServerWorkingCopy (org.eclipse.wst.server.core.IServerWorkingCopy)1