chiradip commented on code in PR #2213: URL: https://github.com/apache/iggy/pull/2213#discussion_r2400436905
########## foreign/java/BUILD_AND_TEST.md: ########## @@ -0,0 +1,320 @@ +# Apache Iggy Java SDK - Build and Test Guide + +## Overview + +This document provides comprehensive instructions for building and testing the +Apache Iggy Java SDK, including the new async client implementation with fixed +polling functionality. + +## Prerequisites + +### Required Software + +- **Java**: JDK 17 or higher +- **Gradle**: Version 8.3+ (included via wrapper) +- **Iggy Server**: Running instance on localhost:8090 +- **Git**: For version control + +### Starting the Iggy Server + +```bash +# Navigate to Iggy server directory +cd /path/to/iggy + +# Start server with default credentials +cargo run --bin iggy-server -- --with-default-root-credentials +``` + +The server should be running on `127.0.0.1:8090` with default credentials: + +- Username: `iggy` +- Password: `iggy` + +## Project Structure + +```bash +iggy/foreign/java/ +├── java-sdk/ # Main SDK implementation +│ ├── src/ +│ │ ├── main/ # Source code +│ │ │ └── java/org/apache/iggy/ +│ │ │ ├── client/ +│ │ │ │ ├── async/ # Async client implementation +│ │ │ │ └── blocking/ # Blocking client implementation +│ │ │ └── ... +│ │ └── test/ # Test code +│ │ └── java/org/apache/iggy/client/async/ +│ │ └── AsyncPollMessageTest.java # test for polling fn +│ └── build.gradle +├── examples/ # Example applications +└── gradlew # Gradle wrapper +``` + +## Building the Project + +### 1. Clean Build + +```bash +cd iggy/foreign/java/java-sdk + +# Clean previous builds +../gradlew clean + +# Build without running tests +../gradlew build -x test + +# Or build with tests (skip checkstyle) +../gradlew build -x checkstyleMain -x checkstyleTest +``` + +### 2. Compile Only + +```bash +# Compile main source code +../gradlew compileJava + +# Compile test code +../gradlew compileTestJava +``` + +## Running Tests + +### 1. Run All Tests + +```bash +# Run all tests (skip checkstyle) +../gradlew test -x checkstyleMain -x checkstyleTest +``` + +### 2. Run Specific Test Class + +```bash +# Run AsyncPollMessageTest specifically +../gradlew test --tests AsyncPollMessageTest -x checkstyleMain -x checkstyleTest + +# Run with detailed output +../gradlew test --tests AsyncPollMessageTest --info -x checkstyleMain -x checkstyleTest +``` + +### 3. Run Test Suite by Package + +```bash +# Run all async client tests +../gradlew test --tests "org.apache.iggy.client.async.*" -x checkstyleMain -x checkstyleTest +``` + +### 4. View Test Results + +Test reports are generated at: + +```bash +java-sdk/build/reports/tests/test/index.html +``` + +Open this file in a browser to view detailed test results. + +## Key Test: AsyncPollMessageTest Review Comment: Agree and redacted the part that could go out of sync at the top level. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
