Skip to content

Commit e8f868b

Browse files
authored
Merge pull request #72 from snoopdave/update-selenium-tests
Upgrade to Jetty 11 maven plugin
2 parents f70b8d5 + 4d6ee11 commit e8f868b

15 files changed

+76
-45
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ Compile and build Roller:
4646
$ cd roller
4747
$ mvn -DskipTests=true install
4848

49-
Run Roller in Jetty with Derby database:
49+
Run Roller in Jetty with an embedded Derby database (for testing only):
5050

51-
$ cd app
5251
$ mvn jetty:run
5352

5453
Once Jetty is up and running browse to <http://localhost:8080/roller> to try to Roller.

app/pom.xml

+3-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ limitations under the License.
5555
<maven-antrun.version>1.0b3</maven-antrun.version>
5656
<rome.version>1.13.1</rome.version>
5757
<slf4j.version>1.7.30</slf4j.version>
58-
<spring.version>5.2.7.RELEASE</spring.version>
5958
<spring.security.version>5.3.3.RELEASE</spring.security.version>
6059
<struts.version>2.5.22</struts.version>
6160
<velocity.version>2.2</velocity.version>
@@ -87,6 +86,7 @@ limitations under the License.
8786
<groupId>javax.servlet</groupId>
8887
<artifactId>jstl</artifactId>
8988
<version>${jstl.version}</version>
89+
<scope>provided</scope>
9090
</dependency>
9191

9292
<dependency>
@@ -105,7 +105,7 @@ limitations under the License.
105105
<dependency>
106106
<groupId>javax.xml.bind</groupId>
107107
<artifactId>jaxb-api</artifactId>
108-
<version>2.3.1</version>
108+
<version>${jaxb.version}</version>
109109
<exclusions>
110110
<exclusion>
111111
<!--api is already in the javax.activation artifact-->
@@ -492,7 +492,6 @@ limitations under the License.
492492
</exclusions>
493493
</dependency>
494494

495-
496495
<!-- Other deps include Guice and ROME -->
497496

498497
<dependency>
@@ -598,7 +597,7 @@ limitations under the License.
598597
<webApp>
599598
<contextPath>/roller</contextPath>
600599
</webApp>
601-
<jettyXml>src/test/resources/jetty.xml</jettyXml>
600+
<jettyXmls>src/test/resources/jetty.xml</jettyXmls>
602601
<systemProperties>
603602
<systemProperty>
604603
<name>roller.custom.config</name>

it-selenium/pom.xml

+50-6
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,33 @@
6161
<groupId>org.seleniumhq.selenium</groupId>
6262
<artifactId>selenium-firefox-driver</artifactId>
6363
<version>3.141.59</version>
64+
<exclusions>
65+
<exclusion>
66+
<groupId>javax.servlet</groupId>
67+
<artifactId>javax.servlet-api</artifactId>
68+
</exclusion>
69+
<exclusion>
70+
<groupId>xerces</groupId>
71+
<artifactId>xercesImpl</artifactId>
72+
</exclusion>
73+
<exclusion>
74+
<groupId>xalan</groupId>
75+
<artifactId>xalan</artifactId>
76+
</exclusion>
77+
</exclusions>
78+
</dependency>
79+
80+
<dependency>
81+
<groupId>javax.xml.bind</groupId>
82+
<artifactId>jaxb-api</artifactId>
83+
<version>${jaxb.version}</version>
84+
<exclusions>
85+
<exclusion>
86+
<!--api is already in the javax.activation artifact-->
87+
<groupId>javax.activation</groupId>
88+
<artifactId>javax.activation-api</artifactId>
89+
</exclusion>
90+
</exclusions>
6491
</dependency>
6592

6693
<!-- Will bring in once we configure a Chrome option -->
@@ -94,8 +121,7 @@
94121
<build>
95122
<plugins>
96123

97-
<!-- Activates integration tests (by default, classes under tests that end with "IT")
98-
-->
124+
<!-- Activates integration tests (by default, classes under tests that end with "IT") -->
99125
<plugin>
100126
<artifactId>maven-failsafe-plugin</artifactId>
101127
<version>3.0.0-M5</version>
@@ -135,7 +161,7 @@
135161
<port>4224</port>
136162
<sources>
137163
<script>
138-
<sourceFile>target/roller-selenium-tests-${project.version}/WEB-INF/classes/dbscripts/derby/createdb.sql</sourceFile>
164+
<sourceFile>${project.basedir}/target/roller-selenium-tests-${project.version}/WEB-INF/classes/dbscripts/derby/createdb.sql</sourceFile>
139165
</script>
140166
</sources>
141167
</configuration>
@@ -163,7 +189,7 @@
163189
<contextPath>/roller</contextPath>
164190
</webApp>
165191
<webAppSourceDirectory>target/roller-selenium-tests-${project.version}</webAppSourceDirectory>
166-
<jettyXml>../app/src/test/resources/jetty.xml</jettyXml>
192+
<jettyXmls>${project.parent.basedir}/app/src/test/resources/jetty.xml</jettyXmls>
167193
<systemProperties>
168194
<systemProperty>
169195
<name>roller.custom.config</name>
@@ -179,8 +205,6 @@
179205
<goal>start</goal>
180206
</goals>
181207
<configuration>
182-
<scanIntervalSeconds>0</scanIntervalSeconds>
183-
<!-- <daemon>true</daemon> -->
184208
</configuration>
185209
</execution>
186210
<execution>
@@ -211,12 +235,32 @@
211235
<version>${derby.version}</version>
212236
</dependency>
213237

