本文整理汇总了C++中PEGASUS_STD函数的典型用法代码示例。如果您正苦于以下问题:C++ PEGASUS_STD函数的具体用法?C++ PEGASUS_STD怎么用?C++ PEGASUS_STD使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PEGASUS_STD函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main (int argc, char* argv [])
{
MTTestClient command = MTTestClient ();
int rc;
try
{
command.setCommand (argc, argv);
}
catch (const CommandFormatException& cfe)
{
cerr << MTTestClient::COMMAND_NAME << ": " << cfe.getMessage ()
<< endl;
cerr << command.getUsage () << endl;
exit (Command::RC_ERROR);
}
catch (const Exception& e)
{
cerr << MTTestClient::COMMAND_NAME << ": " << e.getMessage ()
<< endl;
}
rc = command.execute (cout, cerr);
PEGASUS_STD(cout) << "+++++ passed all tests" << PEGASUS_STD(endl);
exit (rc);
return 0;
}
示例2: main
int main (int argc, char** argv)
{
CIMClient client;
try
{
client.connectLocal ();
}
catch (Exception & e)
{
PEGASUS_STD (cerr) << e.getMessage () << PEGASUS_STD (endl);
return -1;
}
if (argc != 3)
{
_usage ();
return 1;
}
const char* opt = argv[1];
const char* optLang = argv[2];
String qlang(optLang);
#ifndef PEGASUS_ENABLE_CQL
if (qlang == "DMTF:CQL")
{
PEGASUS_STD(cout) << "+++++ cql test disabled" << PEGASUS_STD(endl);
return 0;
}
#endif
return _test(client, opt, qlang);
}
示例3: main
int main (int argc, char** argv)
{
String stringVal;
verbose = (getenv("PEGASUS_TEST_VERBOSE")) ? true : false;
CIMClient client;
try
{
client.connectLocal ();
}
catch (Exception & e)
{
PEGASUS_STD (cerr) << e.getMessage () << PEGASUS_STD (endl);
return -1;
}
_enumerateInstanceNames(client);
_getInstance(client);
_setProperty(client, 7890);
_getProperty(client);
// getProperty() only returns CIMValues of type String.
value.get(stringVal);
PEGASUS_TEST_ASSERT(atoi((const char*)stringVal.getCString())==7890);
_setProperty(client,1234);
_getProperty(client);
// getProperty() only returns CIMValues of type String.
// Verify that setProperty worked as expected.
value.get(stringVal);
PEGASUS_TEST_ASSERT(atoi((const char*)stringVal.getCString())==1234);
return 0;
}
示例4: _usage
void _usage ()
{
PEGASUS_STD (cerr)
<< "Usage: TestDisableEnable2 "
<< "{setup | setup2 | create | create2 "
<< "| sendSucceed | sendFail | sendBlock "
<< "| delete | delete2 | cleanup | cleanup2} {WQL | DMTF:CQL}"
<< PEGASUS_STD (endl);
}
示例5: _test
int _test(CIMClient& client, const char* opt, String& qlang)
{
if (String::equalNoCase (opt, "setup"))
{
_setup (client, qlang);
}
else if (String::equalNoCase (opt, "setup2"))
{
_setup2 (client, qlang);
}
else if (String::equalNoCase (opt, "create"))
{
_create (client);
}
else if (String::equalNoCase (opt, "create2"))
{
_create2 (client);
}
else if (String::equalNoCase (opt, "sendSucceed"))
{
_sendSucceed (client);
}
else if (String::equalNoCase (opt, "sendFail"))
{
_sendFail (client);
}
else if (String::equalNoCase (opt, "sendBlock"))
{
_sendBlock (client);
}
else if (String::equalNoCase (opt, "delete"))
{
_delete (client);
}
else if (String::equalNoCase (opt, "delete2"))
{
_delete2 (client);
}
else if (String::equalNoCase (opt, "cleanup"))
{
_cleanup (client);
}
else if (String::equalNoCase (opt, "cleanup2"))
{
_cleanup2 (client);
}
else
{
PEGASUS_STD (cerr) << "Invalid option: " << opt
<< PEGASUS_STD (endl);
_usage ();
return -1;
}
return 0;
}
示例6: PEGASUS_STD
void MessageQueueService::handle_CimServiceStop(CimServiceStop *req)
{
#ifdef MESSAGEQUEUESERVICE_DEBUG
PEGASUS_STD(cout) << getQueueName() << "received STOP" << PEGASUS_STD(endl);
#endif
// set the stopeed bit and update
_capabilities |= module_capabilities::stopped;
_make_response(req, async_results::CIM_STOPPED);
// now tell the meta dispatcher we are stopped
update_service(_capabilities, _mask);
}
示例7: PEGASUS_STD
void OOPModuleFailureTestProvider::invokeMethod (
const OperationContext & context,
const CIMObjectPath & objectReference,
const CIMName & methodName,
const Array <CIMParamValue> & inParameters,
MethodResultResponseHandler & handler)
{
Boolean sendIndication = false;
String identifier;
handler.processing ();
if (objectReference.getClassName ().equal ("FailureTestIndication") &&
_enabled)
{
if (methodName.equal ("SendTestIndication"))
{
if ((inParameters.size() > 0) &&
(inParameters[0].getParameterName () == "identifier"))
{
inParameters[0].getValue().get(identifier);
}
sendIndication = true;
handler.deliver (CIMValue (0));
}
}
else
{
handler.deliver (CIMValue (1));
PEGASUS_STD (cout) << "Provider is not enabled." <<
PEGASUS_STD (endl);
}
handler.complete ();
if (sendIndication)
{
_generateIndication (_handler, identifier);
}
//
// If I am the OOPModuleInvokeFailureTestProvider, fail (i.e. exit)
//
if (String::equalNoCase (_providerName,
"OOPModuleInvokeFailureTestProvider"))
{
if (methodName.equal ("Fail"))
{
exit (-1);
}
}
}
示例8: removeErrorInstance
int removeErrorInstance(CIMClient& client)
{
try
{
client.deleteInstance(TEST_NAMESPACE, errorPath);
}
catch (Exception & e)
{
PEGASUS_STD(cout)
<< "Exception encountered while removing Error Instance: "
<< e.getMessage() << PEGASUS_STD(endl);
}
return 0;
}
示例9: retrieveIndicationInstance
int retrieveIndicationInstance(CIMClient& client)
{
// Approximates a timeout, each loop is roughly 1 second
Uint32 loopCount = 0;
while ((receivedIndications == 0) && (loopCount < MAX_COUNT))
{
Thread::sleep(1000);
loopCount++;
}
AutoMutex a(*mut);
Array<CIMInstance> indications;
try
{
indications = client.enumerateInstances(
TEST_NAMESPACE, "PG_InstMethodIndication");
}
catch (Exception& e)
{
cout << "Exception caught while enumerating indications: "
<< e.getMessage() << endl;
return -1;
}
if (indications.size() != 5)
{
cout << "Expected to get one instance. Received "
<< indications.size() << endl;
return -1;
}
indicationInstance.reset(new CIMInstance(indications[0]));
if (receivedIndication.get() == 0)
{
PEGASUS_STD(cout) << "Did not receive indication via listener" <<
PEGASUS_STD(endl);
return -1;
}
if (!indicationInstance->identical(*receivedIndication))
{
PEGASUS_STD(cout)
<< "Indication instance retrieved via listener does not match "
<< "instance retrieved via enumeration" << PEGASUS_STD(endl);
return -1;
}
return 0;
}
示例10: main
int main(int argc, char** argv)
{
verbose = (getenv ("PEGASUS_TEST_VERBOSE")) ? true : false;
const char* _pegHome = getenv ("PEGASUS_HOME");
if (_pegHome == NULL)
{
PEGASUS_STD (cout) << argv[0] << " +++++ tests failed: "
<< "PEGASUS_HOME environment variable must be set"
<< PEGASUS_STD (endl);
return -1;
}
ConfigManager::setPegasusHome(_pegHome);
try
{
String name;
String ver;
name = "C++Default";
ver = "2.1.0";
PEGASUS_TEST_ASSERT(
ProviderManagerMap::instance().isValidProvMgrIfc(name, ver));
ver = "2.6.0";
PEGASUS_TEST_ASSERT(
ProviderManagerMap::instance().isValidProvMgrIfc(name, ver));
name = "Junk";
PEGASUS_TEST_ASSERT(
!ProviderManagerMap::instance().isValidProvMgrIfc(name, ver));
#ifdef PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER
name = "CMPI";
ver = "2.0.0";
PEGASUS_TEST_ASSERT(
ProviderManagerMap::instance().isValidProvMgrIfc(name, ver));
ver = "1.2.3";
PEGASUS_TEST_ASSERT(
!ProviderManagerMap::instance().isValidProvMgrIfc(name, ver));
#endif
#ifdef PEGASUS_ENABLE_JMPI_PROVIDER_MANAGER
name = "JMPI";
ver = "2.2.0";
PEGASUS_TEST_ASSERT(
ProviderManagerMap::instance().isValidProvMgrIfc(name, ver));
#endif
}
catch(Exception& e)
{
PEGASUS_STD(cerr) << "Error: " << e.getMessage() << PEGASUS_STD(endl);
PEGASUS_STD (cout) << argv[0] << " +++++ tests failed"
<< PEGASUS_STD (endl);
exit(-1);
}
PEGASUS_STD(cout) << argv[0] << " +++++ passed all tests"
<< PEGASUS_STD(endl);
return 0;
}
示例11: _sendBlock
void _sendBlock (CIMClient & client)
{
try
{
_sendIndicationShouldBeBlocked (client);
}
catch (Exception & e)
{
PEGASUS_STD (cerr) << "sendBlock failed: " << e.getMessage ()
<< PEGASUS_STD (endl);
exit (-1);
}
PEGASUS_STD (cout) << "+++++ sendBlock completed successfully"
<< PEGASUS_STD (endl);
}
示例12: _cleanup2
void _cleanup2 (CIMClient & client)
{
try
{
_deleteHandlerInstance (client, String ("DEHandler02"), NAMESPACE2);
_deleteFilterInstance (client, String ("DEFilter02"), NAMESPACE1);
}
catch (Exception & e)
{
PEGASUS_STD (cerr) << "cleanup2 failed: " << e.getMessage ()
<< PEGASUS_STD (endl);
exit (-1);
}
PEGASUS_STD (cout) << "+++++ cleanup2 completed successfully"
<< PEGASUS_STD (endl);
}
示例13: _delete2
void _delete2 (CIMClient & client)
{
try
{
_deleteSubscriptionInstance (client, String ("DEFilter02"),
String ("DEHandler02"), NAMESPACE1, NAMESPACE2, NAMESPACE3);
}
catch (Exception & e)
{
PEGASUS_STD (cerr) << "delete2 failed: " << e.getMessage ()
<< PEGASUS_STD (endl);
exit (-1);
}
PEGASUS_STD (cout) << "+++++ delete2 completed successfully"
<< PEGASUS_STD (endl);
}
示例14: _testDuplicate
void _testDuplicate(CIMClient &client)
{
CIMObjectPath filterPath;
CIMObjectPath handlerPath;
CIMObjectPath subscriptionPath;
try
{
handlerPath = CreateHandler1Instance(client,
PEGASUS_NAMESPACENAME_INTEROP);
filterPath = CreateFilterInstance(client,
QUERY1, "WQL", "Filter1",
PEGASUS_NAMESPACENAME_INTEROP);
subscriptionPath = CreateSbscriptionInstance(client, handlerPath,
filterPath, PEGASUS_NAMESPACENAME_INTEROP);
_createDuplicate(client, String::EMPTY, CIMNamespaceName(),
filterPath, String::EMPTY, CIMNamespaceName(), handlerPath);
_createDuplicate(client, String::EMPTY,
PEGASUS_NAMESPACENAME_INTEROP, filterPath,
String::EMPTY,PEGASUS_NAMESPACENAME_INTEROP, handlerPath);
_createDuplicate(client, "127.0.0.1",
PEGASUS_NAMESPACENAME_INTEROP, filterPath,
String::EMPTY, CIMNamespaceName(), handlerPath);
_createDuplicate(client, "127.0.0.1",PEGASUS_NAMESPACENAME_INTEROP,
filterPath, "127.0.0.1", PEGASUS_NAMESPACENAME_INTEROP,
handlerPath);
_createDuplicate(client, String::EMPTY, CIMNamespaceName(),
filterPath, "127.0.0.1", PEGASUS_NAMESPACENAME_INTEROP,
handlerPath);
_checkSubscriptionCount(client);
DeleteInstance(client, subscriptionPath, PEGASUS_NAMESPACENAME_INTEROP);
DeleteInstance(client, filterPath, PEGASUS_NAMESPACENAME_INTEROP);
DeleteInstance(client, handlerPath, PEGASUS_NAMESPACENAME_INTEROP);
}
catch (const CIMException &e)
{
PEGASUS_STD(cerr) << "Exception: " << e.getMessage()
<< PEGASUS_STD (endl);
PEGASUS_TEST_ASSERT(0);
}
}
示例15: verifyCertificate
static Boolean verifyCertificate(SSLCertificateInfo &certInfo)
{
#ifdef DEBUG
PEGASUS_STD(cout) << certInfo.getSubjectName() << endl;
#endif
//ATTN-NB-03-05132002: Add code to handle server certificate verification.
return true;
}