Change-Id: Ic86a95ce44cc37c8d34d607b39f2aec4cc922ce2tags/7.7.0.alpha1
@@ -5,8 +5,8 @@ | |||
<classpathentry kind="src" path="shared/src/test/java"/> | |||
<classpathentry kind="src" path="client/src/main/java"/> | |||
<classpathentry kind="src" path="server/src/main/java"/> | |||
<classpathentry kind="src" path="client-compiler/src"/> | |||
<classpathentry kind="src" path="client-compiler/tests/src"/> | |||
<classpathentry kind="src" path="client-compiler/src/main/java"/> | |||
<classpathentry kind="src" path="client-compiler/src/test/java"/> | |||
<classpathentry kind="src" path="uitest/src"/> | |||
<classpathentry kind="src" path="shared/src/main/java"/> | |||
<classpathentry kind="src" path="shared/src/main/java-templates"/> |
@@ -88,6 +88,10 @@ push/target/ | |||
shared/target/ | |||
server/target/ | |||
client/target/ | |||
client-compiler/target/ | |||
.sass-cache | |||
phantomjsdriver.log | |||
*.iml | |||
.idea |
@@ -26,7 +26,7 @@ | |||
<dependency org="com.vaadin" name="vaadin-client" | |||
rev="${vaadin.version}" conf="compile-module-> default" /> | |||
<dependency org="com.vaadin" name="vaadin-client-compiler" | |||
rev="${vaadin.version}" conf="compile-module-> build" /> | |||
rev="${vaadin.version}" conf="compile-module-> default" /> | |||
</dependencies> | |||
</ivy-module> |
@@ -0,0 +1,327 @@ | |||
<?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"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<parent> | |||
<groupId>com.vaadin</groupId> | |||
<artifactId>vaadin-root</artifactId> | |||
<version>7.7.0-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>vaadin-client-compiler</artifactId> | |||
<name>vaadin-client-compiler</name> | |||
<packaging>jar</packaging> | |||
<organization> | |||
<name>Vaadin Ltd</name> | |||
</organization> | |||
<url>https://vaadin.com/</url> | |||
<description>Vaadin client compiler</description> | |||
<dependencies> | |||
<dependency> | |||
<groupId>com.vaadin</groupId> | |||
<artifactId>vaadin-shared</artifactId> | |||
<version>${project.version}</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.vaadin</groupId> | |||
<artifactId>vaadin-server</artifactId> | |||
<version>${project.version}</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.vaadin</groupId> | |||
<artifactId>vaadin-client</artifactId> | |||
<version>${project.version}</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.vaadin</groupId> | |||
<artifactId>vaadin-sass-compiler</artifactId> | |||
<version>${vaadin.sass.version}</version> | |||
<!-- remove cssparser override once sass-compiler is updated --> | |||
<exclusions> | |||
<exclusion> | |||
<groupId>net.sourceforge.cssparser</groupId> | |||
<artifactId>cssparser</artifactId> | |||
</exclusion> | |||
</exclusions> | |||
</dependency> | |||
<dependency> | |||
<groupId>commons-collections</groupId> | |||
<artifactId>commons-collections</artifactId> | |||
<version>3.1</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>commons-logging</groupId> | |||
<artifactId>commons-logging</artifactId> | |||
<version>1.1.3</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>net.sourceforge.cssparser</groupId> | |||
<artifactId>cssparser</artifactId> | |||
<version>0.9.11</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>ant</groupId> | |||
<artifactId>ant</artifactId> | |||
<version>1.6.5</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>ant</groupId> | |||
<artifactId>ant-launcher</artifactId> | |||
<version>1.6.5</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.ow2.asm</groupId> | |||
<artifactId>asm</artifactId> | |||
<version>5.0.3</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.ow2.asm</groupId> | |||
<artifactId>asm-util</artifactId> | |||
<version>5.0.3</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.ow2.asm</groupId> | |||
<artifactId>asm-commons</artifactId> | |||
<version>5.0.3</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.eclipse.jetty</groupId> | |||
<artifactId>jetty-annotations</artifactId> | |||
<version>8.1.12.v20130726</version> | |||
<exclusions> | |||
<exclusion> | |||
<groupId>org.eclipse.jetty</groupId> | |||
<artifactId>orbit</artifactId> | |||
</exclusion> | |||
</exclusions> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.eclipse.jetty</groupId> | |||
<artifactId>jetty-servlets</artifactId> | |||
<version>8.1.12.v20130726</version> | |||
<exclusions> | |||
<exclusion> | |||
<groupId>org.eclipse.jetty</groupId> | |||
<artifactId>orbit</artifactId> | |||
</exclusion> | |||
</exclusions> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.eclipse.jetty</groupId> | |||
<artifactId>jetty-util</artifactId> | |||
<version>8.1.12.v20130726</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.jdesktop</groupId> | |||
<artifactId>swing-worker</artifactId> | |||
<version>1.1</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>commons-codec</groupId> | |||
<artifactId>commons-codec</artifactId> | |||
<version>1.8</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>commons-io</groupId> | |||
<artifactId>commons-io</artifactId> | |||
<version>${commons-io.version}</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.commons</groupId> | |||
<artifactId>commons-lang3</artifactId> | |||
<version>3.1</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.james</groupId> | |||
<artifactId>apache-mime4j</artifactId> | |||
<version>0.6</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.httpcomponents</groupId> | |||
<artifactId>httpclient</artifactId> | |||
<version>4.3.1</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.httpcomponents</groupId> | |||
<artifactId>httpcore</artifactId> | |||
<version>4.3</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.httpcomponents</groupId> | |||
<artifactId>httpmime</artifactId> | |||
<version>4.3.1</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>net.sourceforge.nekohtml</groupId> | |||
<artifactId>nekohtml</artifactId> | |||
<version>1.9.19</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>xalan</groupId> | |||
<artifactId>serializer</artifactId> | |||
<version>2.7.1</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>xerces</groupId> | |||
<artifactId>xercesImpl</artifactId> | |||
<version>2.11.0</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>xml-apis</groupId> | |||
<artifactId>xml-apis</artifactId> | |||
<version>1.4.01</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.ibm.icu</groupId> | |||
<artifactId>icu4j</artifactId> | |||
<version>50.1.1</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.vaadin</groupId> | |||
<artifactId>vaadin-client-compiler-deps</artifactId> | |||
<version>1.2.0</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.vaadin.external.gwt</groupId> | |||
<artifactId>gwt-dev</artifactId> | |||
<version>${vaadin.gwt.version}</version> | |||
<scope>provided</scope> | |||
</dependency> | |||
<dependency> | |||
<groupId>junit</groupId> | |||
<artifactId>junit</artifactId> | |||
<version>${junit.version}</version> | |||
<scope>test</scope> | |||
</dependency> | |||
</dependencies> | |||
<build> | |||
<resources> | |||
<resource> | |||
<directory>src/main/resources</directory> | |||
<filtering>true</filtering> | |||
</resource> | |||
</resources> | |||
<plugins> | |||
<plugin> | |||
<groupId>org.apache.maven.plugins</groupId> | |||
<artifactId>maven-dependency-plugin</artifactId> | |||
<version>2.10</version> | |||
<executions> | |||
<execution> | |||
<id>unpack-dependencies</id> | |||
<phase>process-classes</phase> | |||
<goals> | |||
<goal>unpack</goal> | |||
</goals> | |||
<configuration> | |||
<artifactItems> | |||
<artifactItem> | |||
<groupId>com.vaadin.external.gwt</groupId> | |||
<artifactId>gwt-dev</artifactId> | |||
<includes> | |||
about_files/**, | |||
com/google/gwt/core/**, | |||
com/google/gwt/dev/**, | |||
com/google/gwt/lang/**, | |||
com/google/gwt/soyc/**, | |||
com/google/gwt/thirdparty/json/**, | |||
com/google/gwt/util/**, | |||
license/LICENSE.sax.txt, | |||
netscape/**, | |||
org/apache/COPYING, | |||
org/apache/jasper/**, | |||
org/apache/commons/el/**, | |||
org/apache/commons/lang3/**, | |||
templates/*, | |||
about.html, | |||
jetty-dir.css, | |||
plugin.properties | |||
</includes> | |||
<excludes> | |||
com/google/gwt/dev/protobuf/**, | |||
com/google/gwt/dev/About.properties | |||
</excludes> | |||
</artifactItem> | |||
</artifactItems> | |||
<outputDirectory>${project.build.directory}/classes</outputDirectory> | |||
<overWriteReleases>false</overWriteReleases> | |||
<overWriteSnapshots>true</overWriteSnapshots> | |||
</configuration> | |||
</execution> | |||
</executions> | |||
</plugin> | |||
<plugin> | |||
<artifactId>maven-resources-plugin</artifactId> | |||
<executions> | |||
<!-- Copy .java files to package --> | |||
<execution> | |||
<id>copy-sources</id> | |||
<!-- here the phase you need --> | |||
<phase>prepare-package</phase> | |||
<goals> | |||
<goal>copy-resources</goal> | |||
</goals> | |||
<configuration> | |||
<outputDirectory>${project.build.directory}/classes</outputDirectory> | |||
<resources> | |||
<resource> | |||
<directory>src/main/java</directory> | |||
<filtering>false</filtering> | |||
</resource> | |||
</resources> | |||
</configuration> | |||
</execution> | |||
</executions> | |||
</plugin> | |||
<plugin> | |||
<groupId>org.apache.felix</groupId> | |||
<artifactId>maven-bundle-plugin</artifactId> | |||
<extensions>true</extensions> | |||
<configuration> | |||
<instructions> | |||
<Bundle-RequiredExecutionEnvironment>JavaSE-1.6</Bundle-RequiredExecutionEnvironment> | |||
<Export-Package>com.vaadin.*;version="${project.version}",com.google.gwt.*;version="${project.version}"</Export-Package> | |||
<!--TODO decide gwt packages version number<Export-Package>com.vaadin.*;version="${project.version}",com.google.gwt.*;version="${vaadin.gwt.version}"</Export-Package> --> | |||
<Import-Package></Import-Package> <!--todo find out what should be in Import-Package --> | |||
</instructions> | |||
</configuration> | |||
<executions> | |||
<execution> | |||
<id>bundle-manifest</id> | |||
<phase>prepare-package</phase> | |||
<goals> | |||
<goal>manifest</goal> | |||
</goals> | |||
</execution> | |||
</executions> | |||
</plugin> | |||
<plugin> | |||
<groupId>org.apache.maven.plugins</groupId> | |||
<artifactId>maven-jar-plugin</artifactId> | |||
<version>2.6</version> | |||
<configuration> | |||
<archive> | |||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> | |||
<index /> | |||
<manifest> | |||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries> | |||
</manifest> | |||
</archive> | |||
</configuration> | |||
</plugin> | |||
<plugin> | |||
<groupId>org.apache.maven.plugins</groupId> | |||
<artifactId>maven-surefire-plugin</artifactId> | |||
<version>2.19.1</version> | |||
</plugin> | |||
</plugins> | |||
</build> | |||
<!--todo .javadoc.jar file --> | |||
<!--todo .sources.java --> | |||
</project> |
@@ -0,0 +1,2 @@ | |||
gwt.version=${project.version} | |||
gwt.svnrev= |
@@ -33,6 +33,8 @@ import static com.vaadin.tools.CvalCheckerTest.saveCache; | |||
import static com.vaadin.tools.CvalCheckerTest.unreachableLicenseProvider; | |||
import static com.vaadin.tools.CvalCheckerTest.validLicenseProvider; | |||
import java.net.URL; | |||
import java.net.URLClassLoader; | |||
import java.util.List; | |||
import org.junit.Assert; | |||
@@ -58,6 +60,10 @@ public class CvalAddonsCheckerTest { | |||
deleteCache(productNameCval); | |||
System.getProperties().remove(licenseName); | |||
// Set up a new URLClassLoader for the thread | |||
Thread thread = Thread.currentThread(); | |||
thread.setContextClassLoader(new URLClassLoader(new URL[0], null)); | |||
} | |||
@Test | |||
@@ -83,7 +89,7 @@ public class CvalAddonsCheckerTest { | |||
// We have a license that has never been validated from the server and | |||
// we are offline | |||
// -> Show a message on compile time (“Your license for TouchKit 4 has | |||
// not been validated.”) | |||
// not been validated.") | |||
System.setProperty(licenseName, VALID_KEY); | |||
addonChecker.setLicenseProvider(unreachableLicenseProvider); | |||
captureSystemOut(); | |||
@@ -153,7 +159,7 @@ public class CvalAddonsCheckerTest { | |||
// -> Work as expected | |||
// -> Show info message “Using TouchKit 4 license | |||
// 312-312321-321312-3-12-312-312 | |||
// licensed to <licensee> (1 developer license)” | |||
// licensed to <licensee> (1 developer license)" | |||
System.setProperty(licenseName, VALID_KEY); | |||
addonChecker.setLicenseProvider(validLicenseProvider); | |||
captureSystemOut(); |
@@ -35,7 +35,11 @@ import static com.vaadin.tools.CvalCheckerTest.unreachableLicenseProvider; | |||
import static com.vaadin.tools.CvalCheckerTest.validEvaluationLicenseProvider; | |||
import static com.vaadin.tools.CvalCheckerTest.validLicenseProvider; | |||
import java.net.URL; | |||
import java.net.URLClassLoader; | |||
import org.junit.Assert; | |||
import org.junit.Before; | |||
import org.junit.Test; | |||
import com.vaadin.tools.CvalChecker.CvalServer; | |||
@@ -81,59 +85,111 @@ public class CvalAddonstCheckerUseCasesTest { | |||
} | |||
} | |||
@Before | |||
public void setUp() { | |||
// Set up a new URLClassLoader for the thread | |||
Thread thread = Thread.currentThread(); | |||
thread.setContextClassLoader(new URLClassLoader(new URL[0], null)); | |||
} | |||
/* TODO: Use more descriptive test names */ | |||
@Test | |||
public void testUseCases() throws Exception { | |||
public void testUseCase1() throws Exception { | |||
useCase(1, License.NONE, Version.AGPL, Validated.NO, Network.OFF, | |||
Compile.YES, Cached.NO, Message.AGPL); | |||
} | |||
@Test | |||
public void testUseCase2() throws Exception { | |||
useCase(2, License.NONE, Version.CVAL, Validated.NO, Network.ON, | |||
Compile.NO, Cached.NO, Message.NO_LICENSE); | |||
} | |||
@Test | |||
public void testUseCase3() throws Exception { | |||
useCase(3, License.NONE, Version.CVAL, Validated.NO, Network.OFF, | |||
Compile.NO, Cached.NO, Message.NO_LICENSE); | |||
} | |||
@Test | |||
public void testUseCase4() throws Exception { | |||
useCase(4, License.EVAL, Version.CVAL, Validated.NO, Network.ON, | |||
Compile.YES, Cached.YES, Message.EVALUATION); | |||
} | |||
@Test | |||
public void testUseCase5() throws Exception { | |||
useCase(5, License.INVALID, Version.CVAL, Validated.NO, Network.OFF, | |||
Compile.YES, Cached.NO, Message.NO_VALIDATED); | |||
} | |||
@Test | |||
public void testUseCase6() throws Exception { | |||
useCase(6, License.INVALID, Version.CVAL, Validated.NO, Network.ON, | |||
Compile.NO, Cached.NO, Message.INVALID); | |||
} | |||
@Test | |||
public void testUseCase7() throws Exception { | |||
useCase(7, License.REAL, Version.CVAL, Validated.NO, Network.ON, | |||
Compile.YES, Cached.YES, Message.VALID); | |||
} | |||
@Test | |||
public void testUseCase8() throws Exception { | |||
useCase(8, License.REAL, Version.CVAL, Validated.NO, Network.OFF, | |||
Compile.YES, Cached.NO, Message.NO_VALIDATED); | |||
} | |||
@Test | |||
public void testUseCase9() throws Exception { | |||
useCase(9, License.REAL, Version.CVAL, Validated.YES, Network.OFF, | |||
Compile.YES, Cached.YES, Message.VALID); | |||
} | |||
@Test | |||
public void testUseCase10() throws Exception { | |||
useCase(10, License.EVAL_EXPIRED, Version.CVAL, Validated.NO, | |||
Network.ON, Compile.NO, Cached.YES, Message.EXPIRED); | |||
} | |||
@Test | |||
public void testUseCase11() throws Exception { | |||
useCase(11, License.EVAL_EXPIRED, Version.CVAL, Validated.YES, | |||
Network.OFF, Compile.NO, Cached.YES, Message.EXPIRED); | |||
} | |||
@Test | |||
public void testUseCase12() throws Exception { | |||
useCase(12, License.REAL_EXPIRED, Version.CVAL, Validated.YES, | |||
Network.OFF, Compile.NO, Cached.YES, Message.EXPIRED); | |||
} | |||
@Test | |||
public void testUseCase13() throws Exception { | |||
useCase(13, License.REAL_EXPIRED, Version.CVAL, Validated.NO, | |||
Network.ON, Compile.NO, Cached.YES, Message.EXPIRED); | |||
} | |||
@Test | |||
public void testUseCase14() throws Exception { | |||
useCase(14, License.INVALID, Version.CVAL, Validated.OLD_KEY, | |||
Network.OFF, Compile.YES, Cached.NO, Message.NO_VALIDATED); | |||
} | |||
@Test | |||
public void testMultipleLicenseUseCases() throws Exception { | |||
public void testMultipleLicenseUseCase15() throws Exception { | |||
addLicensedJarToClasspath("test.foo", VAADIN_CVAL); | |||
System.setProperty(computeLicenseName("test.foo"), VALID_KEY); | |||
useCase(15, License.REAL, Version.CVAL, Validated.YES, Network.OFF, | |||
Compile.YES, Cached.YES, Message.NO_VALIDATED); | |||
} | |||
@Test | |||
public void testMultipleLicenseUseCase16() throws Exception { | |||
addLicensedJarToClasspath("test.foo", VAADIN_CVAL); | |||
System.setProperty(computeLicenseName("test.foo"), VALID_KEY); | |||
useCase(16, License.REAL, Version.CVAL, Validated.YES, Network.ON, | |||
Compile.NO, Cached.YES, Message.INVALID); | |||
} |
@@ -304,14 +304,14 @@ public class CvalCheckerTest { | |||
testManifest.getMainAttributes().putValue(VAADIN_ADDON_VERSION, "2"); | |||
// Create a temporary Jar | |||
File testJarFile = File.createTempFile("vaadin." + productName, "jar"); | |||
File testJarFile = File.createTempFile("vaadin." + productName, ".jar"); | |||
testJarFile.deleteOnExit(); | |||
JarOutputStream target = new JarOutputStream(new FileOutputStream( | |||
testJarFile), testManifest); | |||
target.close(); | |||
// Add the new jar to our classpath (use reflection) | |||
URL url = new URL("file://" + testJarFile.getAbsolutePath()); | |||
URL url = testJarFile.toURI().toURL(); | |||
final Method addURL = URLClassLoader.class.getDeclaredMethod("addURL", | |||
new Class[] { URL.class }); | |||
addURL.setAccessible(true); |
@@ -46,7 +46,7 @@ | |||
<module organisation="com.vaadin" name="vaadin-client" | |||
resolver="local-maven" /> | |||
<module organisation="com.vaadin" name="vaadin-client-compiler" | |||
resolver="build-temp" /> | |||
resolver="local-maven" /> | |||
<module organisation="com.vaadin" name="vaadin-client-compiled" | |||
resolver="build-temp" /> | |||
<module organisation="com.vaadin" name="vaadin-themes" |
@@ -16,6 +16,7 @@ | |||
<properties> | |||
<maven.compiler.source>1.6</maven.compiler.source> | |||
<maven.compiler.target>1.6</maven.compiler.target> | |||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |||
<!-- Used version numbers for dependencies --> | |||
<commons-io.version>2.4</commons-io.version> | |||
@@ -50,6 +51,7 @@ | |||
<module>push</module> | |||
<module>server</module> | |||
<module>client</module> | |||
<module>client-compiler</module> | |||
</modules> | |||
</project> |
@@ -61,7 +61,7 @@ | |||
<!-- For compiling TestingWidgetSet --> | |||
<dependency org="com.vaadin" name="vaadin-client-compiler" | |||
rev="${vaadin.version}" conf="build-provided-> build"> | |||
rev="${vaadin.version}" conf="build-provided-> default"> | |||
<exclude type="pom" /> | |||
</dependency> | |||
@@ -33,7 +33,7 @@ | |||
<exclude type="pom" conf="test" /> | |||
</dependency> | |||
<dependency org="com.vaadin" name="vaadin-client-compiler" | |||
rev="${vaadin.version}" conf="build-provided,test->build"> | |||
rev="${vaadin.version}" conf="build-provided,test->default"> | |||
<exclude type="pom" conf="test" /> | |||
</dependency> | |||
<dependency org="com.vaadin" name="vaadin-themes" |