Skip to content

Commit 6ca6d76

Browse files
committed
Add AddinsTestSuite for better performance on Travis Building Process also this will avoid individual JDT process each tests.
1 parent 3f47797 commit 6ca6d76

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+738
-191
lines changed

pom.xml

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
<properties>
1919
<gwt-material.version>2.4.0-SNAPSHOT</gwt-material.version>
20+
<maven.failsafe.plugin>2.22.1</maven.failsafe.plugin>
2021
</properties>
2122

2223
<scm>
@@ -96,9 +97,14 @@
9697
<dependency>
9798
<groupId>junit</groupId>
9899
<artifactId>junit</artifactId>
99-
<version>4.11</version>
100+
<version>${junit.version}</version>
100101
<scope>test</scope>
101102
</dependency>
103+
<dependency>
104+
<groupId>net.sourceforge.htmlunit</groupId>
105+
<artifactId>htmlunit</artifactId>
106+
<version>${htmlunit.version}</version>
107+
</dependency>
102108
</dependencies>
103109

104110
<repositories>
@@ -120,22 +126,35 @@
120126
<artifactId>maven-surefire-plugin</artifactId>
121127
<version>${surefire.version}</version>
122128
<configuration>
123-
<additionalClasspathElements>
124-
<additionalClasspathElement>${project.build.sourceDirectory}</additionalClasspathElement>
125-
<additionalClasspathElement>${project.build.testSourceDirectory}</additionalClasspathElement>
126-
</additionalClasspathElements>
127-
<useManifestOnlyJar>false</useManifestOnlyJar>
128-
<forkMode>always</forkMode>
129-
<argLine>-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog</argLine>
129+
<excludes>
130+
<exclude>**/**.java</exclude>
131+
</excludes>
130132
</configuration>
131133
<executions>
132134
<execution>
135+
<phase>test</phase>
133136
<goals>
134137
<goal>test</goal>
135138
</goals>
136139
</execution>
137140
</executions>
138141
</plugin>
142+
143+
<plugin>
144+
<!--
145+
The integration-test phase runs after regular test phase (but before verify/install).
146+
We use this to our advantage to peak at the compiled output from the GWTTestSuite
147+
-->
148+
<groupId>org.apache.maven.plugins</groupId>
149+
<artifactId>maven-failsafe-plugin</artifactId>
150+
<version>${maven.failsafe.plugin}</version>
151+
<configuration>
152+
<includes>
153+
<include>**/*.class</include>
154+
</includes>
155+
</configuration>
156+
</plugin>
157+
139158
<plugin>
140159
<groupId>net.ltgt.gwt.maven</groupId>
141160
<artifactId>gwt-maven-plugin</artifactId>
@@ -159,14 +178,40 @@
159178
<skipModule>true</skipModule>
160179
<classpathScope>compile+runtime</classpathScope>
161180
<failOnError>true</failOnError>
162-
<skipModule>true</skipModule>
163181
</configuration>
164182
<executions>
165183
<execution>
184+
<id>compile</id>
166185
<goals>
167186
<goal>compile</goal>
168187
</goals>
169188
</execution>
189+
<execution>
190+
<id>default-test</id>
191+
<goals>
192+
<goal>test</goal>
193+
</goals>
194+
<configuration>
195+
<!--
196+
Because we expressly disable asserts in tests to avoid a compiler bug, we also must run surefire manually
197+
on the JRE tests
198+
-->
199+
<excludes>
200+
<exclude>**/ui/**.java</exclude>
201+
</excludes>
202+
<includes>
203+
<include>**/AddinsTestSuite.java</include>
204+
<include>**/IncubatorTestSuite.java</include>
205+
</includes>
206+
207+
<!-- disable JVM asserts, but enable JS asserts for tests -->
208+
<enableAssertions>false</enableAssertions>
209+
<testArgs>
210+
<testArg>-checkAssertions</testArg>
211+
</testArgs>
212+
<skipTests>false</skipTests>
213+
</configuration>
214+
</execution>
170215
</executions>
171216
</plugin>
172217
<plugin>

