Commit 860b67bc authored by lopezaguilar's avatar lopezaguilar
Browse files

Review tags and adding error management

parent d4307d59
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -18,28 +18,28 @@ ${reason_204}= No Content

*** Test Cases ***    DETAILS    KIND
052_01_01 List @contexts with neither details or kind and not previously created @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    ${EMPTY}    ${EMPTY}
052_01_02 List @contexts with no details and kind equal to hosted and not previously created @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    ${EMPTY}    Hosted
052_01_03 List @contexts with no details and kind equal to cached and not previously created @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    ${EMPTY}    Cached
052_01_04 List @contexts with no details and kind equal to implicitlycreated and not previously created @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    ${EMPTY}    ImplicitlyCreated
052_01_05 List @contexts with details equal to false and no kind and not previously created @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    false    ${EMPTY}
052_01_06 List @contexts with details equal to false and kind equal to hosted and not previously created @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    false    Hosted
052_01_07 List @contexts with details equal to false and kind equal to cached and not previously created @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    false    Cached
052_01_08 List @contexts with details equal to false and kind equal to implicitlycreated and not previously created @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    false    ImplicitlyCreated


+9 −11
Original line number Diff line number Diff line
@@ -20,28 +20,28 @@ ${reason_204}= No Content

*** Test Cases ***    DETAILS    KIND
052_02_01 List @contexts with neither details or kind and with previously one add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    ${EMPTY}    ${EMPTY}
052_02_02 List @contexts with no details and kind equal to hosted and with previously one add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    ${EMPTY}    Hosted
052_02_03 List @contexts with no details and kind equal to cached and with previously one add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    ${EMPTY}    Cached
052_02_04 List @contexts with no details and kind equal to implicitlycreated and with previously one add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    ${EMPTY}    ImplicitlyCreated
052_02_05 List @contexts with details equal to false and no kind and with previously one add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    false    ${EMPTY}
052_02_06 List @contexts with details equal to false and kind equal to hosted and with previously one add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    false    Hosted
052_02_07 List @contexts with details equal to false and kind equal to cached abd with previously one add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    false    Cached
052_02_08 List @contexts with details equal to false and kind equal to implicitlycreated and with previously one add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    false    ImplicitlyCreated


@@ -63,6 +63,4 @@ List @contexts with one previous created @context
    Check Context Response Body Containing a list with more than one URL    ${response.json()}    2    ${uri}

Delete Initial @context
    ${response_delete}=    Delete a @context without reload    ${uri}
    Check Response Status Code    204    ${response_delete.status_code}
    Check Response Reason set to    ${response_delete.reason}    ${reason_204}
    Delete a @context    ${uri}
+9 −12
Original line number Diff line number Diff line
@@ -22,28 +22,28 @@ ${reason_204}= No Content

*** Test Cases ***    DETAILS    KIND
052_03_01 List @contexts with neither details or kind and with previously several add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    ${EMPTY}    ${EMPTY}
052_03_02 List @contexts with no details and kind equal to hosted and with previously several add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    ${EMPTY}    Hosted
052_03_03 List @contexts with no details and kind equal to cached and with previously several add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    ${EMPTY}    Cached
052_03_04 List @contexts with no details and kind equal to implicitlycreated and with previously several add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    ${EMPTY}    ImplicitlyCreated
052_03_05 List @contexts with details equal to false and no kind and with previously several add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    false    ${EMPTY}
052_03_06 List @contexts with details equal to false and kind equal to hosted and with previously several add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    false    Hosted
052_03_07 List @contexts with details equal to false and kind equal to cached abd with previously several add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    false    Cached
052_03_08 List @contexts with details equal to false and kind equal to implicitlycreated and with previously several add @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    false    ImplicitlyCreated


@@ -83,8 +83,5 @@ List @contexts with several previous created @context
Delete Initial @contexts
    FOR    ${uri}    IN    @{uris}
        Log    URI: ${uri}

        ${response_delete}=    Delete a @context without reload    ${uri}
        Check Response Status Code    204    ${response_delete.status_code}
        Check Response Reason set to    ${response_delete.reason}    ${reason_204}
        Delete a @context    ${uri}
    END
