Esempio n. 1
0
int main(int argc, char** argv)
{
    verbose = getenv("PEGASUS_TEST_VERBOSE") ? true : false;

    Stopwatch sw;

    sw.start();

    System::sleep(5);

    sw.stop();

    double elapsed = sw.getElapsed();

    if(verbose)
    {
        sw.printElapsed();
    }

    PEGASUS_TEST_ASSERT((elapsed >= 4.5) && (elapsed <= 5.5));

    cout << argv[0] << " +++++ passed all tests" << endl;

    return 0;
}
Esempio n. 2
0
static void _testRetryAttemptsExceededIndications(CIMClient &client)
{
    Stopwatch watch;
    watch.start();
    cout << "Testing the retry attempts exceeded indications..." << endl;
    _generateIndications(client, MAX_INDICATIONS);
    System::sleep(3);
    _generateIndications(client, MAX_INDICATIONS);
    _waitForSequenceIdentifierLifetimeExpiration(client, 2 * MAX_INDICATIONS);
    watch.stop();
    cout << "Completed in ";
    watch.printElapsed();
}
Esempio n. 3
0
static void _testIndicationsWithListenerNotRunning(CIMClient &client)
{
    Stopwatch watch;
    watch.start();
    cout << "Testing indications with listener not running..." << endl;
    CIMListener listener(2003);
    DeliveryRetryTestConsumer* consumer = new DeliveryRetryTestConsumer("1");
    listener.addConsumer(consumer);
    _generateIndications(client, MAX_INDICATIONS);
    _waitForNextMaxSequenceNumber(client);
    listener.start();
    _waitForIndications(client, consumer, HANDLER_COUNT * MAX_INDICATIONS);
    _testIndications(consumer->getIndications());
    watch.stop();
    cout << "Completed in ";
    watch.printElapsed();
    listener.stop();
    delete consumer;
}
Esempio n. 4
0
static void _testIndicationsWithListenerRunning(CIMClient &client)
{
    Stopwatch watch;
    watch.start();
    cout << "Testing indications with listener running..." << endl;
    CIMListener listener(2003);
    DeliveryRetryTestConsumer* consumer = new DeliveryRetryTestConsumer("1");
    listener.addConsumer(consumer);
    listener.start();
    _generateIndications(client, MAX_INDICATIONS);
    _waitForIndications(client, consumer, HANDLER_COUNT * MAX_INDICATIONS);
#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
    _testIndications(consumer->getIndications());
#endif
    watch.stop();
    cout << "Completed in ";
    watch.printElapsed();

    delete consumer;
}