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

fix (build): Comment out Connector, to avoid (supposed) Dependency Cycle #641

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions java/dev/enola/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ junit_tests(
"@maven//:org_slf4j_slf4j_simple",
],
deps = [
"//connectors/demo",
"//connectors/demo:demo_java_proto",
# "//connectors/demo",
# "//connectors/demo:demo_java_proto",
"//java/dev/enola/common/concurrent",
"//java/dev/enola/common/convert",
"//java/dev/enola/common/io",
Expand Down
46 changes: 23 additions & 23 deletions java/dev/enola/core/EntityServiceProviderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
import com.google.protobuf.InvalidProtocolBufferException;

import dev.enola.common.convert.ConversionException;
import dev.enola.common.io.resource.ClasspathResource;
import dev.enola.common.io.resource.FileResource;
import dev.enola.common.io.resource.ReplacingResource;
import dev.enola.common.protobuf.ValidationException;
import dev.enola.core.meta.EntityKindRepository;
import dev.enola.core.meta.proto.Connector;
Expand All @@ -41,7 +39,7 @@
import dev.enola.core.proto.GetThingRequest;
import dev.enola.core.proto.ID;
import dev.enola.core.proto.ListEntitiesRequest;
import dev.enola.demo.Server;
// import dev.enola.demo.Server;

import org.junit.Test;

Expand Down Expand Up @@ -151,26 +149,28 @@ public void testEntityValidation() throws ValidationException, EnolaException {
assertThrows(ConversionException.class, () -> service.getThing(request));
}

@Test
public void testGrpcConnector() throws IOException, ValidationException, EnolaException {
try (var server = new Server()) {
server.start(0);
var port = Integer.toString(server.getPort());
var model =
new ReplacingResource(
new ClasspathResource("demo-connector-model.textproto"), "9090", port);
var ekr = new EntityKindRepository().load(model);
var service = new EnolaServiceProvider(ekr).getEnolaService();

var eid = ID.newBuilder().setNs("demo").setEntity("foo").addPaths("whatever").build();
var eri = IDs.toPath(eid);
var request = GetThingRequest.newBuilder().setIri(eri).build();
var response = service.getThing(request);
var thing = response.getThing();
var entity = thing.unpack(Entity.class);
assertThat(entity.getLinkOrThrow("link1")).isEqualTo("http://www.vorburger.ch");
}
}
// @Test
// public void testGrpcConnector() throws IOException, ValidationException, EnolaException {
// try (var server = new Server()) {
// server.start(0);
// var port = Integer.toString(server.getPort());
// var model =
// new ReplacingResource(
// new ClasspathResource("demo-connector-model.textproto"), "9090",
// port);
// var ekr = new EntityKindRepository().load(model);
// var service = new EnolaServiceProvider(ekr).getEnolaService();

// var eid =
// ID.newBuilder().setNs("demo").setEntity("foo").addPaths("whatever").build();
// var eri = IDs.toPath(eid);
// var request = GetThingRequest.newBuilder().setIri(eri).build();
// var response = service.getThing(request);
// var thing = response.getThing();
// var entity = thing.unpack(Entity.class);
// assertThat(entity.getLinkOrThrow("link1")).isEqualTo("http://www.vorburger.ch");
// }
// }

@Test
public void testEntityKindInception()
Expand Down
Loading