Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Javadoc documentation to project #18

Merged
merged 6 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/main/java/io/github/lambdatest/gradle/AppUploader.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import org.apache.logging.log4j.Logger;

/**
* Handles the asynchronous upload of application files to the LambdaTest platform.
* This class manages the upload process and returns the application ID for test execution.
* Handles the asynchronous upload of application files to the LambdaTest platform. This class
* manages the upload process and returns the application ID for test execution.
*
* <p>Uses {@link UploaderUtil#uploadAndGetId(String, String, String)} for the actual file upload process.</p>
* <p>Uses {@link UploaderUtil#uploadAndGetId(String, String, String)} for the actual file upload
* process.
*/
public class AppUploader {

Expand Down Expand Up @@ -40,8 +41,8 @@ public AppUploader(String username, String accessKey, String appFilePath) {
* Uploads the application file asynchronously to LambdaTest.
*
* @return A CompletableFuture that resolves to the uploaded application's ID
* @implNote Uses CompletableFuture to perform the upload asynchronously, allowing
* parallel processing of other tasks
* @implNote Uses CompletableFuture to perform the upload asynchronously, allowing parallel
* processing of other tasks
*/
public CompletableFuture<String> uploadAppAsync() {
return CompletableFuture.supplyAsync(
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/io/github/lambdatest/gradle/Constants.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package io.github.lambdatest.gradle;

/**
* Constants used throughout the LambdaTest Gradle plugin.
* This utility class provides centralized access to API endpoints and other constant values.
* Constants used throughout the LambdaTest Gradle plugin. This utility class provides centralized
* access to API endpoints and other constant values.
*/
public class Constants {
/**
* Private constructor to prevent instantiation of this utility class.
*/
/** Private constructor to prevent instantiation of this utility class. */
private Constants() {
throw new UnsupportedOperationException(
"This is a utility class and cannot be instantiated");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import org.gradle.api.Project;

/**
* The main plugin class that integrates LambdaTest functionality into the Gradle build system.
* This plugin adds the 'runLambdaTest' task to the project's task container.
* The main plugin class that integrates LambdaTest functionality into the Gradle build system. This
* plugin adds the 'runLambdaTest' task to the project's task container.
*/
public class LambdaTestPlugin implements Plugin<Project> {

Expand Down
18 changes: 9 additions & 9 deletions src/main/java/io/github/lambdatest/gradle/LambdaTestTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
import org.gradle.api.tasks.TaskAction;

/**
* Main task class for the LambdaTest Gradle plugin that handles test execution on the LambdaTest platform.
* This task manages the upload of applications and test suites, followed by test execution with specified configurations.
* Main task class for the LambdaTest Gradle plugin that handles test execution on the LambdaTest
* platform. This task manages the upload of applications and test suites, followed by test
* execution with specified configurations.
*
* <p>This task coordinates between {@link AppUploader}, {@link TestSuiteUploader}, and {@link TestExecutor}
* to manage the complete test execution lifecycle.</p>
* <p>This task coordinates between {@link AppUploader}, {@link TestSuiteUploader}, and {@link
* TestExecutor} to manage the complete test execution lifecycle.
*/
public class LambdaTestTask extends DefaultTask {

Expand Down Expand Up @@ -49,11 +50,10 @@ public class LambdaTestTask extends DefaultTask {
* Executes the LambdaTest task, which includes uploading the application and test suite,
* followed by test execution on the LambdaTest platform.
*
* @implNote This method handles the task execution in three main phases:
* 1. Asynchronous upload of the application using {@link AppUploader#uploadAppAsync()}
* 2. Asynchronous upload of the test suite using {@link TestSuiteUploader#uploadTestSuiteAsync()}
* 3. Test execution with {@link TestExecutor#executeTests(Map)}
*
* @implNote This method handles the task execution in three main phases: 1. Asynchronous upload
* of the application using {@link AppUploader#uploadAppAsync()} 2. Asynchronous upload of
* the test suite using {@link TestSuiteUploader#uploadTestSuiteAsync()} 3. Test execution
* with {@link TestExecutor#executeTests(Map)}
* @throws RuntimeException if any upload or test execution fails
*/
@TaskAction
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/io/github/lambdatest/gradle/TestExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import org.apache.logging.log4j.Logger;

/**
* Manages the execution of tests on the LambdaTest platform.
* This class handles the test execution configuration and communication with the LambdaTest API.
* Manages the execution of tests on the LambdaTest platform. This class handles the test execution
* configuration and communication with the LambdaTest API.
*
* <p>Uses endpoints defined in {@link Constants} for API communication.</p>
* <p>Uses endpoints defined in {@link Constants} for API communication.
*/
public class TestExecutor {
private static final Logger logger = LogManager.getLogger(TestExecutor.class);
Expand Down Expand Up @@ -55,9 +55,9 @@ public TestExecutor(
*
* @param params Map of additional test execution parameters
* @throws IOException if there's an error in communication with the LambdaTest API
* @implNote This method constructs the test capabilities and sends them to either
* {@link Constants#BUILD_URL} or {@link Constants#FLUTTER_BUILD_URL}
* based on whether it's a Flutter or standard application
* @implNote This method constructs the test capabilities and sends them to either {@link
* Constants#BUILD_URL} or {@link Constants#FLUTTER_BUILD_URL} based on whether it's a
* Flutter or standard application
*/
public void executeTests(Map<String, String> params) throws IOException {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import org.apache.logging.log4j.Logger;

/**
* Handles the asynchronous upload of test suite files to the LambdaTest platform.
* This class manages the upload process and returns the test suite ID for test execution.
* Handles the asynchronous upload of test suite files to the LambdaTest platform. This class
* manages the upload process and returns the test suite ID for test execution.
*/
public class TestSuiteUploader {

Expand All @@ -34,8 +34,8 @@ public TestSuiteUploader(String username, String accessKey, String testSuiteFile
* Uploads the test suite file asynchronously to LambdaTest.
*
* @return A CompletableFuture that resolves to the uploaded test suite's ID
* @implNote Uses CompletableFuture to perform the upload asynchronously, allowing
* parallel processing of other tasks
* @implNote Uses CompletableFuture to perform the upload asynchronously, allowing parallel
* processing of other tasks
*/
public CompletableFuture<String> uploadTestSuiteAsync() {
return CompletableFuture.supplyAsync(
Expand Down
16 changes: 7 additions & 9 deletions src/main/java/io/github/lambdatest/gradle/UploaderUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@
import okhttp3.Response;

/**
* Utility class providing common upload functionality for the LambdaTest Gradle plugin.
* This class handles the actual file upload process and response parsing.
* Utility class providing common upload functionality for the LambdaTest Gradle plugin. This class
* handles the actual file upload process and response parsing.
*
* <p>This utility is used by both {@link AppUploader} and {@link TestSuiteUploader}
* to handle file uploads to the LambdaTest platform.</p>
* <p>This utility is used by both {@link AppUploader} and {@link TestSuiteUploader} to handle file
* uploads to the LambdaTest platform.
*/
public final class UploaderUtil {
/**
* Private constructor to prevent instantiation of this utility class.
*/
/** Private constructor to prevent instantiation of this utility class. */
private UploaderUtil() {
throw new UnsupportedOperationException(
"This is a utility class and cannot be instantiated");
Expand All @@ -36,8 +34,8 @@ private UploaderUtil() {
* @param filePath The path to the file to be uploaded
* @return The ID of the uploaded file
* @throws IOException if there's an error during file upload or response parsing
* @implNote This method sends the file to {@link Constants#API_URL} and handles
* the multipart form data construction and response parsing
* @implNote This method sends the file to {@link Constants#API_URL} and handles the multipart
* form data construction and response parsing
*/
public static String uploadAndGetId(String username, String accessKey, String filePath)
throws IOException {
Expand Down
Loading