+5 −5
Original line number Diff line number Diff line
@@ -18,19 +18,19 @@ ${reason_204}= No Content

*** Test Cases ***    DETAILS    KIND
052_04_01 List @contexts with no details and kind equal to other and not previously created @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    ${EMPTY}    other
052_04_02 List @contexts with details equal to false and kind equal to implicitlycreated and not previously created @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    other    ${EMPTY}
052_04_03 List @contexts with details equal to false and kind equal to other and not previously created @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    other    other
052_04_04 List @contexts with no details and kind equal to other and not previously created @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    true    other
052_04_05 List @contexts with details equal to false and kind equal to implicitlycreated and not previously created @context
    [Tags]    ctx-serve    5_13_4
    [Tags]    ctx-serve    5_13_3
    other    Hosted


+80 −0
Original line number Diff line number Diff line
*** Settings ***
Documentation       Check that you can list all the @context available in the broker with several add @contexts with details equal to true

Resource            ${EXECDIR}/resources/ApiUtils/JSON-LD@ContextServer.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource
Resource            ${EXECDIR}/resources/HttpUtils.resource
Library             Collections

Test Setup          Create Initial set of @contexts
Test Teardown       Delete Initial @contexts
Test Template       List @contexts with several previous created @context


*** Variables ***
${first_filename}=      @context-minimal-valid.json
${second_filename}=     @context-minimal-second-valid.json
${third_filename}=      @context-minimal-third-valid.json
${reason_200}=          OK
${reason_204}=          No Content


*** Test Cases ***    DETAILS    KIND
052_03_05 List @contexts with details equal to false and no kind and with previously several add @context
    [Tags]    ctx-serve    5_13_3
    true    ${EMPTY}
052_03_06 List @contexts with details equal to false and kind equal to hosted and with previously several add @context
    [Tags]    ctx-serve    5_13_3
    true    Hosted
052_03_07 List @contexts with details equal to false and kind equal to cached abd with previously several add @context
    [Tags]    ctx-serve    5_13_3
    true    Cached
052_03_08 List @contexts with details equal to false and kind equal to implicitlycreated and with previously several add @context
    [Tags]    ctx-serve    5_13_3
    true    ImplicitlyCreated


*** Keywords ***
Create Initial set of @contexts
    ${response}=    Add a new @context    ${first_filename}
    Check Response Status Code    201    ${response.status_code}
    ${first_uri}=    Fetch Id From Response Location Header    ${response.headers}
    Set Suite Variable    ${first_uri}

    ${response}=    Add a new @context    ${second_filename}
    Check Response Status Code    201    ${response.status_code}
    ${second_uri}=    Fetch Id From Response Location Header    ${response.headers}
    Set Suite Variable    ${second_uri}

    ${response}=    Add a new @context    ${third_filename}
    Check Response Status Code    201    ${response.status_code}
    ${third_uri}=    Fetch Id From Response Location Header    ${response.headers}
    Set Suite Variable    ${third_uri}

    @{uris}=    Create List
    Append To List    ${uris}    ${first_uri}
    Append To List    ${uris}    ${second_uri}
    Append To List    ${uris}    ${third_uri}
    Set Suite Variable    ${uris}

List @contexts with several previous created @context
    [Documentation]    Check that you can list @contexts
    [Arguments]    ${details}    ${kind}

    ${response}=    List @contexts    ${details}    ${kind}

    Check Response Status Code    200    ${response.status_code}
    Check Response Reason set to    ${response.reason}    ${reason_200}

    # We need to check the list of responses
    Check Context Response Body Containing a JSONObject with details of the @contexts
    ...    ${response.json()}
    ...    4
    ...    ${uris}

Delete Initial @contexts
    FOR    ${uri}    IN    @{uris}
        Log    URI: ${uri}
        Delete a @context    ${uri}
    END
Loading