Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
wspproxytest.cpp File Reference
#include "nsCOMPtr.h"
#include "wspproxytest.h"
#include "nsString.h"
#include "nsIInterfaceInfoManager.h"
#include "nsIServiceManager.h"
#include "nsIProperty.h"
#include "nsIVariant.h"

Go to the source code of this file.

Defines

#define STRING_VAL   "Hello world"
#define GET_AND_TEST_NAME(_name)
#define GET_AND_TEST(_t, _n, _name, _val)
#define GET_AND_TEST(_t, _name, _val)
#define ISPRIMEURL   "http://ray.dsl.xmission.com:8080/wsdl/statistics.wsdl"
#define ISPRIMEPORT   "SpheonJSAOPStatisticsPort"

Functions

 NS_IMPL_ISUPPORTS4_CI (WSPProxyTest, nsIWSPProxyTest, nsIWSDLLoadListener, nsIWebServiceErrorHandler, SpheonJSAOPStatisticsPortTypeListener) nsresult WSPProxyTest

Variables

const PRUint8 sInt8Val = 2
const PRInt16 sInt16Val = 0x1234
const PRInt32 sInt32Val = 0x12345678
const PRInt64 sInt64Val = LL_INIT(0x12345678, 0x87654321)
const PRUint8 sUint8Val = 2
const PRUint16 sUint16Val = 0x1234
const PRUint32 sUint32Val = 0x12345678
const PRUint64 sUint64Val = LL_INIT(0x12345678, 0x87654321)
const PRBool sBoolVal = PR_TRUE
const float sFloatVal = 0.0
const double sDoubleVal = 0.03
const char sCharVal = 'a'
const PRUnichar sWcharVal = PRUnichar('a')
const PRUint32 sArray1Length = 3
const PRUint32 sArray1 [] = { 4, 23, 37 }
const PRUint32 sArray2Length = 4
const double sArray2 [] = { 4.234, 23.97, 3434.2945, 0.03 }

Define Documentation

#define GET_AND_TEST (   _t,
  _n,
  _name,
  _val 
)
Value:
GET_AND_TEST_NAME(_name)                                                \
    _t _name;                                                               \
    rv = val->GetAs##_n(&_name);                                            \
    if (NS_FAILED(rv)) {                                                    \
      aResult.Assign(NS_LITERAL_STRING("WSPProxyTest: Failed getting value for property ") + NS_LITERAL_STRING(#_name)); \
      return rv;                                                            \
    }                                                                       \
    if (_name != _val) {                                                    \
      aResult.Assign(NS_LITERAL_STRING("WSPProxyTest: Value doesn't match for property ") + NS_LITERAL_STRING(#_name)); \
      return NS_ERROR_FAILURE;                                              \
    }
#define GET_AND_TEST (   _t,
  _name,
  _val 
)
Value:
_t _name;                                                                 \
  rv = ct->Get##_name(&_name);                                              \
  if (NS_FAILED(rv)) {                                                      \
    aResult.Assign(NS_LITERAL_STRING("WSPProxyTest: Failed to get value for attribute") + NS_LITERAL_STRING(#_name)); \
    return NS_OK;                                                           \
  }                                                                         \
  if (_name != _val) {                                                      \
    aResult.Assign(NS_LITERAL_STRING("WSPProxyTest: Value doesn't match for attribute ") + NS_LITERAL_STRING(#_name)); \
    return NS_OK;                                                           \
  }
#define GET_AND_TEST_NAME (   _name)
Value:
rv = enumerator->GetNext(getter_AddRefs(sup));                        \
    if (NS_FAILED(rv)) {                                                  \
      aResult.Assign(NS_LITERAL_STRING("WSPProxyTest: Failed getting property ") + NS_LITERAL_STRING(#_name));    \
      return rv;                                                          \
    }                                                                     \
                                                                          \
    prop = do_QueryInterface(sup, &rv);                                   \
    if (NS_FAILED(rv)) {                                                  \
      return rv;                                                          \
    }                                                                     \
                                                                          \
    prop->GetName(propName);                                              \
    if (!propName.EqualsLiteral(#_name)) {                    \
      aResult.Assign(NS_LITERAL_STRING("WSPProxyTest: Name doesn't match for property ") + NS_LITERAL_STRING(#_name)); \
      return NS_ERROR_FAILURE;                                            \
    }                                                                     \
    prop->GetValue(getter_AddRefs(val));                                  \
    if (!val) {                                                           \
      return NS_ERROR_FAILURE;                                            \
    }
#define ISPRIMEPORT   "SpheonJSAOPStatisticsPort"
#define ISPRIMEURL   "http://ray.dsl.xmission.com:8080/wsdl/statistics.wsdl"
#define STRING_VAL   "Hello world"

Definition at line 61 of file wspproxytest.cpp.


Function Documentation

Definition at line 75 of file wspproxytest.cpp.

{
  static nsIID sComplexTypeIID = NS_GET_IID(nsIWSPTestComplexType);
  nsCOMPtr<WSPTestComplexType> ct = new WSPTestComplexType();
  if (!ct) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  nsresult rv;
  nsCOMPtr<nsIInterfaceInfoManager> manager = do_GetService(NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID, &rv);
  if (NS_FAILED(rv)) {
    return rv;
  }

  nsCOMPtr<nsIInterfaceInfo> iinfo;
  rv = manager->GetInfoForIID(&sComplexTypeIID, getter_AddRefs(iinfo));
  if (NS_FAILED(rv)) {
    return rv;
  }
  *aInfo = iinfo;
  NS_ADDREF(*aInfo);

  nsCOMPtr<nsIWebServiceComplexTypeWrapper> wrapper = do_CreateInstance(NS_WEBSERVICECOMPLEXTYPEWRAPPER_CONTRACTID, &rv);
  if (NS_FAILED(rv)) {
    return rv;
  }
  rv = wrapper->Init(ct, iinfo);
  if (NS_FAILED(rv)) {
    return rv;
  }

  *aWrapper = wrapper;
  NS_ADDREF(*aWrapper);
  return NS_OK;
}

Here is the call graph for this function:


Variable Documentation

const PRUint32 sArray1[] = { 4, 23, 37 }

Definition at line 63 of file wspproxytest.cpp.

Definition at line 62 of file wspproxytest.cpp.

const double sArray2[] = { 4.234, 23.97, 3434.2945, 0.03 }

Definition at line 65 of file wspproxytest.cpp.

Definition at line 64 of file wspproxytest.cpp.

Definition at line 56 of file wspproxytest.cpp.

const char sCharVal = 'a'

Definition at line 59 of file wspproxytest.cpp.

const double sDoubleVal = 0.03

Definition at line 58 of file wspproxytest.cpp.

const float sFloatVal = 0.0

Definition at line 57 of file wspproxytest.cpp.

Definition at line 49 of file wspproxytest.cpp.

const PRInt32 sInt32Val = 0x12345678

Definition at line 50 of file wspproxytest.cpp.

const PRInt64 sInt64Val = LL_INIT(0x12345678, 0x87654321)

Definition at line 51 of file wspproxytest.cpp.

Definition at line 48 of file wspproxytest.cpp.

Definition at line 53 of file wspproxytest.cpp.

const PRUint32 sUint32Val = 0x12345678

Definition at line 54 of file wspproxytest.cpp.

const PRUint64 sUint64Val = LL_INIT(0x12345678, 0x87654321)

Definition at line 55 of file wspproxytest.cpp.

Definition at line 52 of file wspproxytest.cpp.

Definition at line 60 of file wspproxytest.cpp.