238+
<dependency>
239+
<groupId>commons-dbcp</groupId>
240+
<artifactId>commons-dbcp</artifactId>
241+
<version>1.4</version>
242+
<scope>runtime</scope>
243+
</dependency>
244+
214245
<dependency>
215246
<groupId>javax.mail</groupId>
216247
<artifactId>mail</artifactId>
217248
<version>1.4.7</version>
218249
</dependency>
219250

251+
<dependency>
252+
<groupId>javax.xml.bind</groupId>
253+
<artifactId>jaxb-api</artifactId>
254+
<version>${jaxb.version}</version>
255+
<exclusions>
256+
<exclusion>
257+
<!--api is already in the javax.activation artifact-->
258+
<groupId>javax.activation</groupId>
259+
<artifactId>javax.activation-api</artifactId>
260+
</exclusion>
261+
</exclusions>
262+
</dependency>
263+
220264
</dependencies>
221265
</plugin>
222266
</plugins>

it-selenium/src/test/java/org/apache/roller/selenium/InitialLoginTestIT.java

+11-6
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
package org.apache.roller.selenium;
1919

2020
import java.util.concurrent.TimeUnit;
21-
import org.junit.*;
22-
import org.openqa.selenium.*;
23-
import org.openqa.selenium.firefox.FirefoxDriver;
2421
import org.apache.roller.selenium.core.CreateWeblogPage;
2522
import org.apache.roller.selenium.core.LoginPage;
2623
import org.apache.roller.selenium.core.MainMenuPage;
@@ -31,10 +28,20 @@
3128
import org.apache.roller.selenium.editor.EntryEditPage;
3229
import org.apache.roller.selenium.view.BlogHomePage;
3330
import org.apache.roller.selenium.view.SingleBlogEntryPage;
31+
import org.junit.After;
32+
import org.junit.Before;
33+
import org.junit.Test;
34+
import org.openqa.selenium.Alert;
35+
import org.openqa.selenium.By;
36+
import org.openqa.selenium.NoAlertPresentException;
37+
import org.openqa.selenium.NoSuchElementException;
38+
import org.openqa.selenium.WebDriver;
39+
import org.openqa.selenium.firefox.FirefoxDriver;
3440
import org.openqa.selenium.firefox.FirefoxOptions;
3541
import org.openqa.selenium.firefox.FirefoxProfile;
3642

37-
import static org.junit.Assert.*;
43+
import static org.junit.Assert.assertEquals;
44+
import static org.junit.Assert.fail;
3845

