-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Added integration tests for Liferay (#216)
Added modules to test portlet add-on on Liferay portlet container Closes #204 Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Mikhail Shabarov <[email protected]>
- Loading branch information
1 parent
d94861c
commit 04e8b12
Showing
63 changed files
with
4,397 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
164 changes: 164 additions & 0 deletions
164
vaadin-portlet-liferay-integration-tests/liferay-portlet-deployer/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>vaadin-portlet-liferay-integration-tests</artifactId> | ||
<groupId>com.vaadin</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>liferay-portlet-deployer</artifactId> | ||
<name>Liferay Portlet Deployer</name> | ||
<packaging>war</packaging> | ||
|
||
<properties> | ||
<skipTests>true</skipTests> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8 | ||
</project.reporting.outputEncoding> | ||
<failOnMissingWebXml>false</failOnMissingWebXml> | ||
<javax.validation.version>2.0.0.Final</javax.validation.version> | ||
<vaadin.productionMode>true</vaadin.productionMode> | ||
</properties> | ||
|
||
<repositories> | ||
<!-- The order of definitions matters. Explicitly defining central | ||
here to make sure it has the highest priority. --> | ||
<repository> | ||
<id>central</id> | ||
<url>https://repo.maven.apache.org/maven2</url> | ||
<snapshots> | ||
<enabled>false</enabled> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
|
||
<pluginRepositories> | ||
<!-- The order of definitions matters. Explicitly defining central | ||
here to make sure it has the highest priority. --> | ||
<pluginRepository> | ||
<id>central</id> | ||
<url>https://repo.maven.apache.org/maven2</url> | ||
<snapshots> | ||
<enabled>false</enabled> | ||
</snapshots> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>vaadin-portlet</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.liferay.portal</groupId> | ||
<artifactId>release.portal.api</artifactId> | ||
<version>${liferay.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<!-- Added to provide logging output as Flow uses --> | ||
<!-- the unbound SLF4J no-operation (NOP) logger implementation --> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-simple</artifactId> | ||
<version>1.7.28</version> | ||
</dependency> | ||
|
||
<!-- Portlet API --> | ||
<dependency> | ||
<groupId>javax.portlet</groupId> | ||
<artifactId>portlet-api</artifactId> | ||
<version>3.0.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<!-- Servlet API --> | ||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>javax.servlet-api</artifactId> | ||
<version>3.1.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>vaadin-portlet-liferay-it-shared</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<!-- Test dependencies --> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.12</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<finalName>${project.artifactId}</finalName> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>3.2.3</version> | ||
<configuration> | ||
<attachClasses>true</attachClasses> | ||
<failOnMissingWebXml>false</failOnMissingWebXml> | ||
<archive> | ||
<manifestEntries> | ||
<Implementation-Title>${project.name}</Implementation-Title> | ||
<Implementation-Version>${project.version}</Implementation-Version> | ||
</manifestEntries> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.cargo</groupId> | ||
<artifactId>cargo-maven3-plugin</artifactId> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>production</id> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>flow-server-production-mode</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>vaadin-maven-plugin</artifactId> | ||
<version>${vaadin.version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>build-frontend</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
160 changes: 160 additions & 0 deletions
160
...rtlet-deployer/src/main/java/com/vaadin/flow/portal/liferay/deployer/PortletDeployer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
/* | ||
* Copyright 2000-2022 Vaadin Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package com.vaadin.flow.portal.liferay.deployer; | ||
|
||
import java.util.Collection; | ||
import java.util.LinkedList; | ||
|
||
import com.vaadin.flow.portal.liferay.AbstractPortletDeployer; | ||
import com.vaadin.flow.portal.liferay.LayoutInfo; | ||
import com.vaadin.flow.portal.liferay.PortletInfo; | ||
|
||
/** | ||
* Adds Liferay layouts and test portlets for generic-tests and portlet 3.0. | ||
*/ | ||
public class PortletDeployer extends AbstractPortletDeployer { | ||
|
||
@Override | ||
protected Collection<LayoutInfo> getLayouts() { | ||
// remember to update the xml config files in | ||
// liferay-tests-generic/src/main/webapp/WEB-INF/ | ||
// when adding a new test portlet | ||
|
||
// Generic tests | ||
|
||
Collection<LayoutInfo> layouts = new LinkedList<>(); | ||
|
||
LayoutInfo basicLayout = new LayoutInfo("BasicPortlet", "/test/basic"); | ||
PortletInfo basic = new PortletInfo(); | ||
basic.setId("basic_WAR_liferaytestsgeneric"); | ||
basic.setPortletName("BasicPortlet"); | ||
basic.setPortletFriendlyUrl("/test/basic"); | ||
basicLayout.addPortlet(basic); | ||
layouts.add(basicLayout); | ||
|
||
LayoutInfo errorLayout = new LayoutInfo("ErrorHandling", "/test/errorhandling"); | ||
PortletInfo errorHandling = new PortletInfo(); | ||
errorHandling.setId("errorhandling_WAR_liferaytestsgeneric"); | ||
errorHandling.setPortletName("ErrorHandling"); | ||
errorHandling.setPortletFriendlyUrl("/test/errorhandling"); | ||
errorLayout.addPortlet(errorHandling); | ||
layouts.add(errorLayout); | ||
|
||
LayoutInfo eventLayout = new LayoutInfo("EventHandler", | ||
"/test/eventhandler"); | ||
PortletInfo eventHandler = new PortletInfo(); | ||
eventHandler.setId("eventhandler_WAR_liferaytestsgeneric"); | ||
eventHandler.setPortletName("EventHandler"); | ||
eventHandler.setPortletFriendlyUrl("/test/eventhandler"); | ||
eventLayout.addPortlet(eventHandler); | ||
layouts.add(eventLayout); | ||
|
||
LayoutInfo stateLayout = new LayoutInfo("MinimizedStateRenderer", | ||
"/test/minimized-state-render"); | ||
PortletInfo minimizedStateRenderer = new PortletInfo(); | ||
minimizedStateRenderer.setId("minimizedstaterender_WAR_liferaytestsgeneric"); | ||
minimizedStateRenderer.setPortletName("MinimizedStateRenderer"); | ||
minimizedStateRenderer.setPortletFriendlyUrl("/test/minimized-state-render"); | ||
stateLayout.addPortlet(minimizedStateRenderer); | ||
layouts.add(stateLayout); | ||
|
||
LayoutInfo renderLayout = new LayoutInfo("Renderer", | ||
"/test/renderer"); | ||
PortletInfo renderer = new PortletInfo(); | ||
renderer.setId("render_WAR_liferaytestsgeneric"); | ||
renderer.setPortletName("Renderer"); | ||
renderer.setPortletFriendlyUrl("/test/renderer"); | ||
renderLayout.addPortlet(renderer); | ||
layouts.add(renderLayout); | ||
|
||
LayoutInfo streamLayout = new LayoutInfo("StreamResource", | ||
"/test/stream-resource"); | ||
PortletInfo streamResource = new PortletInfo(); | ||
streamResource.setId("streamresource_WAR_liferaytestsgeneric"); | ||
streamResource.setPortletName("StreamResource"); | ||
streamResource.setPortletFriendlyUrl("/test/stream-resource"); | ||
streamLayout.addPortlet(streamResource); | ||
layouts.add(streamLayout); | ||
|
||
LayoutInfo uploadLayout = new LayoutInfo("Upload", "/test/upload"); | ||
PortletInfo upload = new PortletInfo(); | ||
upload.setId("upload_WAR_liferaytestsgeneric"); | ||
upload.setPortletName("Upload"); | ||
upload.setPortletFriendlyUrl("/test/upload"); | ||
uploadLayout.addPortlet(upload); | ||
layouts.add(uploadLayout); | ||
|
||
|
||
// Portlet 3.0: | ||
|
||
String ipcEventFriendlyUrl = "/test/ipcevent"; | ||
LayoutInfo eventSourceTargetLayout = new LayoutInfo("Events", | ||
ipcEventFriendlyUrl); | ||
PortletInfo eventSource = new PortletInfo(); | ||
eventSource.setId("eventsource_WAR_liferayportlet30"); | ||
eventSource.setPortletName("Event Source"); | ||
eventSource.setPortletFriendlyUrl(ipcEventFriendlyUrl); | ||
eventSourceTargetLayout.addPortlet(eventSource); | ||
|
||
PortletInfo eventTarget = new PortletInfo(); | ||
eventTarget.setId("eventtarget_WAR_liferayportlet30"); | ||
eventTarget.setPortletName("Event Target"); | ||
eventTarget.setPortletFriendlyUrl(ipcEventFriendlyUrl); | ||
eventSourceTargetLayout.addPortlet(eventTarget); | ||
|
||
PortletInfo otherEventTarget = new PortletInfo(); | ||
otherEventTarget.setId("othereventtarget_WAR_liferayportlet30"); | ||
otherEventTarget.setPortletName("Other Event Target"); | ||
otherEventTarget.setPortletFriendlyUrl(ipcEventFriendlyUrl); | ||
eventSourceTargetLayout.addPortlet(otherEventTarget); | ||
|
||
layouts.add(eventSourceTargetLayout); | ||
|
||
String ipcEventNotVaadinFriedlyUrl = "/test/ipceventnotvaadin"; | ||
LayoutInfo notVaadinEventLayout = new LayoutInfo("Not Vaadin Events", | ||
ipcEventNotVaadinFriedlyUrl); | ||
PortletInfo vaadinIpcPortlet = new PortletInfo(); | ||
vaadinIpcPortlet.setId("vaadinipcportlet_WAR_liferayportlet30"); | ||
vaadinIpcPortlet.setPortletName("Vaadin IPC Portlet"); | ||
vaadinIpcPortlet.setPortletFriendlyUrl(ipcEventNotVaadinFriedlyUrl); | ||
notVaadinEventLayout.addPortlet(vaadinIpcPortlet); | ||
|
||
PortletInfo plainIpcPortlet = new PortletInfo(); | ||
plainIpcPortlet.setId("plainipcportlet_WAR_liferayportlet30"); | ||
plainIpcPortlet.setPortletName("Event Target"); | ||
plainIpcPortlet.setPortletFriendlyUrl(ipcEventNotVaadinFriedlyUrl); | ||
notVaadinEventLayout.addPortlet(plainIpcPortlet); | ||
|
||
layouts.add(notVaadinEventLayout); | ||
|
||
LayoutInfo render30Layout = new LayoutInfo("Render 30", | ||
"/test/hubrender"); | ||
PortletInfo render30Portlet = new PortletInfo(); | ||
render30Portlet.setId("renderportlet30_WAR_liferayportlet30"); | ||
render30Portlet.setPortletName("Render 30 Portlet"); | ||
render30Portlet.setPortletFriendlyUrl("/test/hubrender"); | ||
render30Layout.addPortlet(render30Portlet); | ||
|
||
layouts.add(render30Layout); | ||
|
||
return layouts; | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
Oops, something went wrong.