use of com.liferay.ide.server.remote.IRemoteServerPublisher in project liferay-ide by liferay.
the class LiferayMavenProjectTests method testNewLiferayRemoteServiceBuilderProject.
@Test
public void testNewLiferayRemoteServiceBuilderProject() throws Exception {
if (shouldSkipBundleTests())
return;
NewLiferayPluginProjectOp op = NewLiferayPluginProjectOp.TYPE.instantiate();
op.setProjectName("servicebuilder");
op.setProjectProvider("maven");
op.setPluginType(PluginType.servicebuilder);
createTestBundleProfile(op);
final IProject project = base.createProject(op, op.getProjectName() + "-portlet");
assertEquals(project.getName(), op.getProjectName() + "-portlet");
assertNotNull(project);
String pomContents = CoreUtil.readStreamToString(project.getFile("pom.xml").getContents());
assertTrue(pomContents.contains("<artifactId>servicebuilder-portlet</artifactId>"));
assertTrue(pomContents.contains("<artifactId>liferay-maven-plugin</artifactId>"));
assertTrue(pomContents.contains("<name>servicebuilder Portlet</name>"));
waitForJobsToComplete();
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
waitForJobsToComplete();
IVirtualComponent projectComponent = ComponentCore.createComponent(project);
assertEquals("servicebuilder-portlet", projectComponent.getDeployedName());
final ILiferayProject liferayProject = LiferayCore.create(project);
final IRemoteServerPublisher publisher = liferayProject.adapt(IRemoteServerPublisher.class);
final IPath warPath = publisher.publishModuleFull(monitor);
assertTrue(warPath.toFile().exists());
}
use of com.liferay.ide.server.remote.IRemoteServerPublisher in project liferay-ide by liferay.
the class LiferayMavenProject method adapt.
@Override
public <T> T adapt(Class<T> adapterType) {
T adapter = super.adapt(adapterType);
if (adapter != null) {
return adapter;
}
IMavenProjectFacade facade = MavenUtil.getProjectFacade(getProject(), new NullProgressMonitor());
if (facade != null) {
if (IProjectBuilder.class.equals(adapterType)) {
IProjectBuilder projectBuilder = new MavenProjectBuilder(getProject());
return adapterType.cast(projectBuilder);
} else if (IRemoteServerPublisher.class.equals(adapterType)) {
IRemoteServerPublisher remoteServerPublisher = new MavenProjectRemoteServerPublisher(getProject());
return adapterType.cast(remoteServerPublisher);
}
}
return null;
}
use of com.liferay.ide.server.remote.IRemoteServerPublisher in project liferay-ide by liferay.
the class MavenBundlePluginProject method adapt.
@Override
public <T> T adapt(Class<T> adapterType) {
T adapter = super.adapt(adapterType);
if (adapter != null) {
return adapter;
}
IMavenProjectFacade facade = MavenUtil.getProjectFacade(getProject(), new NullProgressMonitor());
if (facade != null) {
if (IProjectBuilder.class.equals(adapterType)) {
IProjectBuilder projectBuilder = new MavenProjectBuilder(getProject());
return adapterType.cast(projectBuilder);
} else if (IRemoteServerPublisher.class.equals(adapterType)) {
IRemoteServerPublisher remoteServerPublisher = new MavenProjectRemoteServerPublisher(getProject());
return adapterType.cast(remoteServerPublisher);
} else if (IBundleProject.class.equals(adapterType)) {
return adapterType.cast(this);
}
}
return null;
}
Aggregations