3946
public class InitialLoginTestIT {
4047
private WebDriver driver;
@@ -44,7 +51,6 @@ public class InitialLoginTestIT {
4451

4552
@Before
4653
public void setUp() throws Exception {
47-
4854
FirefoxProfile profile = new FirefoxProfile();
4955
profile.setPreference("intl.accept_languages", "en_US");
5056

@@ -55,7 +61,6 @@ public void setUp() throws Exception {
5561
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS)
5662
.pageLoadTimeout(5, TimeUnit.SECONDS)
5763
.setScriptTimeout(5, TimeUnit.SECONDS);
58-
5964
baseUrl = "http://localhost:8080/roller/";
6065
}
6166

it-selenium/src/test/java/org/apache/roller/selenium/core/CreateWeblogPage.java

-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import org.apache.roller.selenium.AbstractRollerPage;
2121
import org.openqa.selenium.WebDriver;
2222

23-
import java.lang.String;
24-
2523
/**
2624
* represents core/CreateWeblog.jsp
2725
*/

it-selenium/src/test/java/org/apache/roller/selenium/core/MainMenuPage.java

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.apache.roller.selenium.editor.EntryAddPage;
2222
import org.openqa.selenium.WebDriver;
2323

24-
2524
/**
2625
* represents core/MainMenu.jsp
2726
* Post-login page object to create, choose, configure blogs.

it-selenium/src/test/java/org/apache/roller/selenium/core/RegisterPage.java

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.openqa.selenium.support.ui.ExpectedConditions;
2424
import org.openqa.selenium.support.ui.WebDriverWait;
2525

26-
2726
/**
2827
* represents core/Register.jsp
2928
* index page that does step #1 of setup.jsp, the adding of a new user

it-selenium/src/test/java/org/apache/roller/selenium/core/SetupPage.java

-5
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@
1919

2020
import org.apache.roller.selenium.AbstractRollerPage;
2121
import org.apache.roller.selenium.view.BlogHomePage;
22-
import org.openqa.selenium.By;
2322
import org.openqa.selenium.WebDriver;
24-
import org.openqa.selenium.support.ui.ExpectedConditions;
25-
import org.openqa.selenium.support.ui.WebDriverWait;
26-
27-
import java.util.concurrent.TimeUnit;
2823

2924
/**
3025
* represents core/Setup.jsp

it-selenium/src/test/java/org/apache/roller/selenium/core/WelcomePage.java

-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import org.apache.roller.selenium.AbstractRollerPage;
2121
import org.openqa.selenium.WebDriver;
2222

23-
import java.lang.String;
24-
2523
/**
2624
* represents core/Welcome.jsp
2725
* Page Object after creation of a new user account (RegisterPage)

it-selenium/src/test/java/org/apache/roller/selenium/editor/AbstractEntryPage.java

-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
package org.apache.roller.selenium.editor;
1919

2020
import org.apache.roller.selenium.AbstractRollerPage;
21-
import org.openqa.selenium.WebDriver;
22-
23-
import java.lang.String;
2421

2522
/**
2623
* Base class for the new/edit entry pages

it-selenium/src/test/java/org/apache/roller/selenium/editor/EntryAddPage.java

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
import org.openqa.selenium.WebDriver;
2121

22-
import java.lang.String;
23-
2422
/**
2523
* represents editor/EntryAddPage.jsp
2624
* Page for adding a new blog entry

it-selenium/src/test/java/org/apache/roller/selenium/editor/EntryEditPage.java

-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import org.apache.roller.selenium.view.SingleBlogEntryPage;
2121
import org.openqa.selenium.WebDriver;
2222

23-
import java.lang.String;
24-
2523
/**
2624
* represents editor/EntryEditPage.jsp
2725
* Page for editing an already saved (draft or posted) blog entry

it-selenium/src/test/java/org/apache/roller/selenium/view/BlogHomePage.java

-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
import org.apache.roller.selenium.editor.EntryAddPage;
2222
import org.openqa.selenium.WebDriver;
2323

24-
import java.lang.String;
25-
2624
/**
2725
* Represents a URL for the home page of a blog
2826
* (URL similar to http://localhost:8080/roller/myblog)

it-selenium/src/test/java/org/apache/roller/selenium/view/SingleBlogEntryPage.java

-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import org.apache.roller.selenium.AbstractRollerPage;
2121
import org.openqa.selenium.WebDriver;
2222

23-
import java.lang.String;
24-
2523
/**
2624
* represents a URL that displays a single blog entry
2725
* (URL similar to http://localhost:8080/roller/myblog/entry/my_blog_entry)

pom.xml

+11-5
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ limitations under the License.
2525
<version>6.1.0-SNAPSHOT</version>
2626
<packaging>pom</packaging>
2727

28-
<prerequisites>
29-
<maven>3.0.5</maven>
30-
</prerequisites>
31-
3228
<name>Roller</name>
3329
<description>
3430
Roller is an open source blog server built with open source Java
@@ -47,7 +43,10 @@ limitations under the License.
4743
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4844
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
4945
<derby.version>10.11.1.1</derby.version>
46+
<jaxb.version>2.3.1</jaxb.version>
47+
<jetty.version>10.0.0</jetty.version>
5048
<roller.version>6.1.0-SNAPSHOT</roller.version>
49+
<spring.version>5.2.7.RELEASE</spring.version>
5150
</properties>
5251

5352
<modules>
@@ -80,7 +79,7 @@ limitations under the License.
8079
<plugin>
8180
<groupId>org.eclipse.jetty</groupId>
8281
<artifactId>jetty-maven-plugin</artifactId>
83-
<version>9.4.17.v20190418</version>
82+
<version>${jetty.version}</version>
8483
</plugin>
8584
<plugin>
8685
<groupId>com.btmatthews.maven.plugins.inmemdb</groupId>
@@ -111,6 +110,13 @@ limitations under the License.
111110
<version>5.6.2</version>
112111
<scope>test</scope>
113112
</dependency>
113+
<dependency>
114+
<groupId>org.springframework</groupId>
115+
<artifactId>spring-framework-bom</artifactId>
116+
<version>${spring.version}</version>
117+
<type>pom</type>
118+
<scope>import</scope>
119+
</dependency>
114120
</dependencies>
115121
</dependencyManagement>
116122

0 commit comments

Comments
 (0)