コード例 #1
0
void test1 (CIMClient &client)
{
    CIMObjectPath instanceName;
    CIMValue output;
    instanceName.setNameSpace (providerNamespace);
    instanceName.setClassName (CLASSNAME);

    Array < CIMParamValue > inParams;
    Array < CIMParamValue > outParams;

    AcceptLanguageList accLangs;
    accLangs.insert(LanguageTag("en-US"),1.0);
    accLangs.insert(LanguageTag("fr"),0.8);
    client.setRequestAcceptLanguages(accLangs);

    CIMValue retValue = client.invokeMethod (providerNamespace,
        instanceName,
        "testBrokerEnc",
        inParams,
        outParams);

    _checkUint32Value (retValue, 1);
}
コード例 #2
0
 virtual LanguageTag language() const { return LanguageTag(); }
コード例 #3
0
void
test03 (CIMClient & client)
{
  CIMObjectPath instanceName;

  instanceName.setNameSpace (providerNamespace);
  instanceName.setClassName (CLASSNAME);

  Array < CIMParamValue > inParams;
  Array < CIMParamValue > outParams;

  /*     uint32 TestCMPIBroker (
   *          [IN, Description (
   *          "The requested are to test different 
   *          CMPI data structure operations."),
   *          ValueMap { "1", "2", "3", "4", "5", "6"},
   *          Values {"CDGetType", "CDToString", "CDIsOfType",
   *                  "CMGetMessage",  "CMLogMessage","CDTraceMessage"}]
   *          uint32 Operation,
   *          [OUT, Description (
   *          " The result of what the operation carried out.")]
   *          string Result);
   *
   */
  {
    /* CDGetType */
    inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (1))));
    CIMValue retValue = client.invokeMethod (providerNamespace,
                         instanceName,
                         "TestCMPIBroker",
                         inParams,
                         outParams);
    // Check the return value. Make sure it is 0.
    _checkUint32Value (retValue, 0);

    PEGASUS_TEST_ASSERT (outParams.size () == 1);
    CIMValue paramValue = outParams[0].getValue ();
    _checkStringValue (paramValue, "CMPIArgs");
  }
  inParams.clear ();
  outParams.clear ();
  {
    /* CDToString */
    inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (2))));
    CIMValue retValue = client.invokeMethod (providerNamespace,
                         instanceName,
                         "TestCMPIBroker",
                         inParams,
                         outParams);
    // Check the return value. Make sure it is 0.
    _checkUint32Value (retValue, 0);

    PEGASUS_TEST_ASSERT (outParams.size () == 1);
    CIMValue paramValue = outParams[0].getValue ();
    _checkStringValue (paramValue, " Operation:2\n");
  }
  inParams.clear ();
  outParams.clear ();
  {
    /* CDIsOfType */
    inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (3))));
    CIMValue retValue = client.invokeMethod (providerNamespace,
                         instanceName,
                         "TestCMPIBroker",
                         inParams,
                         outParams);
    // Check the return value. Make sure it is 0.
    _checkUint32Value (retValue, 0);

    PEGASUS_TEST_ASSERT (outParams.size () == 1);
    CIMValue paramValue = outParams[0].getValue ();
    _checkStringValue (paramValue, "++++ CMPIArgs = Yes");
  }
  inParams.clear ();
  outParams.clear ();
  {
    /* CMGetMessage */
    inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (4))));
    CIMValue retValue = client.invokeMethod (providerNamespace,
                         instanceName,
                         "TestCMPIBroker",
                         inParams,
                         outParams);
    // Check the return value. Make sure it is 0.
    _checkUint32Value (retValue, 0);

    PEGASUS_TEST_ASSERT (outParams.size () == 1);
    CIMValue paramValue = outParams[0].getValue ();
    // If PEGASUS_USE_DEFAULT_MESSAGES is not set, we can't make an
    // assumption about what the value of the msg will be.
    if (useDefaultMsg)
    {
        _checkStringValue (paramValue, "CIM_ERR_SUCCESS: Successful.");
    }
  }
  inParams.clear ();
  outParams.clear ();
  {
    /* CMLogMessage */
    inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (5))));
    CIMValue retValue = client.invokeMethod (providerNamespace,
                         instanceName,
                         "TestCMPIBroker",
                         inParams,
                         outParams);
    // Check the return value. Make sure it is 0.
    _checkUint32Value (retValue, 0);
    // Nothing is returned
    PEGASUS_TEST_ASSERT (outParams.size () == 1);

    CIMValue paramValue = outParams[0].getValue ();
    PEGASUS_TEST_ASSERT (paramValue.isNull ());

  }
  inParams.clear ();
  outParams.clear ();
  {
    /* CMTraceMessage */
    inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (6))));
    CIMValue retValue = client.invokeMethod (providerNamespace,
                         instanceName,
                         "TestCMPIBroker",
                         inParams,
                         outParams);
    // Check the return value. Make sure it is 0.
    _checkUint32Value (retValue, 0);
    // Nothing is returned
    PEGASUS_TEST_ASSERT (outParams.size () == 1);

    CIMValue paramValue = outParams[0].getValue ();
    PEGASUS_TEST_ASSERT (paramValue.isNull ());

  }
  inParams.clear ();
  outParams.clear ();
  {
//       CMGetMessage2 
      inParams.append(CIMParamValue(
                          "Operation",
                          CIMValue(Uint32(7))));
      inParams.append(CIMParamValue(
                          "msgFile",
                          CIMValue(String("test/pegasusTest"))));
      inParams.append(CIMParamValue(
                          "msgId",
                          CIMValue(String("CIMStatusCode.CIM_ERR_SUCCESS"))));
      inParams.append(CIMParamValue(
                          "insert1",
                          CIMValue(String("rab oof is foo bar backwards"))));
      inParams.append(CIMParamValue(
                          "insert2",
                          CIMValue(Uint32(64001))));

      AcceptLanguageList accLangs;
      accLangs.insert(LanguageTag("en-US"),Real32(1.0));
      accLangs.insert(LanguageTag("fr"),Real32(0.8));
      client.setRequestAcceptLanguages(accLangs);

      CIMValue retValue = client.invokeMethod (providerNamespace,
          instanceName,
          "TestCMPIBroker",
          inParams,
          outParams);
      // Check the return value. Make sure it is 0.
      _checkUint32Value (retValue, 0);

      PEGASUS_TEST_ASSERT (outParams.size () == 1);
      CIMValue paramValue = outParams[0].getValue ();
      // If PEGASUS_USE_DEFAULT_MESSAGES is not set, we can't make an
      // assumption about what the value of the msg will be, or the
      // ContentLanguage.
#ifdef PEGASUS_HAS_MESSAGES
      if (useDefaultMsg)
      {
#endif
          _checkStringValue (paramValue, "CIM_ERR_SUCCESS: Successful.");
#ifdef PEGASUS_HAS_MESSAGES
      }
      else
      {
          ContentLanguageList contLangs;
          contLangs = client.getResponseContentLanguages();
          cout << "ContentLanguage size == " << contLangs.size() << endl;
          PEGASUS_TEST_ASSERT(contLangs.size() == 1);
          cout << "ContentLanguage == "
               << contLangs.getLanguageTag(0).toString();
          PEGASUS_TEST_ASSERT(
              contLangs.getLanguageTag(0).toString() == "en-US");
      }
#endif
      // Reset client
      accLangs.clear();
      client.setRequestAcceptLanguages(accLangs);
  }


    inParams.clear();
    outParams.clear();
    {
        // _testCMPIEnumeration
        inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (8))));
        CIMValue retValue = client.invokeMethod (providerNamespace,
                                                 instanceName,
                                                 "TestCMPIBroker",
                                                 inParams,
                                                 outParams);
        // Check the return value. Make sure it is 0.
        _checkUint32Value (retValue, 0);

        PEGASUS_TEST_ASSERT (outParams.size () == 1);
        CIMValue paramValue = outParams[0].getValue ();
        PEGASUS_TEST_ASSERT (paramValue.isNull ());
    }

    
    inParams.clear();
    outParams.clear();
    {
        // _testCMPIArray
        inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (9))));
        CIMValue retValue = client.invokeMethod (providerNamespace,
                                                 instanceName,
                                                 "TestCMPIBroker",
                                                 inParams,
                                                 outParams);
        // Check the return value. Make sure it is 0.
        _checkUint32Value (retValue, 0);

        PEGASUS_TEST_ASSERT (outParams.size () == 1);
        CIMValue paramValue = outParams[0].getValue ();
        PEGASUS_TEST_ASSERT (paramValue.isNull ());
    }

    inParams.clear();
    outParams.clear();
    {
        // _testCMPIcontext

        inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (10))));
        CIMValue retValue = client.invokeMethod (providerNamespace,
                             instanceName,
                             "TestCMPIBroker",
                             inParams,
                             outParams);
        // Check the return value. Make sure it is 0.
        _checkUint32Value (retValue, 0);

        PEGASUS_TEST_ASSERT (outParams.size () == 1);
        CIMValue paramValue = outParams[0].getValue ();
        PEGASUS_TEST_ASSERT (paramValue.isNull ());
    }

    inParams.clear();
    outParams.clear();
    {
        // _testCMPIDateTime

        inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (11))));
        CIMValue retValue = client.invokeMethod (providerNamespace,
                                                 instanceName,
                                                 "TestCMPIBroker",
                                                 inParams,
                                                 outParams);
        // Check the return value. Make sure it is 0.
        _checkUint32Value (retValue, 0);
        // Nothing is returned
        PEGASUS_TEST_ASSERT (outParams.size () == 1);

        CIMValue paramValue = outParams[0].getValue ();
        PEGASUS_TEST_ASSERT (paramValue.isNull ());
    }

    inParams.clear();
    outParams.clear();
    {
      //   _testCMPIInstance

        inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (12))));

        CIMValue retValue = client.invokeMethod (providerNamespace,
                                                 instanceName,
                                                 "TestCMPIBroker",
                                                 inParams,
                                                 outParams);
        // Check the return value. Make sure it is 0.
        _checkUint32Value (retValue, 0);
        // Nothing is returned
        PEGASUS_TEST_ASSERT (outParams.size () == 1);
        CIMValue paramValue = outParams[0].getValue ();
        PEGASUS_TEST_ASSERT (paramValue.isNull ());
    }

    inParams.clear();
    outParams.clear();
    {
    //     _testCMPIObjectPath

        inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (13))));
        CIMValue retValue = client.invokeMethod (providerNamespace,
                                                 instanceName,
                                                 "TestCMPIBroker",
                                                 inParams,
                                                 outParams);
        // Check the return value. Make sure it is 0.
        _checkUint32Value (retValue, 0);
        // Nothing is returned
        PEGASUS_TEST_ASSERT (outParams.size () == 1);

        CIMValue paramValue = outParams[0].getValue ();
        PEGASUS_TEST_ASSERT (paramValue.isNull ());
    }

    inParams.clear();
    outParams.clear();
    {
        //  _testCMPIResult

        inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (14))));
        CIMValue retValue = client.invokeMethod (providerNamespace,
                                                 instanceName,
                                                 "TestCMPIBroker",
                                                 inParams,
                                                 outParams);
        // Check the return value. Make sure it is 0.
        _checkUint32Value (retValue, 0);
        // Nothing is returned
        PEGASUS_TEST_ASSERT (outParams.size () == 1);

        CIMValue paramValue = outParams[0].getValue ();
        PEGASUS_TEST_ASSERT (paramValue.isNull ());
    }

    inParams.clear();
    outParams.clear();
    {
        //  _testCMPIString

        inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (15))));
        CIMValue retValue = client.invokeMethod (providerNamespace,
                                                 instanceName,
                                                 "TestCMPIBroker",
                                                 inParams,
                                                 outParams);
        // Check the return value. Make sure it is 0.
        _checkUint32Value (retValue, 0);
        // Nothing is returned
        PEGASUS_TEST_ASSERT (outParams.size () == 1);

        CIMValue paramValue = outParams[0].getValue ();
        PEGASUS_TEST_ASSERT (paramValue.isNull ());
    }

    inParams.clear();
    outParams.clear();
    {
        //_testCMPIArgs

        inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (16))));
        CIMValue retValue = client.invokeMethod (providerNamespace,
                                                 instanceName,
                                                 "TestCMPIBroker",
                                                 inParams,
                                                 outParams);
        //Check the return value. Make sure it is 0.
        _checkUint32Value (retValue, 0);
        // Nothing is returned
        PEGASUS_TEST_ASSERT (outParams.size () == 1);

        CIMValue paramValue = outParams[0].getValue ();
        PEGASUS_TEST_ASSERT (paramValue.isNull ());
    }
    inParams.clear();
    outParams.clear();
    {
         //_testCMPIBroker

        inParams.append (CIMParamValue ("Operation", CIMValue (Uint32 (17))));
        CIMValue retValue = client.invokeMethod (providerNamespace,
                                                 instanceName,
                                                 "TestCMPIBroker",
                                                 inParams,
                                                 outParams);
        //Check the return value. Make sure it is 0.
        _checkUint32Value (retValue, 0);
        // Nothing is returned
        PEGASUS_TEST_ASSERT (outParams.size () == 1);

        CIMValue paramValue = outParams[0].getValue ();

        PEGASUS_TEST_ASSERT (paramValue.isNull ());
    }

}
コード例 #4
0
Soprano::LanguageTag Soprano::LiteralValue::language() const
{
    return d ? d->language() : LanguageTag();
}