src/main/java/gwt/material/design/addins/client/livestamp/js/JsLiveStamp.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2020 GwtMaterialDesign
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
/*
21+
* Copyright 2008 Google Inc.
22+
*
23+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
24+
* use this file except in compliance with the License. You may obtain a copy of
25+
* the License at
26+
*
27+
* http://www.apache.org/licenses/LICENSE-2.0
28+
*
29+
* Unless required by applicable law or agreed to in writing, software
30+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
31+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
32+
* License for the specific language governing permissions and limitations under
33+
* the License.
34+
*/
35+
package com.google.gwt.junit;
36+
37+
import com.google.gwt.core.ext.TreeLogger;
38+
import com.google.gwt.core.ext.UnableToCompleteException;
39+
40+
import java.util.Collections;
41+
import java.util.Set;
42+
43+
/**
44+
* An abstract class that handles the details of launching a browser.
45+
*/
46+
//TODO: Temporary workaround for old HTMLUnitTest that is not compatible with latest JQuery 3.x
47+
public abstract class RunStyle {
48+
49+
/**
50+
* The containing shell.
51+
*/
52+
protected final JUnitShell shell;
53+
54+
private int tries = 1;
55+
56+
private Set<String> userAgents;
57+
58+
/**
59+
* Constructor for RunStyle. Any subclass must provide a constructor with the
60+
* same signature since this will be how the RunStyle is created via
61+
* reflection.
62+
*
63+
* @param shell the containing shell
64+
*/
65+
public RunStyle(JUnitShell shell) {
66+
this.shell = shell;
67+
}
68+
69+
/**
70+
* Tests whether the test was interrupted.
71+
*
72+
* @return the interrupted hosts, or null if not interrupted
73+
*/
74+
public String[] getInterruptedHosts() {
75+
return null;
76+
}
77+
78+
/**
79+
* Get the host name of the local system to use in URLs. This method returns
80+
* the host address instead of the host name in case the test target cannot
81+
* resolve the host name.
82+
*
83+
* @return the host name of the local system
84+
*/
85+
public String getLocalHostName() {
86+
return "localhost";
87+
}
88+
89+
/**
90+
* Returns the platforms specific to this run style.
91+
*/
92+
public Set<Platform> getPlatforms() {
93+
return Collections.emptySet();
94+
}
95+
96+
/**
97+
* Returns user agents for this run style.
98+
*
99+
* @return the user agents, or {@code null} if unknown
100+
*/
101+
public Set<String> getUserAgents() {
102+
return userAgents;
103+
}
104+
105+
/**
106+
* Returns the number of times this test should be tried to run. A test
107+
* succeeds if it succeeds even once.
108+
*
109+
* @return the number of attempts
110+
*/
111+
public int getTries() {
112+
return tries;
113+
}
114+
115+
/**
116+
* Initialize the runstyle with any supplied arguments, and return the number
117+
* of clients this runstyle controls.
118+
*
119+
* @param args arguments passed in -runStyle option, null if none supplied
120+
* @return the number of clients, or -1 if initialization was unsuccessful
121+
*/
122+
public abstract int initialize(String args);
123+
124+
/**
125+
* Requests initial launch of the browser. This should only be called once per
126+
* instance of RunStyle.
127+
*
128+
* @param moduleName the module to run
129+
* @throws UnableToCompleteException
130+
*/
131+
public abstract void launchModule(String moduleName)
132+
throws UnableToCompleteException;
133+
134+
/**
135+
* Sets the number of times a test should be tried -- it succeeds if any
136+
* attempt succeeds.
137+
*
138+
* @param tries number of attempts
139+
*/
140+
public void setTries(int tries) {
141+
this.tries = tries;
142+
}
143+
144+
/**
145+
* Sets the associated user agents for this run style.
146+
*/
147+
public void setUserAgents(Set<String> userAgents) {
148+
this.userAgents = userAgents;
149+
}
150+
151+
/**
152+
* Setup this RunStyle for the selected mode.
153+
*
154+
* @param logger TreeLogger to use for any messages
155+
* @param developmentMode true if we are running in development mode rather
156+
* that web/production mode
157+
* @return false if we should abort processing due to an unsupported mode or
158+
* an error setting up for that mode
159+
*/
160+
public boolean setupMode(TreeLogger logger, boolean developmentMode) {
161+
return true;
162+
}
163+
164+
/**
165+
* Whether the embedded server should ever generate resources. Development
166+
* mode needs this, but not with -noserver.
167+
*
168+
* @return true if resources should be automatically generated by the server.
169+
*/
170+
public boolean shouldAutoGenerateResources() {
171+
// TODO(spoon) does Production Mode get simpler if this is turned on?
172+
return true;
173+
}
174+
175+
/**
176+
* Gets the shell logger.
177+
*/
178+
protected TreeLogger getLogger() {
179+
return shell.getTopLogger();
180+
}
181+
}

0 commit comments

Comments
 (0)