mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-08-31 10:48:59 +00:00
add id getter for processors
This commit is contained in:
@@ -17,6 +17,7 @@ func TestArtnetPacketDecodeFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "artnet.packet.decode",
|
||||
})
|
||||
|
||||
@@ -24,6 +25,10 @@ func TestArtnetPacketDecodeFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create artnet.packet.decode processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("artnet.packet.decode processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "artnet.packet.decode" {
|
||||
t.Fatalf("artnet.packet.decode processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestArtnetPacketEncodeFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "artnet.packet.encode",
|
||||
})
|
||||
|
||||
@@ -24,6 +25,10 @@ func TestArtnetPacketEncodeFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create artnet.packet.encode processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("artnet.packet.encode processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "artnet.packet.encode" {
|
||||
t.Fatalf("artnet.packet.encode processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ func TestDbQueryFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "db.query",
|
||||
Params: map[string]any{
|
||||
"module": "test",
|
||||
@@ -28,6 +29,10 @@ func TestDbQueryFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create db.query processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("db.query processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "db.query" {
|
||||
t.Fatalf("db.query processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ func TestDebugLogFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "debug.log",
|
||||
})
|
||||
|
||||
@@ -23,6 +24,10 @@ func TestDebugLogFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create debug.log processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("debug.log processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "debug.log" {
|
||||
t.Fatalf("debug.log processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -16,12 +16,17 @@ func TestFilterChangeFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "filter.change",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create filter.change processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("filter.change processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "filter.change" {
|
||||
t.Fatalf("filter.change processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ func TestFilterExprFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "filter.expr",
|
||||
Params: map[string]any{
|
||||
"expression": "foo + bar",
|
||||
@@ -25,6 +26,10 @@ func TestFilterExprFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create filter.expr processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("filter.expr processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "filter.expr" {
|
||||
t.Fatalf("filter.expr processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ func TestFilterRateFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "filter.rate",
|
||||
Params: map[string]any{
|
||||
"rate": 1,
|
||||
@@ -25,6 +26,10 @@ func TestFilterRateFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create filter.rate processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("filter.rate processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "filter.rate" {
|
||||
t.Fatalf("filter.rate processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ func TestFilterRegexFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "filter.regex",
|
||||
Params: map[string]any{
|
||||
"pattern": "hello",
|
||||
@@ -25,6 +26,10 @@ func TestFilterRegexFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create filter.regex processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("filter.regex processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "filter.regex" {
|
||||
t.Fatalf("filter.regex processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ func TestFloatParseFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "float.parse",
|
||||
})
|
||||
|
||||
@@ -23,6 +24,9 @@ func TestFloatParseFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create float.parse processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("float.parse processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
if processorInstance.Type() != "float.parse" {
|
||||
t.Fatalf("float.parse processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ func TestFloatRandomFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "float.random",
|
||||
Params: map[string]any{
|
||||
"min": 1.0,
|
||||
@@ -26,6 +27,10 @@ func TestFloatRandomFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create float.random processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("float.random processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "float.random" {
|
||||
t.Fatalf("float.random processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestFreeDCreateFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "freed.create",
|
||||
Params: map[string]any{
|
||||
"id": "0",
|
||||
@@ -35,6 +36,10 @@ func TestFreeDCreateFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create freed.create processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("freed.create processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "freed.create" {
|
||||
t.Fatalf("freed.create processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestFreeDDecodeFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "freed.decode",
|
||||
})
|
||||
|
||||
@@ -24,6 +25,10 @@ func TestFreeDDecodeFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create freed.decode processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("freed.decode processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "freed.decode" {
|
||||
t.Fatalf("freed.decode processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestFreeDEncodeFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "freed.encode",
|
||||
})
|
||||
|
||||
@@ -24,6 +25,10 @@ func TestFreeDEncodeFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create freed.encode processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("freed.encode processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "freed.encode" {
|
||||
t.Fatalf("freed.encode processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ func TestHTTPRequestCreateFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "http.request.do",
|
||||
Params: map[string]any{
|
||||
"method": "GET",
|
||||
@@ -27,6 +28,10 @@ func TestHTTPRequestCreateFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create http.request.do processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("http.request.do processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "http.request.do" {
|
||||
t.Fatalf("http.request.do processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ func TestHTTPResponseCreateFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "http.response.create",
|
||||
Params: map[string]any{
|
||||
"status": 200,
|
||||
@@ -27,6 +28,10 @@ func TestHTTPResponseCreateFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create http.response.create processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("http.response.create processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "http.response.create" {
|
||||
t.Fatalf("http.response.create processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ func TestIntParseFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "int.parse",
|
||||
})
|
||||
|
||||
@@ -23,6 +24,10 @@ func TestIntParseFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create int.parse processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("int.parse processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "int.parse" {
|
||||
t.Fatalf("int.parse processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ func TestIntRandomFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "int.random",
|
||||
Params: map[string]any{
|
||||
"min": 1,
|
||||
@@ -26,6 +27,10 @@ func TestIntRandomFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create int.random processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("int.random processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "int.random" {
|
||||
t.Fatalf("int.random processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ func TestIntScaleFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "int.scale",
|
||||
Params: map[string]any{
|
||||
"inMin": 0,
|
||||
@@ -28,6 +29,10 @@ func TestIntScaleFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create int.scale processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("int.scale processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "int.scale" {
|
||||
t.Fatalf("int.scale processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,12 +17,17 @@ func TestJsonDecodeFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "json.decode",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create json.decode processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("json.decode processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "json.decode" {
|
||||
t.Fatalf("json.decode processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -18,12 +18,17 @@ func TestJsonEncodeFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "json.encode",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create json.encode processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("json.encode processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "json.encode" {
|
||||
t.Fatalf("json.encode processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestKvGetFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "kv.get",
|
||||
Params: map[string]any{
|
||||
"module": "test",
|
||||
@@ -27,6 +28,10 @@ func TestKvGetFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create kv.get processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("kv.get processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "kv.get" {
|
||||
t.Fatalf("kv.get processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestKvSetFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "kv.set",
|
||||
Params: map[string]any{
|
||||
"module": "test",
|
||||
@@ -27,6 +28,9 @@ func TestKvSetFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create kv.set processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("kv.set processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
if processorInstance.Type() != "kv.set" {
|
||||
t.Fatalf("kv.set processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestMIDIControlChangeCreateFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "midi.control_change.create",
|
||||
Params: map[string]any{
|
||||
"channel": "1",
|
||||
@@ -29,6 +30,10 @@ func TestMIDIControlChangeCreateFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create midi.control_change.create processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("midi.control_change.create processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "midi.control_change.create" {
|
||||
t.Fatalf("midi.control_change.create processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestMIDIMessageDecodeFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "midi.message.decode",
|
||||
})
|
||||
|
||||
@@ -24,6 +25,10 @@ func TestMIDIMessageDecodeFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create midi.message.decode processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("midi.message.decode processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "midi.message.decode" {
|
||||
t.Fatalf("midi.message.decode processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestMIDIMessageEncodeFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "midi.message.encode",
|
||||
})
|
||||
|
||||
@@ -24,6 +25,10 @@ func TestMIDIMessageEncodeFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create midi.message.encode processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("midi.message.encode processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "midi.message.encode" {
|
||||
t.Fatalf("midi.message.encode processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestMIDIMessageUnpackFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "midi.message.unpack",
|
||||
})
|
||||
|
||||
@@ -24,6 +25,9 @@ func TestMIDIMessageUnpackFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create midi.message.unpack processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("midi.message.unpack processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
if processorInstance.Type() != "midi.message.unpack" {
|
||||
t.Fatalf("midi.message.unpack processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestMIDINoteOffCreteaFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "midi.note_off.create",
|
||||
Params: map[string]any{
|
||||
"channel": "1",
|
||||
@@ -28,6 +29,9 @@ func TestMIDINoteOffCreteaFromRegistry(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create midi.note_off.create processor: %s", err)
|
||||
}
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("midi.note_off.create processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "midi.note_off.create" {
|
||||
t.Fatalf("midi.note_off.create processor has wrong type: %s", processorInstance.Type())
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestMIDINoteOnCreateFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "midi.note_on.create",
|
||||
Params: map[string]any{
|
||||
"channel": "1",
|
||||
@@ -29,6 +30,10 @@ func TestMIDINoteOnCreateFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create midi.note_on.create processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("midi.note_on.create processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "midi.note_on.create" {
|
||||
t.Fatalf("midi.note_on.create processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestMIDIProgramChangeCreateFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "midi.program_change.create",
|
||||
Params: map[string]any{
|
||||
"channel": "1",
|
||||
@@ -28,6 +29,10 @@ func TestMIDIProgramChangeCreateFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create midi.program_change.create processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("midi.program_change.create processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "midi.program_change.create" {
|
||||
t.Fatalf("midi.program_change.create processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestModuleOutputFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "module.output",
|
||||
Params: config.Params{
|
||||
"module": "test",
|
||||
@@ -27,6 +28,10 @@ func TestModuleOutputFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create module.output processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("module.output processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "module.output" {
|
||||
t.Fatalf("module.output processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestOSCMessageCreateFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "osc.message.create",
|
||||
Params: map[string]any{
|
||||
"address": "/test",
|
||||
@@ -27,6 +28,10 @@ func TestOSCMessageCreateFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create osc.message.create processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("osc.message.create processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "osc.message.create" {
|
||||
t.Fatalf("osc.message.create processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestOSCMessageDecodeFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "osc.message.decode",
|
||||
})
|
||||
|
||||
@@ -24,6 +25,10 @@ func TestOSCMessageDecodeFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create osc.message.decode processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("osc.message.decode processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "osc.message.decode" {
|
||||
t.Fatalf("osc.message.decode processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestOSCMessageEncodeFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "osc.message.encode",
|
||||
})
|
||||
|
||||
@@ -24,6 +25,10 @@ func TestOSCMessageEncodeFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create osc.message.encode processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("osc.message.encode processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "osc.message.encode" {
|
||||
t.Fatalf("osc.message.encode processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ func TestPubSubPublishFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "pubsub.publish",
|
||||
Params: map[string]any{
|
||||
"module": "test",
|
||||
@@ -28,6 +29,10 @@ func TestPubSubPublishFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create pubsub.publish processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("pubsub.publish processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "pubsub.publish" {
|
||||
t.Fatalf("pubsub.publish processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestRouterInputFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "router.input",
|
||||
Params: config.Params{
|
||||
"source": "test",
|
||||
@@ -27,6 +28,10 @@ func TestRouterInputFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create router.input processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("router.input processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "router.input" {
|
||||
t.Fatalf("router.input processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ func TestScriptExprFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "script.expr",
|
||||
Params: map[string]any{
|
||||
"expression": "foo + bar",
|
||||
@@ -24,6 +25,10 @@ func TestScriptExprFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create script.expr processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("script.expr processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "script.expr" {
|
||||
t.Fatalf("script.expr processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ func TestScriptJSFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "script.js",
|
||||
Params: map[string]any{
|
||||
"program": `
|
||||
@@ -27,6 +28,10 @@ func TestScriptJSFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create script.js processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("script.js processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "script.js" {
|
||||
t.Fatalf("script.js processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestScriptWASMFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "script.wasm",
|
||||
Params: map[string]any{
|
||||
"path": "good.wasm",
|
||||
@@ -26,6 +27,10 @@ func TestScriptWASMFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create script.wasm processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("script.wasm processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "script.wasm" {
|
||||
t.Fatalf("script.wasm processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ func TestSipResponseAudioCreateFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "sip.response.audio.create",
|
||||
Params: map[string]any{
|
||||
"preWait": 0,
|
||||
@@ -28,6 +29,10 @@ func TestSipResponseAudioCreateFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to filter sip.response.audio.create processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("sip.response.audio.create processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "sip.response.audio.create" {
|
||||
t.Fatalf("sip.response.audio.create processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ func TestSipResponseDTMFCreateFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "sip.response.dtmf.create",
|
||||
Params: map[string]any{
|
||||
"preWait": 0,
|
||||
@@ -28,6 +29,10 @@ func TestSipResponseDTMFCreateFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to filter sip.response.dtmf.create processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("sip.response.dtmf.create processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "sip.response.dtmf.create" {
|
||||
t.Fatalf("sip.response.dtmf.create processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ func TestStringCreateFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "string.create",
|
||||
Params: map[string]any{
|
||||
"template": "{{.Payload}}",
|
||||
@@ -25,6 +26,10 @@ func TestStringCreateFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create string.create processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("string.create processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "string.create" {
|
||||
t.Fatalf("string.create processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -16,12 +16,17 @@ func TestStringDecodeFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "string.decode",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create string.decode processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("string.decode processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "string.decode" {
|
||||
t.Fatalf("string.decode processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,12 +17,17 @@ func TestStringEncodeFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "string.encode",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create string.encode processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("string.encode processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "string.encode" {
|
||||
t.Fatalf("string.encode processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestStringSplitFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "string.split",
|
||||
Params: map[string]any{
|
||||
"separator": ",",
|
||||
@@ -26,6 +27,10 @@ func TestStringSplitFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create string.split processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("string.split processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "string.split" {
|
||||
t.Fatalf("string.split processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestStructFieldGetFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "struct.field.get",
|
||||
Params: map[string]any{
|
||||
"name": "Data",
|
||||
@@ -26,6 +27,10 @@ func TestStructFieldGetFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create struct.field.get processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("struct.field.get processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "struct.field.get" {
|
||||
t.Fatalf("struct.field.get processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func TestStructMethodGetFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "struct.method.get",
|
||||
Params: map[string]any{
|
||||
"name": "GetData",
|
||||
@@ -26,6 +27,10 @@ func TestStructMethodGetFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create struct.method.get processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("struct.method.get processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "struct.method.get" {
|
||||
t.Fatalf("struct.method.get processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ func TestTimeSleepFromRegistry(t *testing.T) {
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Id: "test-id",
|
||||
Type: "time.sleep",
|
||||
Params: map[string]any{
|
||||
"duration": 1000,
|
||||
@@ -25,6 +26,10 @@ func TestTimeSleepFromRegistry(t *testing.T) {
|
||||
t.Fatalf("failed to create time.sleep processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Id() != "test-id" {
|
||||
t.Fatalf("time.sleep processor has wrong id: %s", processorInstance.Id())
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "time.sleep" {
|
||||
t.Fatalf("time.sleep processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user