From 0705e247de129cef39cb6dca74e76bb452789996 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Tue, 16 Apr 2024 02:51:40 +0200 Subject: [PATCH] fix (build): Comment out Connector, to avoid (supposed) Dependency Cycle (see #431) This works around (by disabling) https://github.com/enola-dev/enola/issues/431, but it does not fix https://github.com/salesforce/bazel-vscode-java/issues/114. --- connectors/demo/{BUILD => BUILD.disabled} | 0 connectors/k8s/{BUILD => BUILD.disabled} | 0 java/dev/enola/core/BUILD | 4 +- .../enola/core/EntityServiceProviderTest.java | 46 +++++++++---------- 4 files changed, 25 insertions(+), 25 deletions(-) rename connectors/demo/{BUILD => BUILD.disabled} (100%) rename connectors/k8s/{BUILD => BUILD.disabled} (100%) diff --git a/connectors/demo/BUILD b/connectors/demo/BUILD.disabled similarity index 100% rename from connectors/demo/BUILD rename to connectors/demo/BUILD.disabled diff --git a/connectors/k8s/BUILD b/connectors/k8s/BUILD.disabled similarity index 100% rename from connectors/k8s/BUILD rename to connectors/k8s/BUILD.disabled diff --git a/java/dev/enola/core/BUILD b/java/dev/enola/core/BUILD index 261797d88..bd92a6f7a 100644 --- a/java/dev/enola/core/BUILD +++ b/java/dev/enola/core/BUILD @@ -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", diff --git a/java/dev/enola/core/EntityServiceProviderTest.java b/java/dev/enola/core/EntityServiceProviderTest.java index 8bf5320be..d6880af39 100644 --- a/java/dev/enola/core/EntityServiceProviderTest.java +++ b/java/dev/enola/core/EntityServiceProviderTest.java @@ -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; @@ -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; @@ -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()