Skip to content

Commit e33d3e6

Browse files
fix style
1 parent 3525c27 commit e33d3e6

File tree

7 files changed

+29
-19
lines changed

7 files changed

+29
-19
lines changed

src/e2eIosTest/java/io/appium/java_client/ios/AppIOSTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.appium.java_client.ios;
22

3-
import io.appium.java_client.utils.TestUtils;
43
import io.appium.java_client.ios.options.XCUITestOptions;
4+
import io.appium.java_client.utils.TestUtils;
55
import org.junit.jupiter.api.BeforeAll;
66
import org.openqa.selenium.SessionNotCreatedException;
77

src/e2eIosTest/java/io/appium/java_client/ios/BaseIOSWebViewTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
package io.appium.java_client.ios;
1818

19-
import io.appium.java_client.utils.TestUtils;
2019
import io.appium.java_client.ios.options.XCUITestOptions;
20+
import io.appium.java_client.utils.TestUtils;
2121
import org.junit.jupiter.api.BeforeAll;
2222
import org.openqa.selenium.SessionNotCreatedException;
2323

src/e2eIosTest/java/io/appium/java_client/service/local/StartingAppLocallyIosTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
package io.appium.java_client.service.local;
1818

19-
import io.appium.java_client.utils.TestUtils;
2019
import io.appium.java_client.ios.BaseIOSTest;
2120
import io.appium.java_client.ios.IOSDriver;
2221
import io.appium.java_client.ios.options.XCUITestOptions;
2322
import io.appium.java_client.remote.AutomationName;
2423
import io.appium.java_client.remote.MobilePlatform;
2524
import io.appium.java_client.service.local.flags.GeneralServerFlag;
25+
import io.appium.java_client.utils.TestUtils;
2626
import org.junit.jupiter.api.Test;
2727
import org.openqa.selenium.Capabilities;
2828
import org.openqa.selenium.Platform;

src/test/java/io/appium/java_client/pagefactory_tests/DesktopBrowserCompatibilityTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
package io.appium.java_client.pagefactory_tests;
1818

19-
import io.appium.java_client.utils.TestUtils;
2019
import io.appium.java_client.android.AndroidDriver;
2120
import io.appium.java_client.pagefactory.AndroidFindBy;
2221
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
2322
import io.appium.java_client.pagefactory.HowToUseLocators;
2423
import io.appium.java_client.pagefactory.Widget;
2524
import io.appium.java_client.pagefactory.iOSXCUITFindBy;
25+
import io.appium.java_client.utils.TestUtils;
2626
import org.junit.jupiter.api.BeforeAll;
2727
import org.junit.jupiter.api.Test;
2828
import org.openqa.selenium.WebDriver;

src/test/java/io/appium/java_client/plugin/StorageTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
package io.appium.java_client.plugin;
1818

19-
import io.appium.java_client.utils.TestUtils;
2019
import io.appium.java_client.plugins.storage.StorageClient;
20+
import io.appium.java_client.utils.TestUtils;
2121
import org.junit.jupiter.api.Assumptions;
2222
import org.junit.jupiter.api.BeforeEach;
2323
import org.junit.jupiter.api.Test;

src/test/java/io/appium/java_client/utils/GitHubReleaseFetcher.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
import java.util.regex.Matcher;
3333
import java.util.regex.Pattern;
3434

35-
/**
36-
* Generic utility class for fetching files from GitHub releases with ETag-based caching.
37-
*/
3835
public class GitHubReleaseFetcher {
3936

4037
private static final HttpClient HTTP_CLIENT = HttpClient.newBuilder()
@@ -58,6 +55,11 @@ public class GitHubReleaseFetcher {
5855
private final Path appFile;
5956
private final Path etagFile;
6057

58+
/**
59+
* Generic utility class for fetching files from GitHub releases with ETag-based caching.
60+
*
61+
* @param releaseUrl The URL to the GitHub release to fetch.
62+
*/
6163
public GitHubReleaseFetcher(String releaseUrl) {
6264
this.releaseUrl = releaseUrl;
6365
this.releaseInfo = parseGitHubReleaseUrl(releaseUrl);
@@ -186,15 +188,20 @@ private Path fetchRemoteFile() throws IOException, InterruptedException {
186188
}
187189
}
188190

189-
/**
190-
* Information about a GitHub release parsed from URL.
191-
*/
192191
public static class GitHubReleaseInfo {
193192
public final String owner;
194193
public final String repo;
195194
public final String tag;
196195
public final String filename;
197196

197+
/**
198+
* Information about a GitHub release parsed from URL.
199+
*
200+
* @param owner project owner.
201+
* @param repo repo name.
202+
* @param tag project tag.
203+
* @param filename filename string.
204+
*/
198205
public GitHubReleaseInfo(String owner, String repo, String tag, String filename) {
199206
this.owner = owner;
200207
this.repo = repo;

src/test/java/io/appium/java_client/utils/GitHubReleaseFetcherTest.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
package io.appium.java_client.utils;
1818

19-
import org.junit.jupiter.api.Test;
20-
import org.junit.jupiter.api.BeforeEach;
2119
import org.junit.jupiter.api.AfterEach;
20+
import org.junit.jupiter.api.BeforeEach;
21+
import org.junit.jupiter.api.Test;
2222

2323
import java.io.IOException;
2424
import java.nio.file.Files;
@@ -124,8 +124,11 @@ public void testETagIsFetchedAndStored() throws IOException {
124124

125125
// Verify ETag file was created
126126
Path cacheDir = appPath.getParent();
127-
String[] etagFiles = cacheDir.toFile().list((dir, name) ->
128-
name.contains("appium_VodQAReactNative_v1.0.1_VodQAReactNative-simulator-release.zip") && name.endsWith(".etag"));
127+
String[] etagFiles = cacheDir.toFile().list(
128+
(dir, name) ->
129+
name.contains("appium_VodQAReactNative_v1.0.1_VodQAReactNative-simulator-release.zip")
130+
&& name.endsWith(".etag")
131+
);
129132
assertNotNull(etagFiles);
130133
assertTrue(etagFiles.length > 0);
131134

@@ -140,17 +143,17 @@ public void testETagIsFetchedAndStored() throws IOException {
140143
@Test
141144
public void testSecondFetchUsesCache() throws IOException {
142145
// First fetch - should download from remote
143-
long startTime1 = System.currentTimeMillis();
146+
final long startTime1 = System.currentTimeMillis();
144147
Path appPath1 = fetcher.fetch();
145-
long fetchTime1 = System.currentTimeMillis() - startTime1;
148+
final long fetchTime1 = System.currentTimeMillis() - startTime1;
146149

147150
assertTrue(Files.exists(appPath1));
148151
assertTrue(Files.size(appPath1) > 0);
149152

150153
// Second fetch - should use cache (much faster)
151-
long startTime2 = System.currentTimeMillis();
154+
final long startTime2 = System.currentTimeMillis();
152155
Path appPath2 = fetcher.fetch();
153-
long fetchTime2 = System.currentTimeMillis() - startTime2;
156+
final long fetchTime2 = System.currentTimeMillis() - startTime2;
154157

155158
// Verify same file path is returned
156159
assertEquals(appPath1, appPath2);

0 commit comments

Comments
 (0)