Gradle Build / build (pull_request) Failing after 6s
- Register pending requests before sending so fast responses aren't lost - Fail pending requests with SessionClosedException when the connection closes or errors, and add onClose(), isOpen() and a request overload with a timeout - Serialize text sends: java.net.http.WebSocket allows only one outstanding send, so concurrent requests could throw - Reassemble text messages delivered in parts before parsing - Complete error responses with SessionErrorException carrying the payload - Answer requests for unknown methods with an error response - Fix SessionResult.error() producing success responses - Fix close() using invalid close code 0; send 1000 - Publish as dev.selimaj:session-java to the Gitea package registry; make Jackson an api dependency and drop unused Tyrus/Jakarta deps - Replace the empty test with 9 tests against an in-process server Fixes #1 Co-Authored-By: Claude Opus 5.5 <[email protected]>
60 lines
1.5 KiB
Groovy
60 lines
1.5 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
id 'maven-publish'
|
|
}
|
|
|
|
group = "dev.selimaj"
|
|
version = "0.2.0"
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(17)
|
|
}
|
|
withSourcesJar()
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
// JSON parsing and serialization; JsonNode is part of the public API.
|
|
api 'com.fasterxml.jackson.core:jackson-databind:2.17.0'
|
|
api 'com.fasterxml.jackson.core:jackson-annotations:2.17.0'
|
|
api 'com.fasterxml.jackson.core:jackson-core:2.17.0'
|
|
|
|
// For testing: a real WebSocket server for the client to talk to.
|
|
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0'
|
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
|
testImplementation 'org.java-websocket:Java-WebSocket:1.6.0'
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
artifactId = 'session-java'
|
|
from components.java
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
// Gitea package registry. Publish with a token that has package:write:
|
|
// GITEA_TOKEN=... ./gradlew publish
|
|
maven {
|
|
name = 'Gitea'
|
|
url = uri('https://git.selimaj.dev/api/packages/selimaj-dev/maven')
|
|
credentials(HttpHeaderCredentials) {
|
|
name = 'Authorization'
|
|
value = "token ${findProperty('giteaToken') ?: System.getenv('GITEA_TOKEN') ?: ''}"
|
|
}
|
|
authentication {
|
|
header(HttpHeaderAuthentication)
|
|
}
|
|
}
|
|
}
|
|
}
|