diff options
Diffstat (limited to 'mod/component-json-schemas/tests')
6 files changed, 335 insertions, 0 deletions
diff --git a/mod/component-json-schemas/tests/component-spec-cdap.json b/mod/component-json-schemas/tests/component-spec-cdap.json new file mode 100644 index 0000000..a8e3544 --- /dev/null +++ b/mod/component-json-schemas/tests/component-spec-cdap.json @@ -0,0 +1,78 @@ +{ + "self":{ + "name":"cdap.helloworld.endnode", + "version":"0.8.0", + "description":"cdap test component", + "component_type":"cdap" + }, + "streams":{ + "subscribes": [ + { + "format": "some.format", + "version": "5.0.0", + "route": "/yay", + "type": "http" + }, + { + "format": "some.format", + "version": "5.0.0", + "config_key": "foo-sub", + "type": "message router" + }], + "publishes": [{ + "format": "std.empty", + "version": "1.0.6", + "config_key": "stream_publish_example", + "type": "message_router" + }] + }, + "services":{ + "calls": [], + "provides":[ + { + "request":{ + "format":"std.empty", + "version":"1.0.6" + }, + "response":{ + "format":"std.empty", + "version":"1.0.6" + }, + "service_name":"Greeting", + "service_endpoint":"greet", + "verb":"GET" + } + ] + }, + "parameters": { + "app_config" : [ + {"name" : "some_param", + "description" : "some desc", + "value" : "some_value", + "type": "string"} + ], + "app_preferences" : [ + {"name" : "some_param2", + "description" : "some desc2", + "value" : true, + "type": "boolean"} + ], + "program_preferences" : [{"program_type" : "flows", "program_id" : "WhoFlow", "program_pref" : [{"name" : "some_param3","description" : "some desc3", "value" : "some_value3", "type": "number"}]}] + }, + "auxilary": { + "streamname":"who", + "artifact_name" : "HelloWorld", + "artifact_version" : "3.4.3", + "programs" : [ + {"program_type" : "flows", "program_id" : "WhoFlow"}, + {"program_type" : "services", "program_id" : "Greeting"} + ], + "namespace" : "hw" + }, + "artifacts": [ + { + "uri": "some jar url", + "type": "jar" + } + ] +} diff --git a/mod/component-json-schemas/tests/component-spec-docker.json b/mod/component-json-schemas/tests/component-spec-docker.json new file mode 100644 index 0000000..34458d5 --- /dev/null +++ b/mod/component-json-schemas/tests/component-spec-docker.json @@ -0,0 +1,110 @@ +{ + "self": { + "version": "0.5.0", + "name": "sandbox.platform.laika", + "description": "Web service used as a stand-alone test DCAE service component", + "component_type": "docker" + }, + "streams": { + "subscribes": [], + "publishes": [ + { + "format": "some.format", + "version": "1.0.0", + "config_key": "pub-foo", + "type": "message router" + }, + { + "format": "some.format", + "version": "1.0.0", + "config_key": "pub-foo", + "type": "http" + } + ] + }, + "services": { + "calls": [], + "provides": [ + { + "route": "/rollcall", + "verb": "GET", + "request": { + "format": "sandbox.platform.any", + "version": "0.1.0" + }, + "response": { + "format": "sandbox.platform.laika.rollcall.response", + "version": "0.1.0" + } + }, + { + "route": "/identity", + "verb": "POST", + "request": { + "format": "sandbox.platform.laika.identity.request", + "version": "0.1.0" + }, + "response": { + "format": "sandbox.platform.laika.identity.response", + "version": "0.1.0" + } + }, + { + "route": "/health", + "verb": "GET", + "request": { + "format": "sandbox.platform.any", + "version": "0.1.0" + }, + "response": { + "format": "sandbox.platform.laika.health", + "version": "0.1.0" + } + } + ] + }, + "parameters": [ + { + "name": "threshold", + "description": "Some fake threshold", + "type": "number", + "value": 2000 + }, + { + "name": "some-target-number", + "description": "Some fake target", + "type": "number", + "value": 10000, + "constraints": [ + { + "greater_or_equal": 1 + }, + { + "less_than": 100000 + }] + }, + { + "name": "magic-word", + "description": "Some magic word", + "type": "string", + "value": "requirements", + "constraints": [ + { + "valid_values": ["rally", "user story"] + }] + } + ], + "auxilary": { + "healthcheck": { + "type": "http", + "endpoint": "/foo" + }, + "ports": ["8080:8080"] + }, + "artifacts": [ + { + "uri": "some docker image path", + "type": "docker image" + } + ] +} diff --git a/mod/component-json-schemas/tests/component-spec-logging.json b/mod/component-json-schemas/tests/component-spec-logging.json new file mode 100644 index 0000000..6b74050 --- /dev/null +++ b/mod/component-json-schemas/tests/component-spec-logging.json @@ -0,0 +1,114 @@ +{ + "self": { + "version": "0.5.0", + "name": "sandbox.platform.laika", + "description": "Web service used as a stand-alone test DCAE service component", + "component_type": "docker" + }, + "streams": { + "subscribes": [], + "publishes": [ + { + "format": "some.format", + "version": "1.0.0", + "config_key": "pub-foo", + "type": "message router" + }, + { + "format": "some.format", + "version": "1.0.0", + "config_key": "pub-foo", + "type": "http" + } + ] + }, + "services": { + "calls": [], + "provides": [ + { + "route": "/rollcall", + "verb": "GET", + "request": { + "format": "sandbox.platform.any", + "version": "0.1.0" + }, + "response": { + "format": "sandbox.platform.laika.rollcall.response", + "version": "0.1.0" + } + }, + { + "route": "/identity", + "verb": "POST", + "request": { + "format": "sandbox.platform.laika.identity.request", + "version": "0.1.0" + }, + "response": { + "format": "sandbox.platform.laika.identity.response", + "version": "0.1.0" + } + }, + { + "route": "/health", + "verb": "GET", + "request": { + "format": "sandbox.platform.any", + "version": "0.1.0" + }, + "response": { + "format": "sandbox.platform.laika.health", + "version": "0.1.0" + } + } + ] + }, + "parameters": [ + { + "name": "threshold", + "description": "Some fake threshold", + "type": "number", + "value": 2000 + }, + { + "name": "some-target-number", + "description": "Some fake target", + "type": "number", + "value": 10000, + "constraints": [ + { + "greater_or_equal": 1 + }, + { + "less_than": 100000 + }] + }, + { + "name": "magic-word", + "description": "Some magic word", + "type": "string", + "value": "requirements", + "constraints": [ + { + "valid_values": ["rally", "user story"] + }] + } + ], + "auxilary": { + "healthcheck": { + "type": "http", + "endpoint": "/foo" + }, + "ports": ["8080:8080"], + "logging": { + "log_directory": "/tmp/yo", + "alternate_fb_path": "/tmp/path" + } + }, + "artifacts": [ + { + "uri": "some docker image path", + "type": "docker image" + } + ] +} diff --git a/mod/component-json-schemas/tests/dmaap-mr-bad-extra.json b/mod/component-json-schemas/tests/dmaap-mr-bad-extra.json new file mode 100644 index 0000000..e1821d5 --- /dev/null +++ b/mod/component-json-schemas/tests/dmaap-mr-bad-extra.json @@ -0,0 +1,12 @@ +{ + "type": "message_router", + "aaf_username": "foo3", + "aaf_password": "bar3", + "something_else": "boo", + "dmaap_info":{ + "client_role":"some.dcae.member", + "client_id":"123456", + "location":"mtc5", + "topic_url":"https://message-router-url/some-topic" + } +} diff --git a/mod/component-json-schemas/tests/dmaap-mr-bad-missing.json b/mod/component-json-schemas/tests/dmaap-mr-bad-missing.json new file mode 100644 index 0000000..9151032 --- /dev/null +++ b/mod/component-json-schemas/tests/dmaap-mr-bad-missing.json @@ -0,0 +1,10 @@ +{ + "type": "message_router", + "aaf_username": "foo3", + "aaf_password": "bar3", + "dmaap_info":{ + "client_role":"some.dcae.member", + "client_id":"123456", + "location":"mtc5" + } +} diff --git a/mod/component-json-schemas/tests/dmaap-mr-good.json b/mod/component-json-schemas/tests/dmaap-mr-good.json new file mode 100644 index 0000000..d3e8dda --- /dev/null +++ b/mod/component-json-schemas/tests/dmaap-mr-good.json @@ -0,0 +1,11 @@ +{ + "type": "message_router", + "aaf_username": "foo3", + "aaf_password": "bar3", + "dmaap_info":{ + "client_role":"some.dcae.member", + "client_id":"123456", + "location":"mtc5", + "topic_url":"https://message-router-url/some-topic" + } +} |