Skip to content

Commit

Permalink
feat: add streaming http-to-http sample
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Aug 30, 2023
1 parent 674acf7 commit 937a2b1
Show file tree
Hide file tree
Showing 36 changed files with 1,050 additions and 17 deletions.
2 changes: 1 addition & 1 deletion basic/basic-01-basic-connector/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
plugins {
`java-library`
id("application")
id("com.github.johnrengelman.shadow") version "8.1.1"
alias(libs.plugins.shadow)
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion basic/basic-02-health-endpoint/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
plugins {
`java-library`
id("application")
id("com.github.johnrengelman.shadow") version "8.1.1"
alias(libs.plugins.shadow)
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion basic/basic-03-configuration/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
plugins {
`java-library`
id("application")
id("com.github.johnrengelman.shadow") version "8.1.1"
alias(libs.plugins.shadow)
}

dependencies {
Expand Down
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ edc = "0.2.1"
jakarta-json = "2.0.1"
junit-pioneer = "2.0.1"
jupiter = "5.10.0"
okhttp-mockwebserver = "5.0.0-alpha.11"
openTelemetry = "1.18.0"
restAssured = "5.3.1"
rsApi = "3.1.0"
Expand Down Expand Up @@ -40,6 +41,7 @@ edc-http = { module = "org.eclipse.edc:http", version.ref = "edc" }
edc-iam-mock = { module = "org.eclipse.edc:iam-mock", version.ref = "edc" }
edc-jersey-micrometer = { module = "org.eclipse.edc:jersey-micrometer", version.ref = "edc" }
edc-jetty-micrometer = { module = "org.eclipse.edc:jetty-micrometer", version.ref = "edc" }
edc-json-ld = { module = "org.eclipse.edc:json-ld", version.ref = "edc" }
edc-junit = { module = "org.eclipse.edc:junit", version.ref = "edc" }
edc-management-api = { module = "org.eclipse.edc:management-api", version.ref = "edc" }
edc-micrometer-core = { module = "org.eclipse.edc:micrometer-core", version.ref = "edc" }
Expand All @@ -59,6 +61,7 @@ junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.re
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "jupiter" }
junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "jupiter" }
junit-pioneer = { module = "org.junit-pioneer:junit-pioneer", version.ref = "junit-pioneer" }
okhttp-mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp-mockwebserver" }
opentelemetry-annotations = { module = "io.opentelemetry:opentelemetry-extension-annotations", version.ref = "openTelemetry" }
restAssured = { module = "io.rest-assured:rest-assured", version.ref = "restAssured" }

Expand Down
2 changes: 1 addition & 1 deletion other/custom-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
plugins {
`java-library`
id("application")
id("com.github.johnrengelman.shadow") version "8.1.1"
alias(libs.plugins.shadow)
}

dependencies {
Expand Down
3 changes: 3 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ include("transfer:transfer-06-consumer-pull-http:consumer-pull-backend-service")
include("transfer:transfer-07-provider-push-http:http-push-connector")
include("transfer:transfer-07-provider-push-http:provider-push-http-backend-service")

include("transfer:streaming:streaming-01-http-to-http:streaming-01-runtime")


// modules for code samples ------------------------------------------------------------------------
include(":other:custom-runtime")

Expand Down
5 changes: 4 additions & 1 deletion system-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ plugins {
}

dependencies {
implementation(libs.edc.junit)
implementation(libs.edc.transfer.spi)

testImplementation(libs.edc.junit)
testImplementation(libs.edc.json.ld)
testImplementation(libs.awaitility)
testImplementation(libs.okhttp.mockwebserver)
testImplementation(libs.restAssured)

// runtimes
Expand All @@ -31,4 +33,5 @@ dependencies {
testCompileOnly(project(":transfer:transfer-01-file-transfer:file-transfer-provider"))
testCompileOnly(project(":transfer:transfer-02-file-transfer-listener:file-transfer-listener-consumer"))
testCompileOnly(project(":transfer:transfer-03-modify-transferprocess:modify-transferprocess-consumer"))
testCompileOnly(project(":transfer:streaming:streaming-01-http-to-http:streaming-01-runtime"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.Duration;
import java.util.Map;

Expand All @@ -36,7 +37,7 @@
import static org.hamcrest.Matchers.not;

/**
* Encapsulates common settings, test steps, and helper methods for the test for samples 4.x.
* Encapsulates common settings, test steps, and helper methods for transfer samples
*/
public class FileTransferSampleTestCommon {

Expand Down Expand Up @@ -78,6 +79,19 @@ public static File getFileFromRelativePath(String relativePath) {
return new File(TestUtils.findBuildRoot(), relativePath);
}

/**
* Resolves a {@link File} instance from a relative path.
*/
@NotNull
public static String getFileContentFromRelativePath(String relativePath) {
var fileFromRelativePath = getFileFromRelativePath(relativePath);
try {
return Files.readString(Paths.get(fileFromRelativePath.toURI()));
} catch (IOException e) {
throw new RuntimeException(e);
}
}

/**
* Assert that prerequisites are fulfilled before running the test.
* This assertion checks only whether the file to be copied is not existing already.
Expand Down
Loading

0 comments on commit 937a2b1

Please sign in to comment.