Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Bookstore4
#xpathattributes
1/dmi-registry/cm-handles[@id='Bookstore5']/public-properties[@name='color']{"name": "color", "value": "won't match"}
2/dmi-registry/cm-handles[@id='PNFDemoBookstore4']/public-properties[@name='Contactcolor']{"name": "Contactcolor", "value": "newemailforstore@bookstore.com"}
3/dmi-registry/cm-handles[@id='Bookstore3']/public-properties[@name='color']{"name": "color", "value": "red"}
4/dmi-registry/cm-handles[@id='Bookstore3Bookstore2']/public-properties[@name='colorContact']{"name": "colorContact", "value": "rednewemailforstore2@bookstore.com"}
5/dmi-registry/cm-handles[@id='Bookstore2Bookstore1']/public-properties[@name='Contact']{"name": "Contact", "value": "newemailforstore2@newemailforstore@bookstore.com"}
6/dmi-registry/cm-handles[@id='Bookstore1Bookstore6']/public-properties[@name='Contactcolor']{"name": "Contactcolor", "value": "newemailforstore@bookstore.com12345"}
7

/dmi-registry/cm-handles[@id='Bookstore7']/public-properties[@name='color']

{"name": "color", "value": "12345"}
8/dmi-registry/cm-handles[@id='Bookstore8']/public-properties[@name='size']{"name": "size", "value": "large"}
9/dmi-registry/cm-handles[@id='Bookstore8']/public-properties[@name='color']{"name": "color", "value": "red"}


Code Block
languageyml
titleCreate CM Handles JSON
collapsetrue
{
    "dmiPlugin": "http://172.24.170.77:8783",
    "createdCmHandles": [
        {
            "cmHandle": "Bookstore1",
            "publicCmHandleProperties": {
                "Contact": "newemailforstore@bookstore.com"
            }
        },
        {
            "cmHandle": "Bookstore2",
            "publicCmHandleProperties": {
                "Contact": "newemailforstore2@bookstore.com"
            }
        },
        {
            "cmHandle": "Bookstore3",
            "publicCmHandleProperties": {
                "color": "red"
            }
        },
Code Block
languageyml
titleCreate CM Handles JSON
collapsetrue
{
    "dmiPlugin": "http://172.24.170.77:8783",
    "createdCmHandles": [
        {
            "cmHandle": "Bookstore1Bookstore4",
            "publicCmHandleProperties": {
                "Contactcolor": "newemailforstore@bookstore.com"
            }
        },
        {
            "cmHandle": "Bookstore2Bookstore5",
            "publicCmHandleProperties": {
                "Contactcolor": "newemailforstore2@bookstore.comwon't match"
            }
        },
        {
            "cmHandle": "Bookstore3Bookstore6",
            "publicCmHandleProperties": {
                "color": "red"12345
            }
        },
        {
            "cmHandle": "Bookstore4Bookstore7",
            "publicCmHandleProperties": {
                "color": "12345"
            }
        },
        {
            "cmHandle": "Bookstore5Bookstore8",
            "publicCmHandleProperties": {
                "color": "won't match"red",
                "size": "large"
            }
        }
    }
    ]
}]
}               



URL Used for all Requessts

...

#ScenarioRequestResponseNotes/Decisions
1

Both properties match

(Return CM Handles that Match

{
    "publicCmHandleProperties": {
        "Contact""newemailforstore@bookstore.com"
    }
}

[
    "Bookstore1",
    "PNFDemo"
]


2

Multiple Entries - both properties match

(Return CM Handles that Match

{
    "publicCmHandleProperties": {
        "Contactcolor" "newemailforstore@bookstore.comred",
        "colorsize" : "redlarge"
    }
}

[
    "Bookstore1Bookstore8",
    "Bookstore3",
    "PNFDemo"
]


3

No properties given

(Return All CM Handles which contain public properties

{

    "publicCmHandleProperties": {
    }
}

[
    "Bookstore4",
    "Bookstore5",
    "Bookstore6",
    "Bookstore7",
    "Bookstore1",
    "Bookstore2",
    "Bookstore3",
    "PNFDemoBookstore8"
]


Results - Edge Cases

#ScenarioRequestResponseNotes/Decisions
1

Value doesn't match 

(Return Empty Response

{
    "publicCmHandleProperties": {
        "Contact""wont match"
    }
}

[ ]
2

Unknown properties given

(Return Empty Response)

{
    "publicCmHandleProperties": {
        "UnknwnProperty""doesnt matter"
    }
}

[ ]
3

Empty value (valid)

(Return CM Handles Returned that Match

{

    "publicCmHandleProperties": {
        "color"""
    }
}

[
    "Bookstore4"
]


4

Empty property (invalid)

(BAD_REQUEST)

{

    "publicCmHandleProperties": {
        """doesnt matter "
    }
}

{
    "status""400 BAD_REQUEST",
    "message""Invalid data.",
    "details""Missing property Missing public property name - please supply a valid property please supply a valid name."
}


5

Multiple entries with one empty property (invalid)

(BAD_REQUEST)

{
    "publicCmHandleProperties": {
        "color" : "",
        "" : "doesnt matter",
        "Contact""newemailforstore@bookstore.com"
    }
}

{
    "status""400 BAD_REQUEST",
    "message""Invalid data.",
    "details""Missing property Missing public property name - please supply a valid property please supply a valid name."
}


6

Apostrophe in cm handle 

(Exception)

*** CPS can create a cm handle with a public property value that has an apostrophe but throws exception when queried ***

{
    "publicCmHandleProperties": {
        "color" : "won't match"
    }
}

{
    "status""500 INTERNAL_SERVER_ERROR",
    "message""Error while parsing cpsPath expression",
    "details""failed to parse at line 1 due to extraneous input 't' expecting {']', 'and'}"
}

Will handle this as and when it arises
7

CPS stores Integers as Strings.

Given the public properties below

Code Block
languageyml
{
    "cmHandle": "Bookstore6",
    publicCmHandleProperties": {
        "color": 12345
        }
}, {
    "cmHandle": "Bookstore7",
    "publicCmHandleProperties": {
        "color": "12345"
        }
}


When stored in CPS Integers are stored as Strings.

xpathattributes

/dmi-registry/cm-handles[@id='Bookstore6']/public-properties[@name='color']

{"name": "color", "value": "12345"}
/dmi-registry/cm-handles[@id='Bookstore7']/public-properties[@name='color']{"name": "color", "value": "12345"}

Therefore the two requests below return both cm handles regardless of wanting Integer or String.


{
    "publicCmHandleProperties": {
        "color" : "12345"
    }
}


{
    "publicCmHandleProperties": {
        "color"12345
    }
}

[
    "Bookstore6",
    "Bookstore7"
]

...