Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Dec 20, 2024
1 parent 2244764 commit 44a96d0
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 43 deletions.
2 changes: 1 addition & 1 deletion backend/runner/pubsub/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestRetry(t *testing.T) {
checkConsumed("subscriber", "consumeButFailAndRetry", false, retriesPerCall+1, optional.Some("secondCall")),
checkPublished("subscriber", "consumeButFailAndRetryFailed", 2),

in.IfLanguage("go", checkConsumed("subscriber", "consumeFromDeadLetter", true, 2, optional.None[string]())),
checkConsumed("subscriber", "consumeFromDeadLetter", true, 2, optional.None[string]()),
)
}

Expand Down
6 changes: 6 additions & 0 deletions jvm-runtime/jvm_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ func TestJVMCoreFunctionality(t *testing.T) {
})
})...)
tests = append(tests, AllRuntimesVerbTest("testObjectVerb", exampleObject)...)
tests = append(tests, AllRuntimesVerbTest("testGenericType", FailedEvent[TestObject]{Event: exampleObject, Error: "failed"})...)
tests = append(tests, AllRuntimesVerbTest("testObjectOptionalFieldsVerb", exampleOptionalFieldsObject)...)
tests = append(tests, AllRuntimesVerbTest("objectMapVerb", map[string]TestObject{"hello": exampleObject})...)
tests = append(tests, AllRuntimesVerbTest("objectArrayVerb", []TestObject{exampleObject})...)
Expand Down Expand Up @@ -480,3 +481,8 @@ type Thing struct{}

func (Word) tag() {}
func (Thing) tag() {}

type FailedEvent[Event any] struct {
Event Event `json:"event"`
Error string `json:"error"`
}
7 changes: 7 additions & 0 deletions jvm-runtime/testdata/go/gomodule/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"fmt"
"time"

"ftl/builtin"

"github.com/decentralized-identity/web5-go/dids/did"

"github.com/block/ftl/go-runtime/ftl"
Expand Down Expand Up @@ -219,6 +221,11 @@ func TestObjectVerb(ctx context.Context, val TestObject) (TestObject, error) {
return val, nil
}

//ftl:verb export
func TestGenericType(ctx context.Context, val builtin.FailedEvent[TestObject]) (builtin.FailedEvent[TestObject], error) {
return val, nil
}

//ftl:verb export
func TestObjectOptionalFieldsVerb(ctx context.Context, val TestObjectOptionalFields) (TestObjectOptionalFields, error) {
return val, nil
Expand Down
8 changes: 7 additions & 1 deletion jvm-runtime/testdata/go/gomodule/types.ftl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,8 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import ftl.gomodule.AnimalWrapper;
import ftl.gomodule.BoolVerbClient;
import ftl.gomodule.BytesVerbClient;
import ftl.gomodule.ColorWrapper;
import ftl.gomodule.EmptyVerbClient;
import ftl.gomodule.ErrorEmptyVerbClient;
import ftl.gomodule.ExternalTypeVerbClient;
import ftl.gomodule.FloatVerbClient;
import ftl.gomodule.IntVerbClient;
import ftl.gomodule.ObjectArrayVerbClient;
import ftl.gomodule.ObjectMapVerbClient;
import ftl.gomodule.OptionalBoolVerbClient;
import ftl.gomodule.OptionalBytesVerbClient;
import ftl.gomodule.OptionalFloatVerbClient;
import ftl.gomodule.OptionalIntVerbClient;
import ftl.gomodule.OptionalStringArrayVerbClient;
import ftl.gomodule.OptionalStringMapVerbClient;
import ftl.gomodule.OptionalStringVerbClient;
import ftl.gomodule.OptionalTestObjectOptionalFieldsVerbClient;
import ftl.gomodule.OptionalTestObjectVerbClient;
import ftl.gomodule.OptionalTimeVerbClient;
import ftl.gomodule.ParameterizedObjectVerbClient;
import ftl.gomodule.ParameterizedType;
import ftl.gomodule.Scalar;
import ftl.gomodule.ShapeWrapper;
import ftl.gomodule.SinkVerbClient;
import ftl.gomodule.SourceVerbClient;
import ftl.gomodule.StringArrayVerbClient;
import ftl.gomodule.StringEnumVerbClient;
import ftl.gomodule.StringList;
import ftl.gomodule.StringMapVerbClient;
import ftl.gomodule.StringVerbClient;
import ftl.gomodule.TestObject;
import ftl.gomodule.TestObjectOptionalFields;
import ftl.gomodule.TestObjectOptionalFieldsVerbClient;
import ftl.gomodule.TestObjectVerbClient;
import ftl.gomodule.TimeVerbClient;
import ftl.gomodule.TypeEnumVerbClient;
import ftl.gomodule.TypeEnumWrapper;
import ftl.gomodule.TypeWrapperEnumVerbClient;
import ftl.gomodule.ValueEnumVerbClient;
import ftl.builtin.FailedEvent;
import ftl.gomodule.*;
import web5.sdk.dids.didcore.Did;
import xyz.block.ftl.Export;
import xyz.block.ftl.Verb;
Expand Down Expand Up @@ -154,6 +115,13 @@ public boolean boolVerb(boolean val, BoolVerbClient client) {
return client.testObjectVerb(val);
}

@Export
@Verb
public @NotNull FailedEvent<TestObject> testGenericType(@NotNull FailedEvent<TestObject> val,
TestGenericTypeClient client) {
return client.testGenericType(val);
}

@Export
@Verb
public @NotNull TestObjectOptionalFields testObjectOptionalFieldsVerb(@NotNull TestObjectOptionalFields val,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package xyz.block.ftl.test

import ftl.builtin.FailedEvent
import ftl.gomodule.*
import web5.sdk.dids.didcore.Did
import xyz.block.ftl.Export
Expand Down Expand Up @@ -117,6 +118,12 @@ fun testObjectOptionalFieldsVerb(
return client.testObjectOptionalFieldsVerb(payload)
}

@Export
@Verb
fun testGenericType(payload: FailedEvent<TestObject>, client: TestGenericTypeClient): FailedEvent<TestObject> {
return client.testGenericType(payload)
}

// now the same again but with option return / input types
@Export
@Verb
Expand Down

0 comments on commit 44a96d0

Please sign in to comment.