Skip to content

Commit

Permalink
Make root-context module ready for working inside Jetty in OSGi
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Anisimov committed Jul 19, 2018
1 parent dd047e3 commit e12d376
Show file tree
Hide file tree
Showing 25 changed files with 224 additions and 662 deletions.
5 changes: 1 addition & 4 deletions flow-server/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0
Import-Package: org.atmosphere*;resolution:=optional;version='${atmosphere.runtime.version}',\
*
Export-Package: !com.vaadin.flow.dom.impl*,\
!com.vaadin.flow.internal*,\
!com.vaadin.flow.router.internal*,\
con.vaadin.flow.client,\
Export-Package: com.vaadin.flow.client,\
com.vaadin.flow*;-noimport:=true
22 changes: 13 additions & 9 deletions flow-tests/servlet-containers/felix-jetty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<artifactId>flow-test-felix-jetty-server</artifactId>
<name>Flow Felix with Jetty Test</name>
<packaging>bundle</packaging>
<packaging>pom</packaging>

<properties>
<felix.version>6.0.0</felix.version>
Expand All @@ -22,6 +22,14 @@


<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>flow-test-root-context</artifactId>
<version>${project.version}</version>
<type>jar</type>
<classifier>ui</classifier>
</dependency>

<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
Expand Down Expand Up @@ -157,12 +165,7 @@
<extensions>true</extensions>
<version>3.3.0</version>
<configuration>
<instructions>
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
<Bundle-Activator>com.vaadin.flow.osgi.Activator</Bundle-Activator>
<Export-Package>!*</Export-Package>
<Web-ContextPath>/</Web-ContextPath>
</instructions>
<skip>true</skip>
</configuration>
</plugin>

Expand Down Expand Up @@ -204,7 +207,8 @@
<includeScope>compile</includeScope>
<outputDirectory>${project.build.directory}/${felix.home}/bundle</outputDirectory>
<overWriteIfNewer>true</overWriteIfNewer>
<excludeGroupIds>com.google.code.findbugs</excludeGroupIds>
<excludeGroupIds>com.google.code.findbugs,
org.seleniumhq.selenium</excludeGroupIds>
</configuration>
</execution>
</executions>
Expand All @@ -225,7 +229,7 @@
<asyncDestroyOnShutdown>true</asyncDestroyOnShutdown>
<workingDirectory>${project.build.directory}/${felix.home}</workingDirectory>
<commandlineArgs>-Djetty.home=${basedir}/jettyhome
-Dgosh.args="--nointeractive -s -c lb"
-Dgosh.args="--nointeractive -s"
-jar bin/felix.jar</commandlineArgs>
</configuration>
</execution>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.vaadin.flow.uitest.servlet;

import javax.servlet.annotation.WebServlet;
import java.util.stream.Stream;

import javax.servlet.annotation.WebServlet;

import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.component.html.NativeButton;
Expand Down Expand Up @@ -188,4 +189,4 @@ public void beforeEnter(BeforeEnterEvent event) {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ public class ViewClassLocator {
private final LinkedHashMap<String, Class<? extends Component>> views = new LinkedHashMap<>();
private final ClassLoader classLoader;

public ViewClassLocator() {
classLoader = null;
}

public ViewClassLocator(ClassLoader classLoader) {
this.classLoader = classLoader;
URL url = classLoader.getResource(".");
if ("file".equals(url.getProtocol())) {
if (url != null && "file".equals(url.getProtocol())) {
File testFolder;
try {
testFolder = new File(url.toURI());
Expand All @@ -61,9 +65,9 @@ public ViewClassLocator(ClassLoader classLoader) {
"Unable to scan classpath to find views", exception);
}
} else {
throw new RuntimeException(
"Could not find 'com' package using a file:// URL. Got URL: "
+ url);
getLogger().warn(
"Could not find 'com' package using a file:// URL. Got URL: {}",
url);
}
}

Expand Down
5 changes: 3 additions & 2 deletions flow-tests/test-root-context/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Bundle-Name: Vaadin Flow Root Context Server Tests
Bundle-Version: ${osgi.bundle.version}
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0
Import-Package: org.atmosphere*;resolution:=optional;version='${atmosphere.runtime.version}',\
*
Import-Package: !com.vaadin.flow.dom.impl*, com.vaadin.flow.uitest.servlet*, *
Export-Package: com.vaadin.flow.uitest*;-noimport:=true
Web-ContextPath: /
Bundle-Activator: com.vaadin.flow.osgi.Activator
Loading

0 comments on commit e12d376

Please sign in to comment.