diff options
author | Michael DÜrre <michael.duerre@highstreet-technologies.com> | 2021-01-18 05:41:16 +0100 |
---|---|---|
committer | Michael DÜrre <michael.duerre@highstreet-technologies.com> | 2021-02-02 07:28:40 +0100 |
commit | 56c27daf1656fd6436f8c818c771cf803079e1ea (patch) | |
tree | a2734caf88f1633d14db763281d2a03e4ec8aef5 /core/sliapi | |
parent | 0e4e58bf061df695341ac250beb97a978cefdaf7 (diff) |
migrate sli to alu-SR1
migrate ODL interfaces and fix code for changes in alu-SR1
Issue-ID: CCSDK-3089
Signed-off-by: Michael DÜrre <michael.duerre@highstreet-technologies.com>
Change-Id: Id48dcfc517585f2ce6b30047113cd1d173c3c9dc
Signed-off-by: Michael DÜrre <michael.duerre@highstreet-technologies.com>
Diffstat (limited to 'core/sliapi')
7 files changed, 142 insertions, 178 deletions
diff --git a/core/sliapi/model/swagger/src/main/json/sliapi.json b/core/sliapi/model/swagger/src/main/json/sliapi.json index 9133f3379..3848cb551 100644 --- a/core/sliapi/model/swagger/src/main/json/sliapi.json +++ b/core/sliapi/model/swagger/src/main/json/sliapi.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"description":"Defines API to service logic interpreter,This module contains a collection of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.,This module contains a collection of generally useful derived\nYANG data types for Internet addresses and related things.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.","version":"1.2.0-SNAPSHOT","title":"SLI-API,ietf-yang-types,ietf-inet-types API"},"consumes":["application/json","application/xml"],"produces":["application/json","application/xml"],"paths":{"/config/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/config/SLI-API:test-results/SLI-API:test-result/":{"post":{"description":"creates sli.api.testresults.TestResult","parameters":[{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}}},"/config/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/operational/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}}},"/operational/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}}},"/operations/SLI-API:execute-graph/":{"post":{"tags":["SLI-API"],"parameters":[{"in":"body","name":"sli.api.executegraph.Input.body-param","required":false,"schema":{"properties":{"input":{"originalRef":"#/definitions/sli.api.executegraph.Input","$ref":"#/definitions/sli.api.executegraph.Input"}}}}],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"},"schema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"}},"201":{"description":"No response"}}}},"/operations/SLI-API:healthcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"},"schema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"}},"201":{"description":"No response"}}}},"/operations/SLI-API:vlbcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"},"schema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"}},"201":{"description":"No response"}}}}},"definitions":{"sli.api.ExecuteGraph":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.Healthcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.ModeEnumeration":{"type":"string","enum":["sync","async"]},"sli.api.ParameterSetting":{"type":"object","properties":{"string-value":{"type":"string"},"boolean-value":{"type":"boolean"},"parameter-name":{"type":"string","description":"Parameter name"},"int-value":{"type":"integer","format":"int32"}}},"sli.api.ResponseFields":{"type":"object","properties":{"response-code":{"type":"string"},"response-message":{"type":"string"},"context-memory-json":{"type":"string"},"ack-final-indicator":{"type":"string"}}},"sli.api.TestResults":{"type":"object","properties":{"test-result":{"type":"array","items":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"sli.api.Vlbcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.executegraph.Input":{"type":"object","properties":{"mode":{"originalRef":"#/definitions/sli.api.ModeEnumeration","$ref":"#/definitions/sli.api.ModeEnumeration"},"module-name":{"type":"string"},"sli-parameter":{"type":"array","items":{"originalRef":"#/definitions/sli.api.ParameterSetting","$ref":"#/definitions/sli.api.ParameterSetting"}},"rpc-name":{"type":"string"}}},"sli.api.testresults.TestResult":{"type":"object","properties":{"results":{"type":"array","items":{"type":"string"}},"test-identifier":{"type":"string"}}}}}
\ No newline at end of file +{"swagger":"2.0","info":{"description":"This module contains a collection of generally useful derived\nYANG data types for Internet addresses and related things.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.,Defines API to service logic interpreter,This module contains a collection of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.","version":"1.2.0-SNAPSHOT","title":"ietf-inet-types,SLI-API,ietf-yang-types API"},"consumes":["application/json","application/xml"],"produces":["application/json","application/xml"],"paths":{"/config/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/config/SLI-API:test-results/SLI-API:test-result/":{"post":{"description":"creates sli.api.testresults.TestResult","parameters":[{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}}},"/config/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/operational/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}}},"/operational/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}}},"/operations/SLI-API:execute-graph/":{"post":{"tags":["SLI-API"],"parameters":[{"in":"body","name":"sli.api.executegraph.Input.body-param","required":false,"schema":{"properties":{"input":{"originalRef":"#/definitions/sli.api.executegraph.Input","$ref":"#/definitions/sli.api.executegraph.Input"}}}}],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"},"schema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"}},"201":{"description":"No response"}}}},"/operations/SLI-API:healthcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"},"schema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"}},"201":{"description":"No response"}}}},"/operations/SLI-API:vlbcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"},"schema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"}},"201":{"description":"No response"}}}}},"definitions":{"sli.api.ExecuteGraph":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.Healthcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.ModeEnumeration":{"type":"string","enum":["sync","async"]},"sli.api.ParameterSetting":{"type":"object","properties":{"string-value":{"type":"string"},"boolean-value":{"type":"boolean"},"parameter-name":{"type":"string","description":"Parameter name"},"int-value":{"type":"integer","format":"int32"}}},"sli.api.ResponseFields":{"type":"object","properties":{"response-code":{"type":"string"},"response-message":{"type":"string"},"context-memory-json":{"type":"string"},"ack-final-indicator":{"type":"string"}}},"sli.api.TestResults":{"type":"object","properties":{"test-result":{"type":"array","items":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"sli.api.Vlbcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.executegraph.Input":{"type":"object","properties":{"mode":{"originalRef":"#/definitions/sli.api.ModeEnumeration","$ref":"#/definitions/sli.api.ModeEnumeration"},"module-name":{"type":"string"},"sli-parameter":{"type":"array","items":{"originalRef":"#/definitions/sli.api.ParameterSetting","$ref":"#/definitions/sli.api.ParameterSetting"}},"rpc-name":{"type":"string"}}},"sli.api.testresults.TestResult":{"type":"object","properties":{"results":{"type":"array","items":{"type":"string"}},"test-identifier":{"type":"string"}}}}}
\ No newline at end of file diff --git a/core/sliapi/model/swagger/src/main/yaml/sliapi.yaml b/core/sliapi/model/swagger/src/main/yaml/sliapi.yaml index 15da98dfd..b97b1325a 100644 --- a/core/sliapi/model/swagger/src/main/yaml/sliapi.yaml +++ b/core/sliapi/model/swagger/src/main/yaml/sliapi.yaml @@ -1,25 +1,25 @@ --- swagger: "2.0" info: - description: "Defines API to service logic interpreter,This module contains a collection\ - \ of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust\ - \ and the persons identified as\nauthors of the code. All rights reserved.\n\n\ - Redistribution and use in source and binary forms, with or\nwithout modification,\ + description: "This module contains a collection of generally useful derived\nYANG\ + \ data types for Internet addresses and related things.\n\nCopyright (c) 2013\ + \ IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\ + \nRedistribution and use in source and binary forms, with or\nwithout modification,\ \ is permitted pursuant to, and subject\nto the license terms contained in, the\ \ Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\n\ Relating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version\ \ of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal\ - \ notices.,This module contains a collection of generally useful derived\nYANG\ - \ data types for Internet addresses and related things.\n\nCopyright (c) 2013\ - \ IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\ - \nRedistribution and use in source and binary forms, with or\nwithout modification,\ + \ notices.,Defines API to service logic interpreter,This module contains a collection\ + \ of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust\ + \ and the persons identified as\nauthors of the code. All rights reserved.\n\n\ + Redistribution and use in source and binary forms, with or\nwithout modification,\ \ is permitted pursuant to, and subject\nto the license terms contained in, the\ \ Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\n\ Relating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version\ \ of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal\ \ notices." version: "1.2.0-SNAPSHOT" - title: "SLI-API,ietf-yang-types,ietf-inet-types API" + title: "ietf-inet-types,SLI-API,ietf-yang-types API" consumes: - "application/json" - "application/xml" diff --git a/core/sliapi/provider/pom.xml b/core/sliapi/provider/pom.xml index b9d1c9a67..5bccec9b6 100755 --- a/core/sliapi/provider/pom.xml +++ b/core/sliapi/provider/pom.xml @@ -17,58 +17,54 @@ <name>ccsdk-sli-core :: sliapi :: ${project.artifactId}</name> <dependencyManagement> - <dependencies> - <dependency> - <groupId>org.onap.ccsdk.sli.core</groupId> - <artifactId>dblib-provider</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - </dependencyManagement> - <dependencies> - <dependency> - <groupId>org.onap.ccsdk.sli.core</groupId> - <artifactId>sliapi-model-yang</artifactId> - <version>${project.version}</version> - </dependency> + <dependencies> + <dependency> + <groupId>org.onap.ccsdk.sli.core</groupId> + <artifactId>dblib-provider</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> + </dependencyManagement> + <dependencies> <dependency> <groupId>org.opendaylight.mdsal</groupId> <artifactId>mdsal-binding-api</artifactId> + <scope>provided</scope> </dependency> - - <dependency> - <groupId>org.opendaylight.controller</groupId> - <artifactId>sal-binding-api</artifactId> - </dependency> - - <dependency> - <groupId>org.opendaylight.controller</groupId> - <artifactId>sal-binding-broker-impl</artifactId> - </dependency> - <dependency> <groupId>org.opendaylight.mdsal</groupId> <artifactId>mdsal-binding-dom-adapter</artifactId> + <scope>provided</scope> </dependency> - <dependency> <groupId>org.opendaylight.mdsal</groupId> <artifactId>yang-binding</artifactId> + <scope>provided</scope> </dependency> - <dependency> <groupId>org.opendaylight.controller</groupId> <artifactId>sal-common-util</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.opendaylight.yangtools</groupId> + <artifactId>yang-data-impl</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.core</artifactId> + <scope>provided</scope> </dependency> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.core</artifactId> - <scope>provided</scope> - </dependency> <dependency> <groupId>org.onap.ccsdk.sli.core</groupId> + <artifactId>sliapi-model-yang</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.ccsdk.sli.core</groupId> <artifactId>sli-common</artifactId> <version>${project.version}</version> </dependency> @@ -82,27 +78,17 @@ <artifactId>sli-provider-base</artifactId> <version>${project.version}</version> </dependency> - <dependency> - <groupId>org.opendaylight.controller</groupId> - <artifactId>sal-core-api</artifactId> - </dependency> - <dependency> - <groupId>org.opendaylight.yangtools</groupId> - <artifactId>yang-data-impl</artifactId> - </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency> - <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <scope>test</scope> </dependency> - <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> diff --git a/core/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/SliapiProvider.java b/core/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/SliapiProvider.java index 449fc3822..a00131efb 100644 --- a/core/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/SliapiProvider.java +++ b/core/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/SliapiProvider.java @@ -21,6 +21,8 @@ package org.onap.ccsdk.sli.core.sliapi; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; @@ -28,19 +30,14 @@ import java.io.IOException; import java.util.Enumeration; import java.util.LinkedList; import java.util.Properties; - +import java.util.concurrent.ExecutionException; import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; -import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; -import org.opendaylight.controller.md.sal.binding.impl.AbstractForwardedDataBroker; -import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; -import org.opendaylight.controller.md.sal.common.api.data.OptimisticLockFailedException; -import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; -import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; -import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.mdsal.binding.api.NotificationPublishService; +import org.opendaylight.mdsal.binding.api.RpcProviderService; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; +import org.opendaylight.mdsal.common.api.OptimisticLockFailedException; +import org.opendaylight.mdsal.dom.api.DOMDataBroker; +import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInput.Mode; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInputBuilder; @@ -50,14 +47,13 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.Hea import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.HealthcheckOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.HealthcheckOutputBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.SLIAPIService; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.TestResults; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.VlbcheckInput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.VlbcheckOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.VlbcheckOutputBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.execute.graph.input.SliParameter; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.test.results.TestResult; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.test.results.TestResultBuilder; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.concepts.ObjectRegistration; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.RpcError.ErrorType; import org.opendaylight.yangtools.yang.common.RpcResult; @@ -78,9 +74,6 @@ import org.osgi.framework.ServiceReference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; - /** * Defines a base implementation for your provider. This class extends from a * helper class which provides storage for the most commonly used components of @@ -92,17 +85,17 @@ import com.google.common.util.concurrent.ListenableFuture; * src/main/java in this project (created only once during first compilation): * * <pre> - * + * * @Override * public java.lang.AutoCloseable createInstance() { - * + * * final SliapiProvider provider = new SliapiProvider(); * provider.setDataBroker(getDataBrokerDependency()); * provider.setNotificationService(getNotificationServiceDependency()); * provider.setRpcRegistry(getRpcRegistryDependency()); * provider.initialize(); * return new AutoCloseable() { - * + * * @Override * public void close() throws Exception { * // TODO: CLOSE ANY REGISTRATION OBJECTS CREATED USING ABOVE @@ -112,7 +105,7 @@ import com.google.common.util.concurrent.ListenableFuture; * } * }; * } - * + * * </pre> */ public class SliapiProvider implements AutoCloseable, SLIAPIService { @@ -120,14 +113,14 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService { private static final Logger LOG = LoggerFactory.getLogger(SliapiProvider.class); private static final String appName = "slitester"; - protected DataBroker dataBroker; + //protected DataBroker dataBroker; protected DOMDataBroker domDataBroker; protected NotificationPublishService notificationService; - protected RpcProviderRegistry rpcRegistry; + protected RpcProviderService rpcRegistry; private SvcLogicService svcLogic; - protected BindingAwareBroker.RpcRegistration<SLIAPIService> rpcRegistration; + protected ObjectRegistration<SLIAPIService> rpcRegistration; private static String SLIAPI_NAMESPACE = "org:onap:ccsdk:sli:core:sliapi"; private static String SLIAPI_REVISION = "2016-11-10"; @@ -148,25 +141,26 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService { RESULTS_QNAME = QName.create(TEST_RESULT_QNAME, "results"); } - public SliapiProvider(DataBroker dataBroker, NotificationPublishService notificationPublishService, - RpcProviderRegistry rpcProviderRegistry) { + public SliapiProvider(DOMDataBroker dataBroker, NotificationPublishService notificationPublishService, + RpcProviderService rpcProviderRegistry) { this(dataBroker, notificationPublishService, rpcProviderRegistry, findSvcLogicService()); } - public SliapiProvider(DataBroker dataBroker, NotificationPublishService notificationPublishService, - RpcProviderRegistry rpcProviderRegistry, SvcLogicService svcLogic) { + public SliapiProvider(DOMDataBroker dataBroker, NotificationPublishService notificationPublishService, + RpcProviderService rpcProviderRegistry, SvcLogicService svcLogic) { this.LOG.info("Creating provider for " + appName); - this.dataBroker = dataBroker; + //this.dataBroker = dataBroker; this.notificationService = notificationPublishService; this.rpcRegistry = rpcProviderRegistry; this.svcLogic = svcLogic; + this.domDataBroker = dataBroker; initialize(); } public void initialize() { LOG.info("Initializing provider for " + appName); // initialization code goes here. - rpcRegistration = rpcRegistry.addRpcImplementation(SLIAPIService.class, this); + rpcRegistration = rpcRegistry.registerRpcImplementation(SLIAPIService.class, this); sdncStatusFile = System.getenv(SDNC_STATUS_FILE); LOG.info("SDNC STATUS FILE = " + sdncStatusFile); @@ -186,11 +180,9 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService { LOG.info("Successfully closed provider for " + appName); } - public void setDataBroker(DataBroker dataBroker) { - this.dataBroker = dataBroker; - if (dataBroker instanceof AbstractForwardedDataBroker) { - domDataBroker = ((AbstractForwardedDataBroker) dataBroker).getDelegate(); - } + public void setDataBroker(DOMDataBroker dataBroker) { + domDataBroker = dataBroker; + if (LOG.isDebugEnabled()) { LOG.debug("DataBroker set to " + (dataBroker == null ? "null" : NON_NULL) + "."); } @@ -203,7 +195,7 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService { } } - public void setRpcRegistry(RpcProviderRegistry rpcRegistry) { + public void setRpcRegistry(RpcProviderService rpcRegistry) { this.rpcRegistry = rpcRegistry; if (LOG.isDebugEnabled()) { LOG.debug("RpcRegistry set to " + (rpcRegistry == null ? "null" : NON_NULL) + "."); @@ -262,7 +254,7 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService { Properties parms = new Properties(); // Pass properties using names from sli-parameters - for (SliParameter sliParm : input.getSliParameter()) { + for (SliParameter sliParm : input.getSliParameter().values()) { String propValue = ""; @@ -454,7 +446,8 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService { return (Futures.immediateFuture(rpcResult)); } - public ListenableFuture<RpcResult<VlbcheckOutput>> vlbcheck(VlbcheckInput vlbInput) { + @Override + public ListenableFuture<RpcResult<VlbcheckOutput>> vlbcheck(VlbcheckInput vlbInput) { RpcResult<VlbcheckOutput> rpcResult = null; SvcLogicService svcLogic = getSvcLogicService(); @@ -578,12 +571,12 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService { YangInstanceIdentifier testResultsPid = YangInstanceIdentifier.builder().node(TEST_RESULTS_QNAME) .node(QName.create(TEST_RESULTS_QNAME, "test-result")).build(); YangInstanceIdentifier testResultPid = testResultsPid - .node(new NodeIdentifierWithPredicates(TEST_RESULT_QNAME, resultNode.getIdentifier().getKeyValues())); + .node(NodeIdentifierWithPredicates.of(TEST_RESULT_QNAME, resultNode.getIdentifier().asMap())); int tries = 2; while (true) { try { - DOMDataWriteTransaction wtx = domDataBroker.newWriteOnlyTransaction(); + DOMDataTreeWriteTransaction wtx = domDataBroker.newWriteOnlyTransaction(); if (merge) { LOG.info("Merging test identifier " + entry.getTestIdentifier()); wtx.merge(storeType, testResultPid, resultNode); @@ -591,10 +584,10 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService { LOG.info("Putting test identifier " + entry.getTestIdentifier()); wtx.put(storeType, testResultPid, resultNode); } - wtx.submit().checkedGet(); + wtx.commit().get(); LOG.trace("Update DataStore succeeded"); break; - } catch (final TransactionCommitFailedException e) { + } catch (final InterruptedException | ExecutionException e) { if (e instanceof OptimisticLockFailedException) { if (--tries <= 0) { LOG.trace("Got OptimisticLockFailedException on last try - failing "); @@ -610,40 +603,40 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService { } - private void SaveTestResult(final TestResult entry, boolean merge, LogicalDatastoreType storeType) - throws IllegalStateException { - // Each entry will be identifiable by a unique key, we have to create that - // identifier - - InstanceIdentifier.InstanceIdentifierBuilder<TestResult> testResultIdBuilder = InstanceIdentifier - .<TestResults>builder(TestResults.class).child(TestResult.class, entry.key()); - InstanceIdentifier<TestResult> path = testResultIdBuilder.build(); - int tries = 2; - while (true) { - try { - WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); - if (merge) { - tx.merge(storeType, path, entry); - } else { - tx.put(storeType, path, entry); - } - tx.submit().checkedGet(); - LOG.trace("Update DataStore succeeded"); - break; - } catch (final TransactionCommitFailedException e) { - if (e instanceof OptimisticLockFailedException) { - if (--tries <= 0) { - LOG.trace("Got OptimisticLockFailedException on last try - failing "); - throw new IllegalStateException(e); - } - LOG.trace("Got OptimisticLockFailedException - trying again "); - } else { - LOG.trace("Update DataStore failed"); - throw new IllegalStateException(e); - } - } - } - } +// private void SaveTestResult(final TestResult entry, boolean merge, LogicalDatastoreType storeType) +// throws IllegalStateException { +// // Each entry will be identifiable by a unique key, we have to create that +// // identifier +// +// InstanceIdentifier.InstanceIdentifierBuilder<TestResult> testResultIdBuilder = InstanceIdentifier +// .<TestResults>builder(TestResults.class).child(TestResult.class, entry.key()); +// InstanceIdentifier<TestResult> path = testResultIdBuilder.build(); +// int tries = 2; +// while (true) { +// try { +// WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); +// if (merge) { +// tx.merge(storeType, path, entry); +// } else { +// tx.put(storeType, path, entry); +// } +// tx.submit().checkedGet(); +// LOG.trace("Update DataStore succeeded"); +// break; +// } catch (final TransactionCommitFailedException e) { +// if (e instanceof OptimisticLockFailedException) { +// if (--tries <= 0) { +// LOG.trace("Got OptimisticLockFailedException on last try - failing "); +// throw new IllegalStateException(e); +// } +// LOG.trace("Got OptimisticLockFailedException - trying again "); +// } else { +// LOG.trace("Update DataStore failed"); +// throw new IllegalStateException(e); +// } +// } +// } +// } private MapEntryNode toMapEntryNode(TestResult testResult) { @@ -664,7 +657,8 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService { // Construct test result ContainerNode with 2 children - test-identifier leaf // and results leaf-set MapEntryNode testResultNode = ImmutableNodes.mapEntryBuilder() - .withNodeIdentifier(new NodeIdentifierWithPredicates(TEST_RESULT_QNAME, TEST_ID_QNAME, + + .withNodeIdentifier(NodeIdentifierWithPredicates.of(TEST_RESULT_QNAME, TEST_ID_QNAME, testResult.getTestIdentifier())) .withChild(ImmutableNodes.leafNode(TEST_ID_QNAME, testResult.getTestIdentifier())) .withChild(resultsNode).build(); diff --git a/core/sliapi/provider/src/main/resources/OSGI-INF/blueprint/sliapi-blueprint.xml b/core/sliapi/provider/src/main/resources/OSGI-INF/blueprint/sliapi-blueprint.xml deleted file mode 100644 index 875027e63..000000000 --- a/core/sliapi/provider/src/main/resources/OSGI-INF/blueprint/sliapi-blueprint.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" - xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0" - odl:use-default-for-reference-types="true"> - - <reference id="svcLogicService" - interface="org.onap.ccsdk.sli.core.sli.provider.SvcLogicService" /> - - - <reference id="dataBroker" - interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" - odl:type="default" /> - - <reference id="notificationService" - interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService" - odl:type="default" /> - - <reference id="rpcRegistry" - interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry" - odl:type="default" /> - - <bean id="provider" class="org.onap.ccsdk.sli.core.sliapi.SliapiProvider"> - <argument ref="dataBroker" /> - <argument ref="notificationService" /> - <argument ref="rpcRegistry" /> - - </bean> -</blueprint>
\ No newline at end of file diff --git a/core/sliapi/provider/src/main/resources/org/opendaylight/blueprint/sliapi-blueprint.xml b/core/sliapi/provider/src/main/resources/org/opendaylight/blueprint/sliapi-blueprint.xml index 875027e63..8ec666d53 100644 --- a/core/sliapi/provider/src/main/resources/org/opendaylight/blueprint/sliapi-blueprint.xml +++ b/core/sliapi/provider/src/main/resources/org/opendaylight/blueprint/sliapi-blueprint.xml @@ -8,16 +8,13 @@ <reference id="dataBroker" - interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" - odl:type="default" /> + interface="org.opendaylight.mdsal.dom.api.DOMDataBroker" /> <reference id="notificationService" - interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService" - odl:type="default" /> + interface="org.opendaylight.mdsal.binding.api.NotificationPublishService" /> <reference id="rpcRegistry" - interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry" - odl:type="default" /> + interface="org.opendaylight.mdsal.binding.api.RpcProviderService" /> <bean id="provider" class="org.onap.ccsdk.sli.core.sliapi.SliapiProvider"> <argument ref="dataBroker" /> diff --git a/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java b/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java index f48cf783b..b731423c5 100644 --- a/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java +++ b/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java @@ -1,15 +1,30 @@ -/** +/*- + * ============LICENSE_START======================================================= + * ONAP : CCSDK + * ================================================================================ + * Copyright (C) 2018 IBM. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= */ package org.onap.ccsdk.sli.core.sliapi; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; - import java.io.InputStream; import java.net.URL; import java.util.HashMap; @@ -47,10 +62,9 @@ import org.onap.ccsdk.sli.core.sli.provider.base.SetNodeExecutor; import org.onap.ccsdk.sli.core.sli.provider.base.SwitchNodeExecutor; import org.onap.ccsdk.sli.core.sli.provider.base.UpdateNodeExecutor; import org.onap.ccsdk.sli.core.sli.provider.base.WhileNodeExecutor; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.mdsal.binding.api.NotificationPublishService; +import org.opendaylight.mdsal.binding.api.RpcProviderService; +import org.opendaylight.mdsal.dom.api.DOMDataBroker; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInputBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.HealthcheckInput; @@ -58,6 +72,7 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.SLI import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.VlbcheckInput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.execute.graph.input.SliParameter; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.execute.graph.input.SliParameterBuilder; +import org.opendaylight.yangtools.concepts.ObjectRegistration; /** * @author dt5972 @@ -99,12 +114,12 @@ public class TestSliapiProvider { */ @Before public void setUp() throws Exception { - DataBroker dataBroker = mock(DataBroker.class); + DOMDataBroker dataBroker = mock(DOMDataBroker.class); NotificationPublishService notifyService = mock(NotificationPublishService.class); - RpcProviderRegistry rpcRegistry = mock(RpcProviderRegistry.class); - BindingAwareBroker.RpcRegistration<SLIAPIService> rpcRegistration = (BindingAwareBroker.RpcRegistration<SLIAPIService>) mock( - BindingAwareBroker.RpcRegistration.class); - when(rpcRegistry.addRpcImplementation(any(Class.class), any(SLIAPIService.class))).thenReturn(rpcRegistration); + RpcProviderService rpcRegistry = mock(RpcProviderService.class); + ObjectRegistration<SLIAPIService> rpcRegistration = mock( + ObjectRegistration.class); + when(rpcRegistry.registerRpcImplementation(any(Class.class), any(SLIAPIService.class))).thenReturn(rpcRegistration); // Load svclogic.properties and get a SvcLogicStore InputStream propStr = TestSliapiProvider.class.getResourceAsStream("/svclogic.properties"); @@ -172,8 +187,8 @@ public class TestSliapiProvider { pList.add(pBuilder.build()); inputBuilder.setSliParameter(pList); provider.executeGraph(inputBuilder.build()); - - + + // Invalid test - graph does not exist inputBuilder.setMode(ExecuteGraphInput.Mode.Sync); inputBuilder.setModuleName("sli"); @@ -193,7 +208,7 @@ public class TestSliapiProvider { pList.add(pBuilder.build()); inputBuilder.setSliParameter(pList); provider.executeGraph(inputBuilder.build()); - + assertTrue(provider.vlbcheck(mock(VlbcheckInput.class)) instanceof Future<?>); } |