Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit428efc7

Browse files
anuragagarwal561994iluwatar
authored andcommitted
Java 11 migrate remaining p (iluwatar#1122)
* Moves partial-response to Java 11* Moves pipeline to Java 11* Moves poison-pill to Java 11* Moves priority-queue to Java 11* Moves private-class-data to Java 11* Moves producer-consumer to Java 11* Moves promise to Java 11* Moves property to Java 11* Moves prototype to Java 11* Moves proxy to Java 11* Corrects checkstyle errors* Fixes build for pipeline pattern
1 parent1401acc commit428efc7

File tree

82 files changed

+534
-603
lines changed

Some content is hidden

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

82 files changed

+534
-603
lines changed

‎master-worker-pattern/src/main/java/com/iluwatar/masterworker/App.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
packagecom.iluwatar.masterworker;
2525

2626
importcom.iluwatar.masterworker.system.ArrayTransposeMasterWorker;
27+
importcom.iluwatar.masterworker.system.MasterWorker;
28+
importcom.iluwatar.masterworker.system.systemmaster.ArrayTransposeMaster;
29+
importcom.iluwatar.masterworker.system.systemmaster.Master;
30+
importcom.iluwatar.masterworker.system.systemworkers.ArrayTransposeWorker;
31+
importcom.iluwatar.masterworker.system.systemworkers.Worker;
2732
importorg.slf4j.Logger;
2833
importorg.slf4j.LoggerFactory;
2934

‎page-object/pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,23 @@
2626
<projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2727
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2828
<modelVersion>4.0.0</modelVersion>
29+
<properties>
30+
<maven.compiler.source>11</maven.compiler.source>
31+
<maven.compiler.target>11</maven.compiler.target>
32+
</properties>
33+
<dependencies>
34+
<dependency>
35+
<groupId>net.sourceforge.htmlunit</groupId>
36+
<artifactId>htmlunit</artifactId>
37+
<scope>test</scope>
38+
</dependency>
39+
<dependency>
40+
<groupId>org.junit.jupiter</groupId>
41+
<artifactId>junit-jupiter</artifactId>
42+
<version>RELEASE</version>
43+
<scope>test</scope>
44+
</dependency>
45+
</dependencies>
2946
<parent>
3047
<groupId>com.iluwatar</groupId>
3148
<artifactId>java-design-patterns</artifactId>

‎page-object/sample-application/src/main/java/com/iluwatar/pageobject/App.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ private App() {
7171
publicstaticvoidmain(String[]args) {
7272

7373
try {
74-
FileapplicationFile =
75-
newFile(App.class.getClassLoader().getResource("sample-ui/login.html").getPath());
74+
varclassLoader =App.class.getClassLoader();
75+
varapplicationFile =newFile(classLoader.getResource("sample-ui/login.html").getPath());
7676

7777
// should work for unix like OS (mac, unix etc...)
7878
if (Desktop.isDesktopSupported()) {

‎page-object/src/main/java/com/iluwatar/pageobject/App.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ private App() {
6767
publicstaticvoidmain(String[]args) {
6868

6969
try {
70-
FileapplicationFile =
71-
newFile(App.class.getClassLoader().getResource("sample-ui/login.html").getPath());
70+
varclassLoader =App.class.getClassLoader();
71+
varapplicationFile =newFile(classLoader.getResource("sample-ui/login.html").getPath());
7272

7373
// Should work for unix like OS (mac, unix etc...)
7474
if (Desktop.isDesktopSupported()) {

‎page-object/src/test/java/com/iluwatar/pageobject/AlbumListPageTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323

2424
packagecom.iluwatar.pageobject;
2525

26+
importstaticorg.junit.jupiter.api.Assertions.assertTrue;
27+
2628
importcom.gargoylesoftware.htmlunit.WebClient;
2729
importcom.iluwatar.pageobject.pages.AlbumListPage;
2830
importcom.iluwatar.pageobject.pages.AlbumPage;
2931
importorg.junit.jupiter.api.BeforeEach;
3032
importorg.junit.jupiter.api.Test;
3133

32-
importstaticorg.junit.jupiter.api.Assertions.assertTrue;
33-
3434
/**
3535
* Test Album Selection and Album Listing
3636
*/
@@ -45,7 +45,7 @@ public void setUp() {
4545

4646
@Test
4747
publicvoidtestSelectAlbum() {
48-
AlbumPagealbumPage =albumListPage.selectAlbum("21");
48+
varalbumPage =albumListPage.selectAlbum("21");
4949
albumPage.navigateToPage();
5050
assertTrue(albumPage.isAt());
5151
}

‎page-object/src/test/java/com/iluwatar/pageobject/AlbumPageTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323

2424
packagecom.iluwatar.pageobject;
2525

26+
importstaticorg.junit.jupiter.api.Assertions.assertTrue;
27+
2628
importcom.gargoylesoftware.htmlunit.WebClient;
2729
importcom.iluwatar.pageobject.pages.AlbumListPage;
2830
importcom.iluwatar.pageobject.pages.AlbumPage;
2931
importorg.junit.jupiter.api.BeforeEach;
3032
importorg.junit.jupiter.api.Test;
3133

32-
importstaticorg.junit.jupiter.api.Assertions.assertTrue;
33-
3434
/**
3535
* Test Album Page Operations
3636
*/
@@ -46,7 +46,7 @@ public void setUp() {
4646
@Test
4747
publicvoidtestSaveAlbum() {
4848

49-
AlbumPagealbumPageAfterChanges =albumPage
49+
varalbumPageAfterChanges =albumPage
5050
.changeAlbumTitle("25")
5151
.changeArtist("Adele Laurie Blue Adkins")
5252
.changeAlbumYear(2015)
@@ -60,7 +60,7 @@ public void testSaveAlbum() {
6060

6161
@Test
6262
publicvoidtestCancelChanges() {
63-
AlbumListPagealbumListPage =albumPage.cancelChanges();
63+
varalbumListPage =albumPage.cancelChanges();
6464
albumListPage.navigateToPage();
6565
assertTrue(albumListPage.isAt());
6666
}

‎page-object/src/test/java/com/iluwatar/pageobject/LoginPageTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323

2424
packagecom.iluwatar.pageobject;
2525

26+
importstaticorg.junit.jupiter.api.Assertions.assertTrue;
27+
2628
importcom.gargoylesoftware.htmlunit.WebClient;
2729
importcom.iluwatar.pageobject.pages.AlbumListPage;
2830
importcom.iluwatar.pageobject.pages.LoginPage;
2931
importorg.junit.jupiter.api.BeforeEach;
3032
importorg.junit.jupiter.api.Test;
3133

32-
importstaticorg.junit.jupiter.api.Assertions.assertTrue;
33-
3434
/**
3535
* Test Login Page Object
3636
*/
@@ -45,7 +45,7 @@ public void setUp() {
4545

4646
@Test
4747
publicvoidtestLogin() {
48-
AlbumListPagealbumListPage =loginPage
48+
varalbumListPage =loginPage
4949
.enterUsername("admin")
5050
.enterPassword("password")
5151
.login();

‎page-object/src/test/java/com/iluwatar/pageobject/pages/AlbumListPage.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
importcom.gargoylesoftware.htmlunit.WebClient;
2727
importcom.gargoylesoftware.htmlunit.html.HtmlAnchor;
2828
importcom.gargoylesoftware.htmlunit.html.HtmlPage;
29-
3029
importjava.io.IOException;
3130
importjava.util.List;
3231

@@ -79,8 +78,8 @@ public boolean isAt() {
7978
*/
8079
publicAlbumPageselectAlbum(StringalbumTitle) {
8180
// uses XPath to find list of html anchor tags with the class album in it
82-
List<HtmlAnchor>albumLinks = (List<HtmlAnchor>)page.getByXPath("//tr[@class='album']//a");
83-
for (HtmlAnchoranchor :albumLinks) {
81+
varalbumLinks = (List<HtmlAnchor>)page.getByXPath("//tr[@class='album']//a");
82+
for (varanchor :albumLinks) {
8483
if (anchor.getTextContent().equals(albumTitle)) {
8584
try {
8685
anchor.click();

‎page-object/src/test/java/com/iluwatar/pageobject/pages/AlbumPage.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
importcom.gargoylesoftware.htmlunit.html.HtmlSelect;
3131
importcom.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
3232
importcom.gargoylesoftware.htmlunit.html.HtmlTextInput;
33-
3433
importjava.io.IOException;
3534

3635
/**
@@ -83,7 +82,7 @@ public boolean isAt() {
8382
* @return {@link AlbumPage}
8483
*/
8584
publicAlbumPagechangeAlbumTitle(StringalbumTitle) {
86-
HtmlTextInputalbumTitleInputTextField = (HtmlTextInput)page.getElementById("albumTitle");
85+
varalbumTitleInputTextField = (HtmlTextInput)page.getElementById("albumTitle");
8786
albumTitleInputTextField.setText(albumTitle);
8887
returnthis;
8988
}
@@ -96,7 +95,7 @@ public AlbumPage changeAlbumTitle(String albumTitle) {
9695
* @return {@link AlbumPage}
9796
*/
9897
publicAlbumPagechangeArtist(Stringartist) {
99-
HtmlTextInputartistInputTextField = (HtmlTextInput)page.getElementById("albumArtist");
98+
varartistInputTextField = (HtmlTextInput)page.getElementById("albumArtist");
10099
artistInputTextField.setText(artist);
101100
returnthis;
102101
}
@@ -109,8 +108,8 @@ public AlbumPage changeArtist(String artist) {
109108
* @return {@link AlbumPage}
110109
*/
111110
publicAlbumPagechangeAlbumYear(intyear) {
112-
HtmlSelectalbumYearSelectOption = (HtmlSelect)page.getElementById("albumYear");
113-
HtmlOptionyearOption =albumYearSelectOption.getOptionByValue(Integer.toString(year));
111+
varalbumYearSelectOption = (HtmlSelect)page.getElementById("albumYear");
112+
varyearOption =albumYearSelectOption.getOptionByValue(Integer.toString(year));
114113
albumYearSelectOption.setSelectedAttribute(yearOption,true);
115114
returnthis;
116115
}
@@ -123,7 +122,7 @@ public AlbumPage changeAlbumYear(int year) {
123122
* @return {@link AlbumPage}
124123
*/
125124
publicAlbumPagechangeAlbumRating(StringalbumRating) {
126-
HtmlTextInputalbumRatingInputTextField = (HtmlTextInput)page.getElementById("albumRating");
125+
varalbumRatingInputTextField = (HtmlTextInput)page.getElementById("albumRating");
127126
albumRatingInputTextField.setText(albumRating);
128127
returnthis;
129128
}
@@ -135,7 +134,7 @@ public AlbumPage changeAlbumRating(String albumRating) {
135134
* @return {@link AlbumPage}
136135
*/
137136
publicAlbumPagechangeNumberOfSongs(intnumberOfSongs) {
138-
HtmlNumberInputnumberOfSongsNumberField = (HtmlNumberInput)page.getElementById("numberOfSongs");
137+
varnumberOfSongsNumberField = (HtmlNumberInput)page.getElementById("numberOfSongs");
139138
numberOfSongsNumberField.setText(Integer.toString(numberOfSongs));
140139
returnthis;
141140
}
@@ -147,7 +146,7 @@ public AlbumPage changeNumberOfSongs(int numberOfSongs) {
147146
* @return {@link AlbumListPage}
148147
*/
149148
publicAlbumListPagecancelChanges() {
150-
HtmlSubmitInputcancelButton = (HtmlSubmitInput)page.getElementById("cancelButton");
149+
varcancelButton = (HtmlSubmitInput)page.getElementById("cancelButton");
151150
try {
152151
cancelButton.click();
153152
}catch (IOExceptione) {
@@ -163,7 +162,7 @@ public AlbumListPage cancelChanges() {
163162
* @return {@link AlbumPage}
164163
*/
165164
publicAlbumPagesaveChanges() {
166-
HtmlSubmitInputsaveButton = (HtmlSubmitInput)page.getElementById("saveButton");
165+
varsaveButton = (HtmlSubmitInput)page.getElementById("saveButton");
167166
try {
168167
saveButton.click();
169168
}catch (IOExceptione) {

‎page-object/src/test/java/com/iluwatar/pageobject/pages/LoginPage.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public boolean isAt() {
7979
* @return {@link LoginPage}
8080
*/
8181
publicLoginPageenterUsername(Stringusername) {
82-
HtmlTextInputusernameInputTextField = (HtmlTextInput)page.getElementById("username");
82+
varusernameInputTextField = (HtmlTextInput)page.getElementById("username");
8383
usernameInputTextField.setText(username);
8484
returnthis;
8585
}
@@ -92,7 +92,7 @@ public LoginPage enterUsername(String username) {
9292
* @return {@link LoginPage}
9393
*/
9494
publicLoginPageenterPassword(Stringpassword) {
95-
HtmlPasswordInputpasswordInputPasswordField = (HtmlPasswordInput)page.getElementById("password");
95+
varpasswordInputPasswordField = (HtmlPasswordInput)page.getElementById("password");
9696
passwordInputPasswordField.setText(password);
9797
returnthis;
9898
}
@@ -101,11 +101,11 @@ public LoginPage enterPassword(String password) {
101101
/**
102102
* Clicking on the login button to 'login'
103103
*
104-
* @return {@link AlbumListPage}
105-
* - this is the page that user gets navigated to once successfullylogged in
104+
* @return {@link AlbumListPage} - this is the page that user gets navigated to once successfully
105+
* logged in
106106
*/
107107
publicAlbumListPagelogin() {
108-
HtmlSubmitInputloginButton = (HtmlSubmitInput)page.getElementById("loginButton");
108+
varloginButton = (HtmlSubmitInput)page.getElementById("loginButton");
109109
try {
110110
loginButton.click();
111111
}catch (IOExceptione) {

‎page-object/src/test/java/com/iluwatar/pageobject/pages/Page.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
publicabstractclassPage {
3232

3333
/**
34-
* Application Under Test path
35-
* This directory location is where html web pages are located
34+
* Application Under Test path This directory location is where html web pages are located
3635
*/
3736
publicstaticfinalStringAUT_PATH ="src/main/resources/sample-ui/";
3837

‎page-object/test-automation/src/main/java/com/iluwatar/pageobject/AlbumListPage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ public boolean isAt() {
8181
*/
8282
publicAlbumPageselectAlbum(StringalbumTitle) {
8383
// uses XPath to find list of html anchor tags with the class album in it
84-
List<HtmlAnchor>albumLinks = (List<HtmlAnchor>)page.getByXPath("//tr[@class='album']//a");
85-
for (HtmlAnchoranchor :albumLinks) {
84+
varalbumLinks = (List<HtmlAnchor>)page.getByXPath("//tr[@class='album']//a");
85+
for (varanchor :albumLinks) {
8686
if (anchor.getTextContent().equals(albumTitle)) {
8787
try {
8888
anchor.click();

‎page-object/test-automation/src/main/java/com/iluwatar/pageobject/AlbumPage.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
importcom.gargoylesoftware.htmlunit.WebClient;
2727
importcom.gargoylesoftware.htmlunit.html.HtmlNumberInput;
28-
importcom.gargoylesoftware.htmlunit.html.HtmlOption;
2928
importcom.gargoylesoftware.htmlunit.html.HtmlPage;
3029
importcom.gargoylesoftware.htmlunit.html.HtmlSelect;
3130
importcom.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
@@ -85,7 +84,7 @@ public boolean isAt() {
8584
* @return {@link AlbumPage}
8685
*/
8786
publicAlbumPagechangeAlbumTitle(StringalbumTitle) {
88-
HtmlTextInputalbumTitleInputTextField = (HtmlTextInput)page.getElementById("albumTitle");
87+
varalbumTitleInputTextField = (HtmlTextInput)page.getElementById("albumTitle");
8988
albumTitleInputTextField.setText(albumTitle);
9089
returnthis;
9190
}
@@ -98,7 +97,7 @@ public AlbumPage changeAlbumTitle(String albumTitle) {
9897
* @return {@link AlbumPage}
9998
*/
10099
publicAlbumPagechangeArtist(Stringartist) {
101-
HtmlTextInputartistInputTextField = (HtmlTextInput)page.getElementById("albumArtist");
100+
varartistInputTextField = (HtmlTextInput)page.getElementById("albumArtist");
102101
artistInputTextField.setText(artist);
103102
returnthis;
104103
}
@@ -111,8 +110,8 @@ public AlbumPage changeArtist(String artist) {
111110
* @return {@link AlbumPage}
112111
*/
113112
publicAlbumPagechangeAlbumYear(intyear) {
114-
HtmlSelectalbumYearSelectOption = (HtmlSelect)page.getElementById("albumYear");
115-
HtmlOptionyearOption =albumYearSelectOption.getOptionByValue(Integer.toString(year));
113+
varalbumYearSelectOption = (HtmlSelect)page.getElementById("albumYear");
114+
varyearOption =albumYearSelectOption.getOptionByValue(Integer.toString(year));
116115
albumYearSelectOption.setSelectedAttribute(yearOption,true);
117116
returnthis;
118117
}
@@ -125,7 +124,7 @@ public AlbumPage changeAlbumYear(int year) {
125124
* @return {@link AlbumPage}
126125
*/
127126
publicAlbumPagechangeAlbumRating(StringalbumRating) {
128-
HtmlTextInputalbumRatingInputTextField = (HtmlTextInput)page.getElementById("albumRating");
127+
varalbumRatingInputTextField = (HtmlTextInput)page.getElementById("albumRating");
129128
albumRatingInputTextField.setText(albumRating);
130129
returnthis;
131130
}
@@ -137,8 +136,7 @@ public AlbumPage changeAlbumRating(String albumRating) {
137136
* @return {@link AlbumPage}
138137
*/
139138
publicAlbumPagechangeNumberOfSongs(intnumberOfSongs) {
140-
HtmlNumberInputnumberOfSongsNumberField =
141-
(HtmlNumberInput)page.getElementById("numberOfSongs");
139+
varnumberOfSongsNumberField = (HtmlNumberInput)page.getElementById("numberOfSongs");
142140
numberOfSongsNumberField.setText(Integer.toString(numberOfSongs));
143141
returnthis;
144142
}
@@ -150,7 +148,7 @@ public AlbumPage changeNumberOfSongs(int numberOfSongs) {
150148
* @return {@link AlbumListPage}
151149
*/
152150
publicAlbumListPagecancelChanges() {
153-
HtmlSubmitInputcancelButton = (HtmlSubmitInput)page.getElementById("cancelButton");
151+
varcancelButton = (HtmlSubmitInput)page.getElementById("cancelButton");
154152
try {
155153
cancelButton.click();
156154
}catch (IOExceptione) {
@@ -166,7 +164,7 @@ public AlbumListPage cancelChanges() {
166164
* @return {@link AlbumPage}
167165
*/
168166
publicAlbumPagesaveChanges() {
169-
HtmlSubmitInputsaveButton = (HtmlSubmitInput)page.getElementById("saveButton");
167+
varsaveButton = (HtmlSubmitInput)page.getElementById("saveButton");
170168
try {
171169
saveButton.click();
172170
}catch (IOExceptione) {

‎page-object/test-automation/src/main/java/com/iluwatar/pageobject/LoginPage.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public boolean isAt() {
8282
* @return {@link LoginPage}
8383
*/
8484
publicLoginPageenterUsername(Stringusername) {
85-
HtmlTextInputusernameInputTextField = (HtmlTextInput)page.getElementById("username");
85+
varusernameInputTextField = (HtmlTextInput)page.getElementById("username");
8686
usernameInputTextField.setText(username);
8787
returnthis;
8888
}
@@ -95,8 +95,7 @@ public LoginPage enterUsername(String username) {
9595
* @return {@link LoginPage}
9696
*/
9797
publicLoginPageenterPassword(Stringpassword) {
98-
HtmlPasswordInputpasswordInputPasswordField =
99-
(HtmlPasswordInput)page.getElementById("password");
98+
varpasswordInputPasswordField = (HtmlPasswordInput)page.getElementById("password");
10099
passwordInputPasswordField.setText(password);
101100
returnthis;
102101
}
@@ -109,7 +108,7 @@ public LoginPage enterPassword(String password) {
109108
* logged in
110109
*/
111110
publicAlbumListPagelogin() {
112-
HtmlSubmitInputloginButton = (HtmlSubmitInput)page.getElementById("loginButton");
111+
varloginButton = (HtmlSubmitInput)page.getElementById("loginButton");
113112
try {
114113
loginButton.click();
115114
}catch (IOExceptione) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp