Skip to content

Commit

Permalink
Fix compilation and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Oct 6, 2023
1 parent 4116b9c commit 1a7733d
Show file tree
Hide file tree
Showing 14 changed files with 7 additions and 155 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ jobs:
- name: End to End Integration Tests
uses: ./.github/actions/run-tests
with:
command:
- ./gradlew test -DincludeTags="EndToEndTest"
command: ./gradlew test -DincludeTags="EndToEndTest"

Upload-Test-Report:
needs:
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ edc-build-plugin = { module = "org.eclipse.edc.edc-build:org.eclipse.edc.edc-bui
edc-configuration-filesystem = { module = "org.eclipse.edc:configuration-filesystem", version.ref = "edc" }
edc-connector-core = { module = "org.eclipse.edc:connector-core", version.ref = "edc" }
edc-control-plane-api-client = { module = "org.eclipse.edc:control-plane-api-client", version.ref = "edc" }
edc-control-plane-api = { module = "org.eclipse.edc:control-plane-api", version.ref = "edc" }
edc-control-plane-core = { module = "org.eclipse.edc:control-plane-core", version.ref = "edc" }
edc-control-plane-spi = { module = "org.eclipse.edc:control-plane-spi", version.ref = "edc" }
edc-data-plane-api = { module = "org.eclipse.edc:data-plane-api", version.ref = "edc" }
Expand Down
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ include(":basic:basic-03-configuration")
include(":transfer:transfer-01-file-transfer:file-transfer-consumer")
include(":transfer:transfer-01-file-transfer:file-transfer-provider")
include(":transfer:transfer-01-file-transfer:transfer-file-local")
include(":transfer:transfer-01-file-transfer:status-checker")

include(":transfer:transfer-02-file-transfer-listener:file-transfer-listener-consumer")
include(":transfer:transfer-02-file-transfer-listener:listener")
Expand Down
7 changes: 0 additions & 7 deletions transfer/transfer-01-file-transfer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,6 @@ authentication. Therefore, we add the property `edc.api.auth.key` and set it to
to configure the consumer's webhook address. We expose the DSP API endpoints on a different port and path than other
endpoints, so the property `edc.dsp.callback.address` is adjusted to match the DSP API port.

The consumer connector also needs the `status-checker` extension for marking the transfer as completed on the consumer
side.

```kotlin
implementation(project(":transfer:transfer-01-file-transfer:status-checker"))
```

## Run the sample

Running this sample consists of multiple steps, that are executed one by one.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ dependencies {

implementation(libs.edc.dsp)

implementation(project(":transfer:transfer-01-file-transfer:status-checker"))

}

application {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ plugins {

dependencies {
implementation(libs.edc.control.plane.api.client)
implementation(libs.edc.control.plane.api)
implementation(libs.edc.control.plane.core)
implementation(libs.edc.data.plane.selector.core)
implementation(libs.edc.api.observability)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ web.http.management.port=8182
web.http.management.path=/management
web.http.protocol.port=8282
web.http.protocol.path=/protocol
web.http.control.port=8283
web.http.control.path=/control
edc.samples.transfer.01.asset.path=/path/to/file
edc.dsp.callback.address=http://localhost:8282/protocol
edc.participant.id=provider
edc.ids.id=urn:connector:provider
edc.control.endpoint=http://localhost:8283/control
21 changes: 0 additions & 21 deletions transfer/transfer-01-file-transfer/status-checker/build.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,17 @@
package org.eclipse.edc.sample.extension.listener;

import org.eclipse.edc.connector.transfer.spi.observe.TransferProcessObservable;
import org.eclipse.edc.connector.transfer.spi.status.StatusCheckerRegistry;
import org.eclipse.edc.connector.transfer.spi.types.ProvisionedResource;
import org.eclipse.edc.connector.transfer.spi.types.StatusChecker;
import org.eclipse.edc.connector.transfer.spi.types.TransferProcess;
import org.eclipse.edc.runtime.metamodel.annotation.Inject;
import org.eclipse.edc.spi.system.ServiceExtension;
import org.eclipse.edc.spi.system.ServiceExtensionContext;

import java.io.File;
import java.util.List;

public class TransferListenerExtension implements ServiceExtension {

@Inject
private StatusCheckerRegistry statusCheckerRegistry;

@Override
public void initialize(ServiceExtensionContext context) {
var transferProcessObservable = context.getService(TransferProcessObservable.class);
var monitor = context.getMonitor();

transferProcessObservable.registerListener(new MarkerFileCreator(monitor));
statusCheckerRegistry.register("File", new FileStatusChecker());
}

private static class FileStatusChecker implements StatusChecker {
@Override
public boolean isComplete(TransferProcess transferProcess, List<ProvisionedResource> resources) {
var path = transferProcess.getDataDestination().getStringProperty("path");
return path != null && new File(path).exists();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

package org.eclipse.edc.sample.extension.transfer;

import org.eclipse.edc.connector.transfer.spi.status.StatusCheckerRegistry;
import org.eclipse.edc.connector.transfer.spi.store.TransferProcessStore;
import org.eclipse.edc.connector.transfer.spi.types.DataRequest;
import org.eclipse.edc.connector.transfer.spi.types.ProvisionedDataDestinationResource;
Expand All @@ -37,15 +36,11 @@ public class TransferSimulationExtension implements ServiceExtension {
@Inject
private TransferProcessStore store;

@Inject
private StatusCheckerRegistry statusCheckerRegistry;

@Inject
private Clock clock;

@Override
public void initialize(ServiceExtensionContext context) {
statusCheckerRegistry.register(TEST_TYPE, (transferProcess, resources) -> false); //never completes
//Insert a test TP after a delay to simulate a zombie transfer
new Timer().schedule(
new TimerTask() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ dependencies {
implementation(libs.edc.management.api)
implementation(libs.edc.dsp)

implementation(project(":transfer:transfer-01-file-transfer:status-checker"))

runtimeOnly(libs.edc.jersey.micrometer)
runtimeOnly(libs.edc.jetty.micrometer)
runtimeOnly(libs.edc.monitor.jdk.logger)
Expand Down Expand Up @@ -74,4 +72,4 @@ tasks.register("copyOpenTelemetryJar") {

tasks.compileJava {
finalizedBy("copyOpenTelemetryJar")
}
}

0 comments on commit 1a7733d

Please sign in to comment.