com.ibm.tivoli.maximo.oslc.provider.action.unittest

Class TestImageAction

  • java.lang.Object
    • com.ibm.tivoli.maximo.oslc.provider.action.unittest.TestImageAction


  • public class TestImageAction
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor and Description
      TestImageAction() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addImageBase64()
      Test custom-encoding is base64.
      void addImageByteArray()
      Test custom-encoding is null.
      void addImageUriAndEndpoint()
      Test custom-encoding is null and content/type is image/jpeg for backwards compatibility Handle body as json.
      void addImageUriAndEndpointWithMimeType()
      Test custom-encoding is null and content/type is application/json Handle body as json, read mimetype from json body if it includes that.
      void checkHttpPostResult(java.net.HttpURLConnection httpConn, int targetResponseCode) 
      void createAsset()
      Create a new asset for image
      void deleteAsset() 
      void setAuth(java.lang.String user, java.lang.String pwd, java.net.HttpURLConnection con) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TestImageAction

        public TestImageAction()
    • Method Detail

      • createAsset

        public void createAsset()
                         throws java.lang.Exception
        Create a new asset for image
        Throws:
        java.lang.Exception
      • addImageByteArray

        public void addImageByteArray()
                               throws java.io.IOException,
                                      MXException
        Test custom-encoding is null. Handle body as byte array and update image after add image
        Throws:
        java.io.IOException
        MXException
      • addImageBase64

        public void addImageBase64()
                            throws java.io.IOException,
                                   MXException
        Test custom-encoding is base64. Handle body as base64 and update image without add image
        Throws:
        java.io.IOException
        MXException
      • addImageUriAndEndpoint

        public void addImageUriAndEndpoint()
                                    throws java.io.IOException,
                                           MXException
        Test custom-encoding is null and content/type is image/jpeg for backwards compatibility Handle body as json.
        Throws:
        java.io.IOException
        MXException
      • addImageUriAndEndpointWithMimeType

        public void addImageUriAndEndpointWithMimeType()
                                                throws java.io.IOException,
                                                       MXException
        Test custom-encoding is null and content/type is application/json Handle body as json, read mimetype from json body if it includes that. Otherwise parse from file name
        Throws:
        java.io.IOException
        MXException
      • deleteAsset

        public void deleteAsset()
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setAuth

        public void setAuth(java.lang.String user,
                            java.lang.String pwd,
                            java.net.HttpURLConnection con)
      • checkHttpPostResult

        public void checkHttpPostResult(java.net.HttpURLConnection httpConn,
                                        int targetResponseCode)
                                 throws java.io.IOException,
                                        MXException
        Throws:
        java.io.IOException
        MXException