summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authormarek <marek>2008-01-16 11:43:23 +0000
committermarek <marek>2008-01-16 11:43:23 +0000
commit0767092e3993556f384672040dcece3317612e77 (patch)
tree0f6307760a872ad46a34573088080c8d40576b7d /test
parent357609ad2a536df04106a73d50d2e4388844ad51 (diff)
downloadtog-pegasus-0767092e3993556f384672040dcece3317612e77.zip
tog-pegasus-0767092e3993556f384672040dcece3317612e77.tar.gz
tog-pegasus-0767092e3993556f384672040dcece3317612e77.tar.xz
BUG#:7245
TITLE: All source code files in pegasus/test should be chksrc compliant DESCRIPTION:
Diffstat (limited to 'test')
-rw-r--r--test/TestProviders/CIMOMSample/CIMOMSampleProvider.cpp369
-rw-r--r--test/TestProviders/CIMOMSample/CIMOMSampleProvider.h92
-rw-r--r--test/TestProviders/CIMOMSample/CIMOMSampleProviderMain.cpp21
-rw-r--r--test/TestProviders/ExceptionsTest/ExceptionsTest.cpp510
-rw-r--r--test/TestProviders/ExceptionsTest/ExceptionsTest.h94
-rw-r--r--test/TestProviders/ExceptionsTest/ExceptionsTestMain.cpp17
-rw-r--r--test/TestProviders/LargeDataProvider/LargeDataProvider.cpp389
-rw-r--r--test/TestProviders/LargeDataProvider/LargeDataProvider.h90
-rw-r--r--test/TestProviders/LargeDataProvider/LargeDataProviderMain.cpp21
-rw-r--r--test/TestProviders/MultithreadingTests/MultithreadingSampleProvider.cpp447
-rw-r--r--test/TestProviders/MultithreadingTests/MultithreadingSampleProvider.h92
-rw-r--r--test/TestProviders/MultithreadingTests/MultithreadingSampleProviderMain.cpp23
-rw-r--r--test/TestProviders/TimingTests/TimingClient.cpp6
-rw-r--r--test/TestProviders/TimingTests/TimingProvider.cpp394
-rw-r--r--test/TestProviders/TimingTests/TimingProvider.h96
-rw-r--r--test/TestProviders/TimingTests/TimingProviderMain.cpp23
-rw-r--r--test/TestProviders/XMLParserGen/ParserTestProvider.cpp118
-rw-r--r--test/TestProviders/XMLParserGen/ParserTestProvider.h108
-rw-r--r--test/TestProviders/XMLParserGen/ParserTestProviderMain.cpp17
19 files changed, 1434 insertions, 1493 deletions
diff --git a/test/TestProviders/CIMOMSample/CIMOMSampleProvider.cpp b/test/TestProviders/CIMOMSample/CIMOMSampleProvider.cpp
index 69b1210..69e824c 100644
--- a/test/TestProviders/CIMOMSample/CIMOMSampleProvider.cpp
+++ b/test/TestProviders/CIMOMSample/CIMOMSampleProvider.cpp
@@ -29,10 +29,6 @@
//
//==============================================================================
//
-// Author: <Subodh Soni> (<ssubodh@in.ibm.com>)
-//
-// Modified By:
-//
//%/////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
@@ -59,9 +55,9 @@ CIMOMSampleProvider::~CIMOMSampleProvider(void)
void CIMOMSampleProvider::initialize(CIMOMHandle & cimom)
{
cout <<" CIMOMSampleProvider::initialize" << endl;
-
+
// create some instances
-
+
CIMInstance instance1("CIMOMSample");
CIMObjectPath reference1("CIMOMSample.Id=187");
@@ -77,217 +73,220 @@ void CIMOMSampleProvider::terminate(void)
}
void CIMOMSampleProvider::getInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler)
{
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- CIMName className = instanceReference.getClassName();
- //cout << "className(Method: getInstance)" <<className;
-
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- // deliver requested instance
- handler.deliver(_instances[i]);
- break;
- }
- }
- // complete processing the request
- handler.complete();
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ CIMName className = instanceReference.getClassName();
+ //cout << "className(Method: getInstance)" <<className;
+
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ // deliver requested instance
+ handler.deliver(_instances[i]);
+ break;
+ }
+ }
+ // complete processing the request
+ handler.complete();
}
void CIMOMSampleProvider::enumerateInstances(
- const OperationContext & context,
- const CIMObjectPath & classReference,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & classReference,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler)
{
- OperationContext localContext;
- cout << "CIMOMSampleProvider::enumerateInstances" << endl;
- // announce operation processing.
- handler.processing();
-
- // OperationContext Identity related statements. What will happen
- // if we change the User identity at this point ?
- //
- // Update from TechCall: This seems to be a problem which is a major
- // security issue at this point of time in Pegasus and also a bugzilla
- // record exists for this problem. Not changing as of now.
-
- String user("subodh");
- cout << " User (Initialized here statically) = " << user;
-
- IdentityContainer container = context.get(IdentityContainer::NAME);
- cout << " User in context passed to the method (container.getUserName) = "<< container.getUserName()<< endl;
-
- // Changing the UserIdentity in OperationContext
- localContext.insert(IdentityContainer(user));
- container = localContext.get(IdentityContainer::NAME);
-
- cout << " User in localContext (container.getUserName) = "<< container.getUserName()<< endl;
-
- // begin processing the request
- handler.processing();
-
- if (String::equal(user, container.getUserName()))
- {
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- // deliver instance
+ OperationContext localContext;
+ cout << "CIMOMSampleProvider::enumerateInstances" << endl;
+ // announce operation processing.
+ handler.processing();
+
+ // OperationContext Identity related statements. What will happen
+ // if we change the User identity at this point ?
+ //
+ // Update from TechCall: This seems to be a problem which is a major
+ // security issue at this point of time in Pegasus and also a bugzilla
+ // record exists for this problem. Not changing as of now.
+
+ String user("subodh");
+ cout << " User (Initialized here statically) = " << user;
+
+ IdentityContainer container = context.get(IdentityContainer::NAME);
+ cout << " User in context passed to the method (container.getUserName) = "
+ << container.getUserName()<< endl;
+
+ // Changing the UserIdentity in OperationContext
+ localContext.insert(IdentityContainer(user));
+ container = localContext.get(IdentityContainer::NAME);
+
+ cout << " User in localContext (container.getUserName) = "
+ << container.getUserName()<< endl;
+
+ // begin processing the request
+ handler.processing();
+
+ if (String::equal(user, container.getUserName()))
+ {
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ // deliver instance
handler.deliver(_instances[i]);
- }
+ }
else
- {
- cout << "User should be " << user << "but its " << container.getUserName() << endl;
- throw(CIM_ERR_INVALID_PARAMETER);
+ {
+ cout << "User should be " << user << "but its "
+ << container.getUserName() << endl;
+ throw(CIM_ERR_INVALID_PARAMETER);
}
- // complete processing the request
- handler.complete();
+ // complete processing the request
+ handler.complete();
}
void CIMOMSampleProvider::enumerateInstanceNames(
- const OperationContext & context,
- const CIMObjectPath & classReference,
- ObjectPathResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & classReference,
+ ObjectPathResponseHandler & handler)
{
- cout << "CIMOMSampleProvider::enumerateInstanceNames" << endl;
- // begin processing the request
+ cout << "CIMOMSampleProvider::enumerateInstanceNames" << endl;
+ // begin processing the request
- CIMName clName = classReference.getClassName();
- handler.processing();
+ CIMName clName = classReference.getClassName();
+ handler.processing();
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- // deliver reference
- handler.deliver(_instanceNames[i]);
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ // deliver reference
+ handler.deliver(_instanceNames[i]);
- // complete processing the request
- handler.complete();
+ // complete processing the request
+ handler.complete();
}
void CIMOMSampleProvider::modifyInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- const CIMInstance & instanceObject,
- const Boolean includeQualifiers,
- const CIMPropertyList & propertyList,
- ResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ const CIMInstance & instanceObject,
+ const Boolean includeQualifiers,
+ const CIMPropertyList & propertyList,
+ ResponseHandler & handler)
{
- cout << "CIMOMSampleProvider::modifyInstance" << endl;
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- // begin processing the request
- handler.processing();
-
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- // overwrite existing instance
- _instances[i] = instanceObject;
-
- break;
- }
- }
- // complete processing the request
- handler.complete();
+ cout << "CIMOMSampleProvider::modifyInstance" << endl;
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ // begin processing the request
+ handler.processing();
+
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ // overwrite existing instance
+ _instances[i] = instanceObject;
+
+ break;
+ }
+ }
+ // complete processing the request
+ handler.complete();
}
void CIMOMSampleProvider::createInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- const CIMInstance & instanceObject,
- ObjectPathResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ const CIMInstance & instanceObject,
+ ObjectPathResponseHandler & handler)
{
- cout << "CIMOMSampleProvider::createInstance" << endl;
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instanceNames.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- throw CIMObjectAlreadyExistsException(
+ cout << "CIMOMSampleProvider::createInstance" << endl;
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instanceNames.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ throw CIMObjectAlreadyExistsException(
localReference.toString());
- }
- }
+ }
+ }
- // begin processing the request
- handler.processing();
+ // begin processing the request
+ handler.processing();
- // add the new instance to the array
- _instances.append(instanceObject);
- _instanceNames.append(instanceReference);
+ // add the new instance to the array
+ _instances.append(instanceObject);
+ _instanceNames.append(instanceReference);
- // deliver the new instance
- handler.deliver(_instanceNames[_instanceNames.size() - 1]);
+ // deliver the new instance
+ handler.deliver(_instanceNames[_instanceNames.size() - 1]);
- // complete processing the request
- handler.complete();
+ // complete processing the request
+ handler.complete();
}
void CIMOMSampleProvider::deleteInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- ResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ ResponseHandler & handler)
{
- cout << "CIMOMSampleProvider::deleteInstance" << endl;
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- // begin processing the request
- handler.processing();
-
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- // save the instance locally
- CIMInstance cimInstance(_instances[i]);
-
- // remove instance from the array
- _instances.remove(i);
- _instanceNames.remove(i);
-
- // exit loop
- break;
- }
- }
-
- // complete processing the request
- handler.complete();
+ cout << "CIMOMSampleProvider::deleteInstance" << endl;
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ // begin processing the request
+ handler.processing();
+
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ // save the instance locally
+ CIMInstance cimInstance(_instances[i]);
+
+ // remove instance from the array
+ _instances.remove(i);
+ _instanceNames.remove(i);
+
+ // exit loop
+ break;
+ }
+ }
+
+ // complete processing the request
+ handler.complete();
}
PEGASUS_NAMESPACE_END
diff --git a/test/TestProviders/CIMOMSample/CIMOMSampleProvider.h b/test/TestProviders/CIMOMSample/CIMOMSampleProvider.h
index ada1182..0d88543 100644
--- a/test/TestProviders/CIMOMSample/CIMOMSampleProvider.h
+++ b/test/TestProviders/CIMOMSample/CIMOMSampleProvider.h
@@ -29,10 +29,6 @@
//
//==============================================================================
//
-// Author: <Subodh Soni> (<ssubodh@in.ibm.com>)
-//
-// Modified By:
-//
//%/////////////////////////////////////////////////////////////////////////////
#ifndef CIMOMSampleProvider_H
@@ -44,62 +40,62 @@
PEGASUS_NAMESPACE_BEGIN
class CIMOMSampleProvider :
- public CIMInstanceProvider
+ public CIMInstanceProvider
{
public:
- CIMOMSampleProvider(void);
- virtual ~CIMOMSampleProvider(void);
+ CIMOMSampleProvider(void);
+ virtual ~CIMOMSampleProvider(void);
- // CIMProvider interface
- virtual void initialize(CIMOMHandle & cimom);
- virtual void terminate(void);
+ // CIMProvider interface
+ virtual void initialize(CIMOMHandle & cimom);
+ virtual void terminate(void);
- // CIMInstanceProvider interface
- virtual void getInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler);
+ // CIMInstanceProvider interface
+ virtual void getInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler);
- virtual void enumerateInstances(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler);
+ virtual void enumerateInstances(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler);
- virtual void enumerateInstanceNames(
- const OperationContext & context,
- const CIMObjectPath & ref,
- ObjectPathResponseHandler & handler);
+ virtual void enumerateInstanceNames(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ ObjectPathResponseHandler & handler);
- virtual void modifyInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const CIMInstance & obj,
- const Boolean includeQualifiers,
- const CIMPropertyList & propertyList,
- ResponseHandler & handler);
+ virtual void modifyInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const CIMInstance & obj,
+ const Boolean includeQualifiers,
+ const CIMPropertyList & propertyList,
+ ResponseHandler & handler);
- virtual void createInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const CIMInstance & obj,
- ObjectPathResponseHandler & handler);
+ virtual void createInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const CIMInstance & obj,
+ ObjectPathResponseHandler & handler);
- virtual void deleteInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- ResponseHandler & handler);
+ virtual void deleteInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ ResponseHandler & handler);
protected:
- Array<CIMObjectPath> _instanceNames;
- Array<CIMInstance> _instances;
+ Array<CIMObjectPath> _instanceNames;
+ Array<CIMInstance> _instances;
};
PEGASUS_NAMESPACE_END
-#endif /* CIMOMSampleProvider_H */
+#endif /* CIMOMSampleProvider_H */
diff --git a/test/TestProviders/CIMOMSample/CIMOMSampleProviderMain.cpp b/test/TestProviders/CIMOMSample/CIMOMSampleProviderMain.cpp
index 0c5c2bb..20039eb 100644
--- a/test/TestProviders/CIMOMSample/CIMOMSampleProviderMain.cpp
+++ b/test/TestProviders/CIMOMSample/CIMOMSampleProviderMain.cpp
@@ -29,10 +29,6 @@
//
//==============================================================================
//
-// Author: <Subodh Soni> (<ssubodh@in.ibm.com>)
-//
-// Modified By:
-//
//%/////////////////////////////////////////////////////////////////////////////
#include <iostream>
@@ -43,15 +39,16 @@
PEGASUS_NAMESPACE_BEGIN
PEGASUS_USING_STD;
-extern "C" PEGASUS_EXPORT CIMProvider * PegasusCreateProvider(const String & name)
+extern "C" PEGASUS_EXPORT CIMProvider * PegasusCreateProvider(
+ const String & name)
{
- if(String::equalNoCase(name, "cimomsampleprovider") ||
- String::equalNoCase(name, "cimomsampleprovider (PROVIDER)"))
- {
- cout << "Entry to CIMOMSampleProvider" << endl;
- return(new CIMOMSampleProvider());
- }
- return(0);
+ if(String::equalNoCase(name, "cimomsampleprovider") ||
+ String::equalNoCase(name, "cimomsampleprovider (PROVIDER)"))
+ {
+ cout << "Entry to CIMOMSampleProvider" << endl;
+ return(new CIMOMSampleProvider());
+ }
+ return(0);
}
PEGASUS_NAMESPACE_END
diff --git a/test/TestProviders/ExceptionsTest/ExceptionsTest.cpp b/test/TestProviders/ExceptionsTest/ExceptionsTest.cpp
index 4a89772..5fd5cac 100644
--- a/test/TestProviders/ExceptionsTest/ExceptionsTest.cpp
+++ b/test/TestProviders/ExceptionsTest/ExceptionsTest.cpp
@@ -46,7 +46,7 @@ PEGASUS_USING_STD;
#ifdef TEST_EXCEPTIONS
#define PEGASUS_EXCEPTION PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, \
- "ExceptionsTest Exception")
+ "ExceptionsTest Exception")
#define CIM_EXCEPTION CIMException(CIM_ERR_FAILED, "Test Provider")
#else
#define PEGASUS_EXCEPTION
@@ -55,12 +55,12 @@ PEGASUS_USING_STD;
// Update the value of the following macro for enabling/ disabling exceptions.
//
-#define EXCEPTION_TYPE 1
-#define CheckExceptionType(X) { \
- cout <<" Exception Type " << X << endl;\
- if (X == 1) throw PEGASUS_EXCEPTION; \
- if (X == 2) throw CIM_EXCEPTION; \
- }
+#define EXCEPTION_TYPE 1
+#define CheckExceptionType(X) { \
+ cout <<" Exception Type " << X << endl;\
+ if (X == 1) throw PEGASUS_EXCEPTION; \
+ if (X == 2) throw CIM_EXCEPTION; \
+ }
ExceptionsTest::ExceptionsTest(void)
{
@@ -73,55 +73,57 @@ ExceptionsTest::~ExceptionsTest(void)
void ExceptionsTest::initialize(CIMOMHandle & cimom)
{
- cout <<" ExceptionsTest::initialize" << endl;
+ cout <<" ExceptionsTest::initialize" << endl;
- CheckExceptionType(EXCEPTION_TYPE);
+ CheckExceptionType(EXCEPTION_TYPE);
- // create default instances for FirstClass
- CIMInstance instance1("FirstClass");
- CIMObjectPath reference1("FirstClass.Id=1");
+ // create default instances for FirstClass
+ CIMInstance instance1("FirstClass");
+ CIMObjectPath reference1("FirstClass.Id=1");
- instance1.addProperty(CIMProperty("Id", Uint8(1))); // key
- instance1.addProperty(CIMProperty("Message", String("Subodh.....")));
+ instance1.addProperty(CIMProperty("Id", Uint8(1))); // key
+ instance1.addProperty(CIMProperty("Message", String("Subodh.....")));
- _instances.append(instance1);
- _instanceNames.append(reference1);
+ _instances.append(instance1);
+ _instanceNames.append(reference1);
- CheckExceptionType(EXCEPTION_TYPE);
+ CheckExceptionType(EXCEPTION_TYPE);
- CIMInstance instance2("FirstClass");
- CIMObjectPath reference2("FirstClass.Id=2");
+ CIMInstance instance2("FirstClass");
+ CIMObjectPath reference2("FirstClass.Id=2");
- instance2.addProperty(CIMProperty("Id", Uint8(2))); // key
- instance2.addProperty(CIMProperty("Message", String("Soni....")));
+ instance2.addProperty(CIMProperty("Id", Uint8(2))); // key
+ instance2.addProperty(CIMProperty("Message", String("Soni....")));
- _instances.append(instance2);
- _instanceNames.append(reference2);
+ _instances.append(instance2);
+ _instanceNames.append(reference2);
- CheckExceptionType(EXCEPTION_TYPE);
+ CheckExceptionType(EXCEPTION_TYPE);
- // create default instances for SecondClass
- CIMInstance instance_1("SecondClass");
- CIMObjectPath reference_1("SecondClass.Srno=11");
+ // create default instances for SecondClass
+ CIMInstance instance_1("SecondClass");
+ CIMObjectPath reference_1("SecondClass.Srno=11");
- instance_1.addProperty(CIMProperty("Srno", Uint8(1))); // key
- instance_1.addProperty(CIMProperty("Name", String("Class Two Instance 1.....")));
+ instance_1.addProperty(CIMProperty("Srno", Uint8(1))); // key
+ instance_1.addProperty(
+ CIMProperty("Name", String("Class Two Instance 1.....")));
- _instances_second.append(instance_1);
- _instanceNames_second.append(reference_1);
+ _instances_second.append(instance_1);
+ _instanceNames_second.append(reference_1);
- CheckExceptionType(EXCEPTION_TYPE);
+ CheckExceptionType(EXCEPTION_TYPE);
- CIMInstance instance_2("SecondClass");
- CIMObjectPath reference_2("SecondClass.Srno=2");
+ CIMInstance instance_2("SecondClass");
+ CIMObjectPath reference_2("SecondClass.Srno=2");
- instance_2.addProperty(CIMProperty("Srno", Uint8(2))); // key
- instance_2.addProperty(CIMProperty("Name", String("Class Two Instance 2....")));
+ instance_2.addProperty(CIMProperty("Srno", Uint8(2))); // key
+ instance_2.addProperty(
+ CIMProperty("Name", String("Class Two Instance 2....")));
- _instances_second.append(instance_2);
- _instanceNames_second.append(reference_2);
+ _instances_second.append(instance_2);
+ _instanceNames_second.append(reference_2);
- CheckExceptionType(EXCEPTION_TYPE);
+ CheckExceptionType(EXCEPTION_TYPE);
}
void ExceptionsTest::terminate(void)
@@ -129,247 +131,247 @@ void ExceptionsTest::terminate(void)
}
void ExceptionsTest::getInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler)
{
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- CIMName className = instanceReference.getClassName();
-
- // begin processing the request
- handler.processing();
-
- cout <<"Calling Exception ExceptionsTest::getInstance 1" << endl;
- CheckExceptionType(EXCEPTION_TYPE);
-
- if (className == CIMName("FirstClass"))
- {
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- // deliver requested instance
- handler.deliver(_instances[i]);
- break;
- }
- }
- }
- // complete processing the request
- handler.complete();
- cout <<"Calling Exception ExceptionsTest::getInstance 2" << endl;
- CheckExceptionType(EXCEPTION_TYPE);
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ CIMName className = instanceReference.getClassName();
+
+ // begin processing the request
+ handler.processing();
+
+ cout <<"Calling Exception ExceptionsTest::getInstance 1" << endl;
+ CheckExceptionType(EXCEPTION_TYPE);
+
+ if (className == CIMName("FirstClass"))
+ {
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ // deliver requested instance
+ handler.deliver(_instances[i]);
+ break;
+ }
+ }
+ }
+ // complete processing the request
+ handler.complete();
+ cout <<"Calling Exception ExceptionsTest::getInstance 2" << endl;
+ CheckExceptionType(EXCEPTION_TYPE);
}
void ExceptionsTest::enumerateInstances(
- const OperationContext & context,
- const CIMObjectPath & classReference,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & classReference,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler)
{
- cout <<"Calling Exception ExceptionsTest::enumerateInstances 1" << endl;
- CheckExceptionType(EXCEPTION_TYPE);
-
- CIMName clName = classReference.getClassName();
- String className = clName.getString();
-
- if (String::equalNoCase(className, "FirstClass"))
- {
- // announce operation processing.
- handler.processing();
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- // deliver instance
- handler.deliver(_instances[i]);
- }
- if (String::equalNoCase(className, "SecondClass"))
- {
- handler.processing();
- for(Uint32 i = 0, n = _instances_second.size(); i < n; i++)
- // deliver instance
- handler.deliver(_instances_second[i]);
- }
- if (String::equalNoCase(className, "ThirdClass"))
- {
- handler.processing();
- for(Uint32 i = 0, n = _instances_third.size(); i < n; i++)
- // deliver instance
- handler.deliver(_instances_third[i]);
- }
- cout <<"Calling Exception ExceptionsTest::enumerateInstances 2" << endl;
- CheckExceptionType(EXCEPTION_TYPE);
-
- // complete processing the request
- handler.complete();
+ cout <<"Calling Exception ExceptionsTest::enumerateInstances 1" << endl;
+ CheckExceptionType(EXCEPTION_TYPE);
+
+ CIMName clName = classReference.getClassName();
+ String className = clName.getString();
+
+ if (String::equalNoCase(className, "FirstClass"))
+ {
+ // announce operation processing.
+ handler.processing();
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ // deliver instance
+ handler.deliver(_instances[i]);
+ }
+ if (String::equalNoCase(className, "SecondClass"))
+ {
+ handler.processing();
+ for(Uint32 i = 0, n = _instances_second.size(); i < n; i++)
+ // deliver instance
+ handler.deliver(_instances_second[i]);
+ }
+ if (String::equalNoCase(className, "ThirdClass"))
+ {
+ handler.processing();
+ for(Uint32 i = 0, n = _instances_third.size(); i < n; i++)
+ // deliver instance
+ handler.deliver(_instances_third[i]);
+ }
+ cout <<"Calling Exception ExceptionsTest::enumerateInstances 2" << endl;
+ CheckExceptionType(EXCEPTION_TYPE);
+
+ // complete processing the request
+ handler.complete();
}
void ExceptionsTest::enumerateInstanceNames(
- const OperationContext & context,
- const CIMObjectPath & classReference,
- ObjectPathResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & classReference,
+ ObjectPathResponseHandler & handler)
{
- // begin processing the request
- handler.processing();
-
- cout <<"Calling Exception ExceptionsTest::enumerateInstanceNames 1" << endl;
- CheckExceptionType(EXCEPTION_TYPE);
- CIMName clName = classReference.getClassName();
- String className = clName.getString();
-
- if (className == "FirstClass")
- {
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- // deliver reference
- handler.deliver(_instanceNames[i]);
- }
- else if (className == "SecondClass")
- {
- for(Uint32 i = 0, n = _instances_second.size(); i < n; i++)
- // deliver reference
- handler.deliver(_instanceNames_second[i]);
- }
- else if (className == "ThirdClass")
- {
- for(Uint32 i = 0, n = _instances_third.size(); i < n; i++)
- // deliver reference
- handler.deliver(_instanceNames_third[i]);
-
- }
- // complete processing the request
- cout <<"Calling Exception ExceptionsTest::enumerateInstanceNames 2" << endl;
- CheckExceptionType(EXCEPTION_TYPE);
- handler.complete();
+ // begin processing the request
+ handler.processing();
+
+ cout <<"Calling Exception ExceptionsTest::enumerateInstanceNames 1" << endl;
+ CheckExceptionType(EXCEPTION_TYPE);
+ CIMName clName = classReference.getClassName();
+ String className = clName.getString();
+
+ if (className == "FirstClass")
+ {
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ // deliver reference
+ handler.deliver(_instanceNames[i]);
+ }
+ else if (className == "SecondClass")
+ {
+ for(Uint32 i = 0, n = _instances_second.size(); i < n; i++)
+ // deliver reference
+ handler.deliver(_instanceNames_second[i]);
+ }
+ else if (className == "ThirdClass")
+ {
+ for(Uint32 i = 0, n = _instances_third.size(); i < n; i++)
+ // deliver reference
+ handler.deliver(_instanceNames_third[i]);
+
+ }
+ // complete processing the request
+ cout <<"Calling Exception ExceptionsTest::enumerateInstanceNames 2" << endl;
+ CheckExceptionType(EXCEPTION_TYPE);
+ handler.complete();
}
void ExceptionsTest::modifyInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- const CIMInstance & instanceObject,
- const Boolean includeQualifiers,
- const CIMPropertyList & propertyList,
- ResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ const CIMInstance & instanceObject,
+ const Boolean includeQualifiers,
+ const CIMPropertyList & propertyList,
+ ResponseHandler & handler)
{
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- cout <<"Calling Exception ExceptionsTest::modifyInstance 1" << endl;
- CheckExceptionType(EXCEPTION_TYPE);
- // begin processing the request
- handler.processing();
-
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- // overwrite existing instance
- _instances[i] = instanceObject;
- break;
- }
- }
- // complete processing the request
- handler.complete();
- cout <<"Calling Exception ExceptionsTest::modifyInstance 2" << endl;
- CheckExceptionType(EXCEPTION_TYPE);
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ cout <<"Calling Exception ExceptionsTest::modifyInstance 1" << endl;
+ CheckExceptionType(EXCEPTION_TYPE);
+ // begin processing the request
+ handler.processing();
+
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ // overwrite existing instance
+ _instances[i] = instanceObject;
+ break;
+ }
+ }
+ // complete processing the request
+ handler.complete();
+ cout <<"Calling Exception ExceptionsTest::modifyInstance 2" << endl;
+ CheckExceptionType(EXCEPTION_TYPE);
}
void ExceptionsTest::createInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- const CIMInstance & instanceObject,
- ObjectPathResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ const CIMInstance & instanceObject,
+ ObjectPathResponseHandler & handler)
{
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- cout <<"Calling Exception ExceptionsTest::createInstance 1" << endl;
- CheckExceptionType(EXCEPTION_TYPE);
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instanceNames.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- throw CIMObjectAlreadyExistsException(
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ cout <<"Calling Exception ExceptionsTest::createInstance 1" << endl;
+ CheckExceptionType(EXCEPTION_TYPE);
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instanceNames.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ throw CIMObjectAlreadyExistsException(
localReference.toString());
- }
- }
+ }
+ }
- // begin processing the request
- handler.processing();
+ // begin processing the request
+ handler.processing();
- // add the new instance to the array
- _instances.append(instanceObject);
- _instanceNames.append(instanceReference);
+ // add the new instance to the array
+ _instances.append(instanceObject);
+ _instanceNames.append(instanceReference);
- cout <<"Calling Exception ExceptionsTest::createInstance 2" << endl;
- CheckExceptionType(EXCEPTION_TYPE);
- // deliver the new instance
- handler.deliver(_instanceNames[_instanceNames.size() - 1]);
+ cout <<"Calling Exception ExceptionsTest::createInstance 2" << endl;
+ CheckExceptionType(EXCEPTION_TYPE);
+ // deliver the new instance
+ handler.deliver(_instanceNames[_instanceNames.size() - 1]);
- // complete processing the request
- handler.complete();
+ // complete processing the request
+ handler.complete();
}
void ExceptionsTest::deleteInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- ResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ ResponseHandler & handler)
{
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- // begin processing the request
- handler.processing();
-
- cout <<"Calling Exception ExceptionsTest::deleteInstance 1" << endl;
- CheckExceptionType(EXCEPTION_TYPE);
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- // save the instance locally
- CIMInstance cimInstance(_instances[i]);
-
- // remove instance from the array
- _instances.remove(i);
- _instanceNames.remove(i);
-
- // exit loop
- break;
- }
- }
-
- cout <<"Calling Exception ExceptionsTest::deleteInstance 2" << endl;
- CheckExceptionType(EXCEPTION_TYPE);
- // complete processing the request
- handler.complete();
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ // begin processing the request
+ handler.processing();
+
+ cout <<"Calling Exception ExceptionsTest::deleteInstance 1" << endl;
+ CheckExceptionType(EXCEPTION_TYPE);
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ // save the instance locally
+ CIMInstance cimInstance(_instances[i]);
+
+ // remove instance from the array
+ _instances.remove(i);
+ _instanceNames.remove(i);
+
+ // exit loop
+ break;
+ }
+ }
+
+ cout <<"Calling Exception ExceptionsTest::deleteInstance 2" << endl;
+ CheckExceptionType(EXCEPTION_TYPE);
+ // complete processing the request
+ handler.complete();
}
PEGASUS_NAMESPACE_END
diff --git a/test/TestProviders/ExceptionsTest/ExceptionsTest.h b/test/TestProviders/ExceptionsTest/ExceptionsTest.h
index 6cd18d2..e883a2d 100644
--- a/test/TestProviders/ExceptionsTest/ExceptionsTest.h
+++ b/test/TestProviders/ExceptionsTest/ExceptionsTest.h
@@ -44,64 +44,64 @@
PEGASUS_NAMESPACE_BEGIN
class ExceptionsTest :
- public CIMInstanceProvider
+ public CIMInstanceProvider
{
public:
- ExceptionsTest(void);
- virtual ~ExceptionsTest(void);
+ ExceptionsTest(void);
+ virtual ~ExceptionsTest(void);
- // CIMProvider interface
- virtual void initialize(CIMOMHandle & cimom);
- virtual void terminate(void);
+ // CIMProvider interface
+ virtual void initialize(CIMOMHandle & cimom);
+ virtual void terminate(void);
- // CIMInstanceProvider interface
- virtual void getInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler);
+ // CIMInstanceProvider interface
+ virtual void getInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler);
- virtual void enumerateInstances(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler);
+ virtual void enumerateInstances(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler);
- virtual void enumerateInstanceNames(
- const OperationContext & context,
- const CIMObjectPath & ref,
- ObjectPathResponseHandler & handler);
+ virtual void enumerateInstanceNames(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ ObjectPathResponseHandler & handler);
- virtual void modifyInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const CIMInstance & obj,
- const Boolean includeQualifiers,
- const CIMPropertyList & propertyList,
- ResponseHandler & handler);
+ virtual void modifyInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const CIMInstance & obj,
+ const Boolean includeQualifiers,
+ const CIMPropertyList & propertyList,
+ ResponseHandler & handler);
- virtual void createInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const CIMInstance & obj,
- ObjectPathResponseHandler & handler);
+ virtual void createInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const CIMInstance & obj,
+ ObjectPathResponseHandler & handler);
- virtual void deleteInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- ResponseHandler & handler);
+ virtual void deleteInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ ResponseHandler & handler);
protected:
- Array<CIMObjectPath> _instanceNames;
- Array<CIMObjectPath> _instanceNames_second;
- Array<CIMObjectPath> _instanceNames_third;
- Array<CIMInstance> _instances;
- Array<CIMInstance> _instances_second;
- Array<CIMInstance> _instances_third;
+ Array<CIMObjectPath> _instanceNames;
+ Array<CIMObjectPath> _instanceNames_second;
+ Array<CIMObjectPath> _instanceNames_third;
+ Array<CIMInstance> _instances;
+ Array<CIMInstance> _instances_second;
+ Array<CIMInstance> _instances_third;
};
PEGASUS_NAMESPACE_END
diff --git a/test/TestProviders/ExceptionsTest/ExceptionsTestMain.cpp b/test/TestProviders/ExceptionsTest/ExceptionsTestMain.cpp
index 752711a..03f59d3 100644
--- a/test/TestProviders/ExceptionsTest/ExceptionsTestMain.cpp
+++ b/test/TestProviders/ExceptionsTest/ExceptionsTestMain.cpp
@@ -43,15 +43,16 @@
PEGASUS_NAMESPACE_BEGIN
PEGASUS_USING_STD;
-extern "C" PEGASUS_EXPORT CIMProvider * PegasusCreateProvider(const String & name)
+extern "C" PEGASUS_EXPORT CIMProvider * PegasusCreateProvider(
+ const String & name)
{
- if(String::equalNoCase(name, "exceptionstest") ||
- String::equalNoCase(name, "exceptionstest (PROVIDER)"))
- {
- cout << "Entry to ExceptionsTest" << endl;
- return(new ExceptionsTest());
- }
- return(0);
+ if(String::equalNoCase(name, "exceptionstest") ||
+ String::equalNoCase(name, "exceptionstest (PROVIDER)"))
+ {
+ cout << "Entry to ExceptionsTest" << endl;
+ return(new ExceptionsTest());
+ }
+ return(0);
}
PEGASUS_NAMESPACE_END
diff --git a/test/TestProviders/LargeDataProvider/LargeDataProvider.cpp b/test/TestProviders/LargeDataProvider/LargeDataProvider.cpp
index 7c67bcf..c24edd9 100644
--- a/test/TestProviders/LargeDataProvider/LargeDataProvider.cpp
+++ b/test/TestProviders/LargeDataProvider/LargeDataProvider.cpp
@@ -29,10 +29,6 @@
//
//==============================================================================
//
-// Author: <Subodh Soni> (<ssubodh@in.ibm.com>)
-//
-// Modified By:
-//
//%/////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
@@ -44,7 +40,7 @@
PEGASUS_USING_STD;
#ifndef NO_OF_INSTANCES
-#define NO_OF_INSTANCES 100
+#define NO_OF_INSTANCES 100
#endif
PEGASUS_NAMESPACE_BEGIN
@@ -59,241 +55,242 @@ LargeDataProvider::~LargeDataProvider(void)
void LargeDataProvider::initialize(CIMOMHandle & cimom)
{
- cout << "-----------------------------" << endl;
+ cout << "-----------------------------" << endl;
cout << "LargeDataProvider::initialize" << endl;
- cout << "-----------------------------" << endl;
+ cout << "-----------------------------" << endl;
}
void LargeDataProvider::terminate(void)
{
- // Supporting Large data handling.
+ // Supporting Large data handling.
}
void LargeDataProvider::getInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler)
{
- cout << "------------------------------" << endl;
+ cout << "------------------------------" << endl;
cout << "LargeDataProvider::getInstance" << endl;
- cout << "------------------------------" << endl;
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- // begin processing the request
- handler.processing();
-
+ cout << "------------------------------" << endl;
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ // begin processing the request
+ handler.processing();
+
// instance index corresponds to reference index
for(Uint32 i = 0, n = _instances.size(); i < n; i++)
{
if(localReference == _instanceNames[i])
{
- // deliver requested instance
- handler.deliver(_instances[i]);
- break;
+ // deliver requested instance
+ handler.deliver(_instances[i]);
+ break;
}
- }
- // complete processing the request
- handler.complete();
+ }
+ // complete processing the request
+ handler.complete();
}
void LargeDataProvider::enumerateInstances(
- const OperationContext & context,
- const CIMObjectPath & classReference,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & classReference,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler)
{
- char buffer[NO_OF_INSTANCES];
- CIMInstance Instances[NO_OF_INSTANCES];
- CIMObjectPath References[NO_OF_INSTANCES];
-
- cout << "-------------------------------------" << endl;
- cout << "LargeDataProvider::enumerateInstances" << endl;
- cout << "-------------------------------------" << endl;
+ char buffer[NO_OF_INSTANCES];
+ CIMInstance Instances[NO_OF_INSTANCES];
+ CIMObjectPath References[NO_OF_INSTANCES];
+
+ cout << "-------------------------------------" << endl;
+ cout << "LargeDataProvider::enumerateInstances" << endl;
+ cout << "-------------------------------------" << endl;
- // announce operation processing.
- handler.processing();
+ // announce operation processing.
+ handler.processing();
// creating some instances in a loop for generating a large amount of data
- // The number of instances is controlled by the macro var. NO_OF_INSTANCES.
- // TODO:: Need to fix the way in which the value of this variable is passed
-
- cout << "Number of Instances = " << NO_OF_INSTANCES << endl;
- for (Uint32 i = 0; i < NO_OF_INSTANCES; i++)
- {
- sprintf(buffer, "%d", i);
-
- Instances[i] = CIMInstance("SampleClass");
- References[i] = CIMObjectPath("SampleClass.Id="+String(buffer));
-
- Instances[i].addProperty(CIMProperty("Id", Uint16(i)));
- Instances[i].addProperty(CIMProperty("Message", String(buffer)));
- Instances[i].addProperty(CIMProperty("ReqType", String("Local")));
- Instances[i].addProperty(CIMProperty("RequestNumber", Uint16(i+10)));
- Instances[i].addProperty(CIMProperty("TimeSpent", Uint16(i+2)));
- Instances[i].addProperty(CIMProperty("TimeIdeal", Uint16(100)));
- Instances[i].addProperty(CIMProperty("Performance", String("OK \00><\00")));
- Instances[i].addProperty(CIMProperty("EndPoint",
- String("Instance "+String(buffer)+" Ends")));
-
- _instances.append(Instances[i]);
- _instanceNames.append(References[i]);
- }
-
- for(Uint32 i = 0; i < NO_OF_INSTANCES; i++)
- // deliver instance
- handler.deliver(_instances[i]);
-
- // complete processing the request
- handler.complete();
+ // The number of instances is controlled by the macro var. NO_OF_INSTANCES.
+ // TODO:: Need to fix the way in which the value of this variable is passed
+
+ cout << "Number of Instances = " << NO_OF_INSTANCES << endl;
+ for (Uint32 i = 0; i < NO_OF_INSTANCES; i++)
+ {
+ sprintf(buffer, "%d", i);
+
+ Instances[i] = CIMInstance("SampleClass");
+ References[i] = CIMObjectPath("SampleClass.Id="+String(buffer));
+
+ Instances[i].addProperty(CIMProperty("Id", Uint16(i)));
+ Instances[i].addProperty(CIMProperty("Message", String(buffer)));
+ Instances[i].addProperty(CIMProperty("ReqType", String("Local")));
+ Instances[i].addProperty(CIMProperty("RequestNumber", Uint16(i+10)));
+ Instances[i].addProperty(CIMProperty("TimeSpent", Uint16(i+2)));
+ Instances[i].addProperty(CIMProperty("TimeIdeal", Uint16(100)));
+ Instances[i].addProperty(
+ CIMProperty("Performance", String("OK \00><\00")));
+ Instances[i].addProperty(CIMProperty("EndPoint",
+ String("Instance "+String(buffer)+" Ends")));
+
+ _instances.append(Instances[i]);
+ _instanceNames.append(References[i]);
+ }
+
+ for(Uint32 i = 0; i < NO_OF_INSTANCES; i++)
+ // deliver instance
+ handler.deliver(_instances[i]);
+
+ // complete processing the request
+ handler.complete();
}
void LargeDataProvider::enumerateInstanceNames(
- const OperationContext & context,
- const CIMObjectPath & classReference,
- ObjectPathResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & classReference,
+ ObjectPathResponseHandler & handler)
{
- cout << "-----------------------------------------" << endl;
- cout << "LargeDataProvider::enumerateInstanceNames" << endl;
- cout << "-----------------------------------------" << endl;
- // begin processing the request
- handler.processing();
- cout << "_instances.size = " << _instances.size() << endl;
- for(Uint32 i = 0; i < _instances.size(); i++)
- // deliver references
- handler.deliver(_instanceNames[i]);
-
- // complete processing the request
- handler.complete();
+ cout << "-----------------------------------------" << endl;
+ cout << "LargeDataProvider::enumerateInstanceNames" << endl;
+ cout << "-----------------------------------------" << endl;
+ // begin processing the request
+ handler.processing();
+ cout << "_instances.size = " << _instances.size() << endl;
+ for(Uint32 i = 0; i < _instances.size(); i++)
+ // deliver references
+ handler.deliver(_instanceNames[i]);
+
+ // complete processing the request
+ handler.complete();
}
void LargeDataProvider::modifyInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- const CIMInstance & instanceObject,
- const Boolean includeQualifiers,
- const CIMPropertyList & propertyList,
- ResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ const CIMInstance & instanceObject,
+ const Boolean includeQualifiers,
+ const CIMPropertyList & propertyList,
+ ResponseHandler & handler)
{
- cout << "---------------------------------" << endl;
- cout << "LargeDataProvider::modifyInstance" << endl;
- cout << "---------------------------------" << endl;
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- // begin processing the request
- handler.processing();
-
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- // overwrite existing instance
- _instances[i] = instanceObject;
- break;
- }
- }
-
- // complete processing the request
- handler.complete();
+ cout << "---------------------------------" << endl;
+ cout << "LargeDataProvider::modifyInstance" << endl;
+ cout << "---------------------------------" << endl;
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ // begin processing the request
+ handler.processing();
+
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ // overwrite existing instance
+ _instances[i] = instanceObject;
+ break;
+ }
+ }
+
+ // complete processing the request
+ handler.complete();
}
void LargeDataProvider::createInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- const CIMInstance & instanceObject,
- ObjectPathResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ const CIMInstance & instanceObject,
+ ObjectPathResponseHandler & handler)
{
- cout << "---------------------------------" << endl;
- cout << "LargeDataProvider::createInstance" << endl;
- cout << "---------------------------------" << endl;
-
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instanceNames.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- throw CIMObjectAlreadyExistsException(
+ cout << "---------------------------------" << endl;
+ cout << "LargeDataProvider::createInstance" << endl;
+ cout << "---------------------------------" << endl;
+
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instanceNames.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ throw CIMObjectAlreadyExistsException(
localReference.toString());
- }
- }
+ }
+ }
- // begin processing the request
- handler.processing();
+ // begin processing the request
+ handler.processing();
- // add the new instance to the array
- _instances.append(instanceObject);
- _instanceNames.append(instanceReference);
+ // add the new instance to the array
+ _instances.append(instanceObject);
+ _instanceNames.append(instanceReference);
- // deliver the new instance
- handler.deliver(_instanceNames[_instanceNames.size() - 1]);
+ // deliver the new instance
+ handler.deliver(_instanceNames[_instanceNames.size() - 1]);
- // complete processing the request
- handler.complete();
+ // complete processing the request
+ handler.complete();
}
void LargeDataProvider::deleteInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- ResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ ResponseHandler & handler)
{
- cout << "---------------------------------" << endl;
- cout << "LargeDataProvider::deleteInstance" << endl;
- cout << "---------------------------------" << endl;
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- // begin processing the request
- handler.processing();
-
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- // save the instance locally
- CIMInstance cimInstance(_instances[i]);
-
- // remove instance from the array
- _instances.remove(i);
- _instanceNames.remove(i);
-
- // exit loop
- break;
- }
- }
-
- // complete processing the request
- handler.complete();
+ cout << "---------------------------------" << endl;
+ cout << "LargeDataProvider::deleteInstance" << endl;
+ cout << "---------------------------------" << endl;
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ // begin processing the request
+ handler.processing();
+
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ // save the instance locally
+ CIMInstance cimInstance(_instances[i]);
+
+ // remove instance from the array
+ _instances.remove(i);
+ _instanceNames.remove(i);
+
+ // exit loop
+ break;
+ }
+ }
+
+ // complete processing the request
+ handler.complete();
}
PEGASUS_NAMESPACE_END
diff --git a/test/TestProviders/LargeDataProvider/LargeDataProvider.h b/test/TestProviders/LargeDataProvider/LargeDataProvider.h
index ffe3229..6bda44c 100644
--- a/test/TestProviders/LargeDataProvider/LargeDataProvider.h
+++ b/test/TestProviders/LargeDataProvider/LargeDataProvider.h
@@ -29,10 +29,6 @@
//
//==============================================================================
//
-// Author: <Subodh Soni> (<ssubodh@in.ibm.com>)
-//
-// Modified By:
-//
//%/////////////////////////////////////////////////////////////////////////////
#ifndef Pegasus_LargeDataProvider_H
@@ -44,60 +40,60 @@
PEGASUS_NAMESPACE_BEGIN
class LargeDataProvider :
- public CIMInstanceProvider
+ public CIMInstanceProvider
{
public:
- LargeDataProvider(void);
- virtual ~LargeDataProvider(void);
+ LargeDataProvider(void);
+ virtual ~LargeDataProvider(void);
- // CIMProvider interface
- virtual void initialize(CIMOMHandle & cimom);
- virtual void terminate(void);
+ // CIMProvider interface
+ virtual void initialize(CIMOMHandle & cimom);
+ virtual void terminate(void);
- // CIMInstanceProvider interface
- virtual void getInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler);
+ // CIMInstanceProvider interface
+ virtual void getInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler);
- virtual void enumerateInstances(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler);
+ virtual void enumerateInstances(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler);
- virtual void enumerateInstanceNames(
- const OperationContext & context,
- const CIMObjectPath & ref,
- ObjectPathResponseHandler & handler);
+ virtual void enumerateInstanceNames(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ ObjectPathResponseHandler & handler);
- virtual void modifyInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const CIMInstance & obj,
- const Boolean includeQualifiers,
- const CIMPropertyList & propertyList,
- ResponseHandler & handler);
+ virtual void modifyInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const CIMInstance & obj,
+ const Boolean includeQualifiers,
+ const CIMPropertyList & propertyList,
+ ResponseHandler & handler);
- virtual void createInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const CIMInstance & obj,
- ObjectPathResponseHandler & handler);
+ virtual void createInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const CIMInstance & obj,
+ ObjectPathResponseHandler & handler);
- virtual void deleteInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- ResponseHandler & handler);
+ virtual void deleteInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ ResponseHandler & handler);
protected:
- Array<CIMInstance> _instances;
- Array<CIMObjectPath> _instanceNames;
+ Array<CIMInstance> _instances;
+ Array<CIMObjectPath> _instanceNames;
};
PEGASUS_NAMESPACE_END
diff --git a/test/TestProviders/LargeDataProvider/LargeDataProviderMain.cpp b/test/TestProviders/LargeDataProvider/LargeDataProviderMain.cpp
index 499e3d8..44e992d 100644
--- a/test/TestProviders/LargeDataProvider/LargeDataProviderMain.cpp
+++ b/test/TestProviders/LargeDataProvider/LargeDataProviderMain.cpp
@@ -29,10 +29,6 @@
//
//==============================================================================
//
-// Author: <Subodh Soni> (<ssubodh@in.ibm.com>)
-//
-// Modified By:
-//
//%/////////////////////////////////////////////////////////////////////////////
#include <iostream>
@@ -43,15 +39,16 @@
PEGASUS_NAMESPACE_BEGIN
PEGASUS_USING_STD;
-extern "C" PEGASUS_EXPORT CIMProvider * PegasusCreateProvider(const String & name)
+extern "C" PEGASUS_EXPORT CIMProvider * PegasusCreateProvider(
+ const String & name)
{
- if(String::equalNoCase(name, "largedataprovider") ||
- String::equalNoCase(name, "largedataprovider (PROVIDER)"))
- {
- cout << "Entry to LargeDataProvider" << endl;
- return(new LargeDataProvider());
- }
- return(0);
+ if(String::equalNoCase(name, "largedataprovider") ||
+ String::equalNoCase(name, "largedataprovider (PROVIDER)"))
+ {
+ cout << "Entry to LargeDataProvider" << endl;
+ return(new LargeDataProvider());
+ }
+ return(0);
}
PEGASUS_NAMESPACE_END
diff --git a/test/TestProviders/MultithreadingTests/MultithreadingSampleProvider.cpp b/test/TestProviders/MultithreadingTests/MultithreadingSampleProvider.cpp
index 2e3d402..8e8fe38 100644
--- a/test/TestProviders/MultithreadingTests/MultithreadingSampleProvider.cpp
+++ b/test/TestProviders/MultithreadingTests/MultithreadingSampleProvider.cpp
@@ -29,12 +29,6 @@
//
//==============================================================================
//
-// Author: Subodh Soni IBM Corporation, (ssubodh@in.ibm.com)
-//
-// Modified By:
-//
-//
-//
//%////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
@@ -50,78 +44,78 @@
#include <Pegasus/Common/CIMDateTime.h>
#include <Pegasus/Common/InternalException.h>
-#define NO_OF_INSTANCES 5
+#define NO_OF_INSTANCES 5
PEGASUS_NAMESPACE_BEGIN
PEGASUS_USING_STD;
void writer (const char* message, int count, FILE* stream)
{
- for (; count > 0; --count) {
- // Write the message to the stream, and send it off immediately.
- fprintf (stream,"%s\n" , message);
- fflush (stream);
- // Sleeping for a long time in the writer thread so as to get a timeout
- // when CLI is executed from inside the reader thread
- sleep (100);
- }
+ for (; count > 0; --count) {
+ // Write the message to the stream, and send it off immediately.
+ fprintf (stream,"%s\n" , message);
+ fflush (stream);
+ // Sleeping for a long time in the writer thread so as to get a timeout
+ // when CLI is executed from inside the reader thread
+ sleep (100);
+ }
}
void reader (FILE* stream)
{
- char buffer[1024];
- // Read until we hit the end of the stream. fgets reads until either
- // a newline or the end-of-file.
- while (!feof(stream)
- && !ferror(stream)
- && fgets(buffer, sizeof(buffer), stream) != NULL)
- fputs (buffer, stdout);
+ char buffer[1024];
+ // Read until we hit the end of the stream. fgets reads until either
+ // a newline or the end-of-file.
+ while (!feof(stream)
+ && !ferror(stream)
+ && fgets(buffer, sizeof(buffer), stream) != NULL)
+ fputs (buffer, stdout);
}
int CreateThreads()
{
- char* arg_list[] = {
- "CLI",
- "niall",
- "-n",
- "root/SampleProvider",
- NULL
- };
- int fds[2];
- pid_t cpid;
-
- pipe(fds);
-
- cpid = fork();
- if (cpid == (pid_t)0)
- {
- FILE* stream;
- // This is the child process. Close our copy of the write end
- // of the file descriptor.
- close(fds[1]);
- // Connect the read end of the pipe to standard input.
- dup2(fds[0], STDIN_FILENO);
- // Convert the read file descriptor to a FILE object, and read from it
- stream = fdopen(fds[0],"r" );
- reader(stream);
- close(fds[0]);
- // Replace the child process with the CLI program
- execvp ("CLI", arg_list);
- }
- else
- {
- FILE* stream;
- // Close our copy of the read end of the file descriptor.
- close (fds[0]);
- // Convert the write file descriptor to a FILE object,and write to it.
- stream = fdopen(fds[1],"w" );
-
- writer("Test Writer from Parent process\n", 2, stream);
- close (fds[1]);
- // Wait for child process to finish
- waitpid(cpid, NULL, 0);
- }
- return 0;
+ char* arg_list[] = {
+ "CLI",
+ "niall",
+ "-n",
+ "root/SampleProvider",
+ NULL
+ };
+ int fds[2];
+ pid_t cpid;
+
+ pipe(fds);
+
+ cpid = fork();
+ if (cpid == (pid_t)0)
+ {
+ FILE* stream;
+ // This is the child process. Close our copy of the write end
+ // of the file descriptor.
+ close(fds[1]);
+ // Connect the read end of the pipe to standard input.
+ dup2(fds[0], STDIN_FILENO);
+ // Convert the read file descriptor to a FILE object, and read from it
+ stream = fdopen(fds[0],"r" );
+ reader(stream);
+ close(fds[0]);
+ // Replace the child process with the CLI program
+ execvp ("CLI", arg_list);
+ }
+ else
+ {
+ FILE* stream;
+ // Close our copy of the read end of the file descriptor.
+ close (fds[0]);
+ // Convert the write file descriptor to a FILE object,and write to it.
+ stream = fdopen(fds[1],"w" );
+
+ writer("Test Writer from Parent process\n", 2, stream);
+ close (fds[1]);
+ // Wait for child process to finish
+ waitpid(cpid, NULL, 0);
+ }
+ return 0;
}
MultithreadingSampleProvider::MultithreadingSampleProvider(void)
@@ -143,214 +137,215 @@ void MultithreadingSampleProvider::terminate(void)
}
void MultithreadingSampleProvider::getInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler)
{
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
instanceReference.getKeyBindings());
- CIMName className = instanceReference.getClassName();
- cout << "className (Method: getInstance) " << className.getString() << endl;
+ CIMName className = instanceReference.getClassName();
+ cout << "className (Method: getInstance) " << className.getString() << endl;
CIMNamespaceName nameSpace = instanceReference.getNameSpace();
- cout << "[className: " << className.getString()<< "], [in namespace: " << nameSpace.getString() <<
- "] " << endl;
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ cout << "[className: " << className.getString()
+ << "], [in namespace: " << nameSpace.getString()
+ << "] " << endl;
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
{
if(localReference == _instanceNames[i])
- {
- // deliver requested instance
- handler.deliver(_instances[i]);
- break;
- }
- }
- // complete processing the request
- handler.complete();
+ {
+ // deliver requested instance
+ handler.deliver(_instances[i]);
+ break;
+ }
+ }
+ // complete processing the request
+ handler.complete();
}
void MultithreadingSampleProvider::enumerateInstanceNames(
- const OperationContext & context,
- const CIMObjectPath & classReference,
- ObjectPathResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & classReference,
+ ObjectPathResponseHandler & handler)
{
- cout << "MultithreadingSampleProvider::enumerateInstancesNames" << endl;
- // begin processing the request
- handler.processing();
-
+ cout << "MultithreadingSampleProvider::enumerateInstancesNames" << endl;
+ // begin processing the request
+ handler.processing();
+
for(Uint32 i = 0, n = _instances.size(); i < n; i++)
// deliver instance
- handler.deliver(_instanceNames[i]);
- // complete processing the request
- handler.complete();
+ handler.deliver(_instanceNames[i]);
+ // complete processing the request
+ handler.complete();
}
void MultithreadingSampleProvider::enumerateInstances(
- const OperationContext & context,
- const CIMObjectPath & classReference,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & classReference,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler)
{
- int retval;
- char buffer[NO_OF_INSTANCES];
- CIMInstance Instances[NO_OF_INSTANCES];
- CIMObjectPath References[NO_OF_INSTANCES];
+ int retval;
+ char buffer[NO_OF_INSTANCES];
+ CIMInstance Instances[NO_OF_INSTANCES];
+ CIMObjectPath References[NO_OF_INSTANCES];
- cout << "MultithreadingSampleProvider::enumerateInstances" << endl;
- cout << "_instances.size = " << _instances.size() << endl;
+ cout << "MultithreadingSampleProvider::enumerateInstances" << endl;
+ cout << "_instances.size = " << _instances.size() << endl;
-
- // begin processing the request
- handler.processing();
+
+ // begin processing the request
+ handler.processing();
- CIMName clName = classReference.getClassName();
- String className = clName.getString();
- cout << "className = " << className<< endl;
+ CIMName clName = classReference.getClassName();
+ String className = clName.getString();
+ cout << "className = " << className<< endl;
- for (Uint32 i = 0; i < NO_OF_INSTANCES; i++)
+ for (Uint32 i = 0; i < NO_OF_INSTANCES; i++)
{
- sprintf(buffer, "%d", i);
- Instances[i] = CIMInstance("ThreadSampleOne");
- References[i] = CIMObjectPath("ThreadSampleOne.Id="+String(buffer));
+ sprintf(buffer, "%d", i);
+ Instances[i] = CIMInstance("ThreadSampleOne");
+ References[i] = CIMObjectPath("ThreadSampleOne.Id="+String(buffer));
- Instances[i].addProperty(CIMProperty("Id", Uint16(i)));
- Instances[i].addProperty(CIMProperty("Message", String(buffer)));
+ Instances[i].addProperty(CIMProperty("Id", Uint16(i)));
+ Instances[i].addProperty(CIMProperty("Message", String(buffer)));
- _instances.append(Instances[i]);
+ _instances.append(Instances[i]);
_instanceNames.append(References[i]);
- }
- retval = CreateThreads();
- cout << "Return from CreateThreads" << retval << endl;
+ }
+ retval = CreateThreads();
+ cout << "Return from CreateThreads" << retval << endl;
- for(Uint32 i = 0, n = NO_OF_INSTANCES; i < n; i++)
- // deliver reference
- handler.deliver(_instances[i]);
+ for(Uint32 i = 0, n = NO_OF_INSTANCES; i < n; i++)
+ // deliver reference
+ handler.deliver(_instances[i]);
- // complete processing the request
- handler.complete();
+ // complete processing the request
+ handler.complete();
}
void MultithreadingSampleProvider::modifyInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- const CIMInstance & instanceObject,
- const Boolean includeQualifiers,
- const CIMPropertyList & propertyList,
- ResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ const CIMInstance & instanceObject,
+ const Boolean includeQualifiers,
+ const CIMPropertyList & propertyList,
+ ResponseHandler & handler)
{
- cout << "MultithreadingSampleProvider::modifyInstance" << endl;
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- // begin processing the request
- handler.processing();
-
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- // overwrite existing instance
- _instances[i] = instanceObject;
-
- break;
- }
- }
- // complete processing the request
- handler.complete();
+ cout << "MultithreadingSampleProvider::modifyInstance" << endl;
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ // begin processing the request
+ handler.processing();
+
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ // overwrite existing instance
+ _instances[i] = instanceObject;
+
+ break;
+ }
+ }
+ // complete processing the request
+ handler.complete();
}
void MultithreadingSampleProvider::createInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- const CIMInstance & instanceObject,
- ObjectPathResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ const CIMInstance & instanceObject,
+ ObjectPathResponseHandler & handler)
{
- cout << "MultithreadingSampleProvider::createInstance" << endl;
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instanceNames.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- throw CIMObjectAlreadyExistsException(
+ cout << "MultithreadingSampleProvider::createInstance" << endl;
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instanceNames.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ throw CIMObjectAlreadyExistsException(
localReference.toString());
- }
- }
+ }
+ }
- // begin processing the request
- handler.processing();
+ // begin processing the request
+ handler.processing();
- // add the new instance to the array
- _instances.append(instanceObject);
- _instanceNames.append(instanceReference);
+ // add the new instance to the array
+ _instances.append(instanceObject);
+ _instanceNames.append(instanceReference);
- // deliver the new instance
- handler.deliver(_instanceNames[_instanceNames.size() - 1]);
+ // deliver the new instance
+ handler.deliver(_instanceNames[_instanceNames.size() - 1]);
- // complete processing the request
- handler.complete();
+ // complete processing the request
+ handler.complete();
}
void MultithreadingSampleProvider::deleteInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- ResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ ResponseHandler & handler)
{
- cout << "MultithreadingSampleProvider::deleteInstance" << endl;
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- // begin processing the request
- handler.processing();
-
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- // save the instance locally
- CIMInstance cimInstance(_instances[i]);
-
- // remove instance from the array
- _instances.remove(i);
- _instanceNames.remove(i);
-
- // exit loop
- break;
- }
- }
-
- // complete processing the request
- handler.complete();
+ cout << "MultithreadingSampleProvider::deleteInstance" << endl;
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ // begin processing the request
+ handler.processing();
+
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ // save the instance locally
+ CIMInstance cimInstance(_instances[i]);
+
+ // remove instance from the array
+ _instances.remove(i);
+ _instanceNames.remove(i);
+
+ // exit loop
+ break;
+ }
+ }
+
+ // complete processing the request
+ handler.complete();
}
PEGASUS_NAMESPACE_END
diff --git a/test/TestProviders/MultithreadingTests/MultithreadingSampleProvider.h b/test/TestProviders/MultithreadingTests/MultithreadingSampleProvider.h
index 39d4827..0c25da9 100644
--- a/test/TestProviders/MultithreadingTests/MultithreadingSampleProvider.h
+++ b/test/TestProviders/MultithreadingTests/MultithreadingSampleProvider.h
@@ -29,12 +29,6 @@
//
//==============================================================================
//
-// Author: Subodh Soni IBM Corporation, (ssubodh@in.ibm.com)
-//
-// Modified By:
-//
-//
-//
//%////////////////////////////////////////////////////////////////////////////
#ifndef MultithreadingSampleProvider_H
@@ -46,60 +40,60 @@
PEGASUS_NAMESPACE_BEGIN
class MultithreadingSampleProvider :
- public CIMInstanceProvider
+ public CIMInstanceProvider
{
public:
- MultithreadingSampleProvider(void);
- virtual ~MultithreadingSampleProvider(void);
+ MultithreadingSampleProvider(void);
+ virtual ~MultithreadingSampleProvider(void);
- // CIMProvider interface
- virtual void initialize(CIMOMHandle & cimom);
- virtual void terminate(void);
+ // CIMProvider interface
+ virtual void initialize(CIMOMHandle & cimom);
+ virtual void terminate(void);
- // CIMInstanceProvider interface
- virtual void getInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler);
+ // CIMInstanceProvider interface
+ virtual void getInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler);
- virtual void enumerateInstances(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler);
+ virtual void enumerateInstances(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler);
- virtual void enumerateInstanceNames(
- const OperationContext & context,
- const CIMObjectPath & ref,
- ObjectPathResponseHandler & handler);
+ virtual void enumerateInstanceNames(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ ObjectPathResponseHandler & handler);
- virtual void modifyInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const CIMInstance & obj,
- const Boolean includeQualifiers,
- const CIMPropertyList & propertyList,
- ResponseHandler & handler);
+ virtual void modifyInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const CIMInstance & obj,
+ const Boolean includeQualifiers,
+ const CIMPropertyList & propertyList,
+ ResponseHandler & handler);
- virtual void createInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const CIMInstance & obj,
- ObjectPathResponseHandler & handler);
+ virtual void createInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const CIMInstance & obj,
+ ObjectPathResponseHandler & handler);
- virtual void deleteInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- ResponseHandler & handler);
+ virtual void deleteInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ ResponseHandler & handler);
protected:
- Array<CIMInstance> _instances;
- Array<CIMObjectPath> _instanceNames;
+ Array<CIMInstance> _instances;
+ Array<CIMObjectPath> _instanceNames;
};
PEGASUS_NAMESPACE_END
diff --git a/test/TestProviders/MultithreadingTests/MultithreadingSampleProviderMain.cpp b/test/TestProviders/MultithreadingTests/MultithreadingSampleProviderMain.cpp
index 7e401ab..62a44d8 100644
--- a/test/TestProviders/MultithreadingTests/MultithreadingSampleProviderMain.cpp
+++ b/test/TestProviders/MultithreadingTests/MultithreadingSampleProviderMain.cpp
@@ -29,12 +29,6 @@
//
//==============================================================================
//
-// Author: Subodh Soni IBM Corporation, (ssubodh@in.ibm.com)
-//
-// Modified By:
-//
-//
-//
//%////////////////////////////////////////////////////////////////////////////
#include <iostream>
@@ -45,15 +39,16 @@
PEGASUS_NAMESPACE_BEGIN
PEGASUS_USING_STD;
-extern "C" PEGASUS_EXPORT CIMProvider * PegasusCreateProvider(const String & name)
+extern "C" PEGASUS_EXPORT CIMProvider * PegasusCreateProvider(
+ const String & name)
{
- if(String::equalNoCase(name, "MultithreadingSampleprovider") ||
- String::equalNoCase(name, "MultithreadingSampleprovider (PROVIDER)"))
- {
- cout << "Entry to MultithreadingSampleProvider" << endl;
- return(new MultithreadingSampleProvider());
- }
- return(0);
+ if(String::equalNoCase(name, "MultithreadingSampleprovider") ||
+ String::equalNoCase(name, "MultithreadingSampleprovider (PROVIDER)"))
+ {
+ cout << "Entry to MultithreadingSampleProvider" << endl;
+ return(new MultithreadingSampleProvider());
+ }
+ return(0);
}
PEGASUS_NAMESPACE_END
diff --git a/test/TestProviders/TimingTests/TimingClient.cpp b/test/TestProviders/TimingTests/TimingClient.cpp
index 5e296a0..64857a3 100644
--- a/test/TestProviders/TimingTests/TimingClient.cpp
+++ b/test/TestProviders/TimingTests/TimingClient.cpp
@@ -62,7 +62,7 @@ static void EnumerateClassesTiming(CIMClient client, String BaseClassName)
catch(Exception& e)
{
cout << "Error Classes Enumeration:" << endl;
- cout << e.getMessage() << endl;
+ cout << e.getMessage() << endl;
}
}
@@ -115,10 +115,10 @@ int main(int argc, char** argv)
EnumerateInstancesTiming(client, CLASSONE);
_exit(0);
}
- // parent
+ // parent
sleep(10);
EnumerateInstancesTiming(client, CLASSTWO);
- sleep(5);
+ sleep(5);
EnumerateClassesTiming(client, "TimingSampleClass");
}
catch(Exception& e)
diff --git a/test/TestProviders/TimingTests/TimingProvider.cpp b/test/TestProviders/TimingTests/TimingProvider.cpp
index 89e281b..e9a10fc 100644
--- a/test/TestProviders/TimingTests/TimingProvider.cpp
+++ b/test/TestProviders/TimingTests/TimingProvider.cpp
@@ -29,12 +29,6 @@
//
//==============================================================================
//
-// Author: Subodh Soni IBM Corporation, (ssubodh@in.ibm.com)
-//
-// Modified By:
-//
-//
-//
//%////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
@@ -58,9 +52,9 @@ TimingProvider::~TimingProvider(void)
void TimingProvider::initialize(CIMOMHandle & cimom)
{
- cout <<" TimingProvider::initialize" << endl;
+ cout <<" TimingProvider::initialize" << endl;
- // Create Instances for TimeOne Class
+ // Create Instances for TimeOne Class
CIMInstance instance1("TimeOne");
CIMObjectPath reference1("TimeOne.Id=1");
@@ -80,9 +74,9 @@ void TimingProvider::initialize(CIMOMHandle & cimom)
_instances.append(instance2);
_instanceNames.append(reference2);
- // Create Instances for TimeTwo Class
- CIMInstance instance_1("TimeTwo");
- CIMObjectPath reference_1("TimeTwo.Srno=22");
+ // Create Instances for TimeTwo Class
+ CIMInstance instance_1("TimeTwo");
+ CIMObjectPath reference_1("TimeTwo.Srno=22");
instance_1.addProperty(CIMProperty("Srno", Uint8(1))); // key
instance_1.addProperty(CIMProperty("TimeVar", Uint16(1111)));
@@ -101,220 +95,220 @@ void TimingProvider::initialize(CIMOMHandle & cimom)
void TimingProvider::terminate(void)
{
- cout <<" TimingProvider::terminate" << endl;
+ cout <<" TimingProvider::terminate" << endl;
}
void TimingProvider::getInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler)
{
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- CIMName className = instanceReference.getClassName();
-
- // begin processing the request
- handler.processing();
-
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- // deliver requested instance
- handler.deliver(_instances[i]);
-
- break;
- }
- }
- // complete processing the request
- handler.complete();
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ CIMName className = instanceReference.getClassName();
+
+ // begin processing the request
+ handler.processing();
+
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ // deliver requested instance
+ handler.deliver(_instances[i]);
+
+ break;
+ }
+ }
+ // complete processing the request
+ handler.complete();
}
void TimingProvider::enumerateInstances(
- const OperationContext & context,
- const CIMObjectPath & classReference,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & classReference,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler)
{
- cout <<"TimingProvider::enumerateInstances" << endl;
- CIMName cn = classReference.getClassName();
-
- String className = cn.getString();
- sleep(15);
- // cout << "className = " << className << endl;
- // Create Instances for TimeOne Class
- if (String::equalNoCase(className, "TimeOne"))
- {
- sleep(5);
- // announce operation processing.
- handler.processing();
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- // deliver instance
- handler.deliver(_instances[i]);
- }
- // Create Instances for SecondClass
- if (String::equalNoCase(className, "TimeTwo"))
- {
- handler.processing();
- sleep(5);
-
- for(Uint32 i = 0, n = _instances_2.size(); i < n; i++)
- // deliver instance
- handler.deliver(_instances_2[i]);
- }
- // complete processing the request
- handler.complete();
+ cout <<"TimingProvider::enumerateInstances" << endl;
+ CIMName cn = classReference.getClassName();
+
+ String className = cn.getString();
+ sleep(15);
+ // cout << "className = " << className << endl;
+ // Create Instances for TimeOne Class
+ if (String::equalNoCase(className, "TimeOne"))
+ {
+ sleep(5);
+ // announce operation processing.
+ handler.processing();
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ // deliver instance
+ handler.deliver(_instances[i]);
+ }
+ // Create Instances for SecondClass
+ if (String::equalNoCase(className, "TimeTwo"))
+ {
+ handler.processing();
+ sleep(5);
+
+ for(Uint32 i = 0, n = _instances_2.size(); i < n; i++)
+ // deliver instance
+ handler.deliver(_instances_2[i]);
+ }
+ // complete processing the request
+ handler.complete();
}
void TimingProvider::enumerateInstanceNames(
- const OperationContext & context,
- const CIMObjectPath & classReference,
- ObjectPathResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & classReference,
+ ObjectPathResponseHandler & handler)
{
- // begin processing the request
- handler.processing();
- cout <<"TimingProvider::enumerateInstanceNames" << endl;
- CIMName clName = classReference.getClassName();
-
- sleep(10);
- if (clName == "TimeOne")
- {
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- // deliver reference
- handler.deliver(_instanceNames[i]);
- }
- else if (clName == "TimeTwo")
- {
- for(Uint32 i = 0, n = _instances_2.size(); i < n; i++)
- // deliver reference
- handler.deliver(_instanceNames_2[i]);
- }
- // complete processing the request
- cout <<"TimingProvider::enumerateInstanceNames" << endl;
- handler.complete();
+ // begin processing the request
+ handler.processing();
+ cout <<"TimingProvider::enumerateInstanceNames" << endl;
+ CIMName clName = classReference.getClassName();
+
+ sleep(10);
+ if (clName == "TimeOne")
+ {
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ // deliver reference
+ handler.deliver(_instanceNames[i]);
+ }
+ else if (clName == "TimeTwo")
+ {
+ for(Uint32 i = 0, n = _instances_2.size(); i < n; i++)
+ // deliver reference
+ handler.deliver(_instanceNames_2[i]);
+ }
+ // complete processing the request
+ cout <<"TimingProvider::enumerateInstanceNames" << endl;
+ handler.complete();
}
void TimingProvider::modifyInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- const CIMInstance & instanceObject,
- const Boolean includeQualifiers,
- const CIMPropertyList & propertyList,
- ResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ const CIMInstance & instanceObject,
+ const Boolean includeQualifiers,
+ const CIMPropertyList & propertyList,
+ ResponseHandler & handler)
{
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
- cout <<"TimingProvider::modifyInstance" << endl;
- // begin processing the request
- handler.processing();
-
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- // overwrite existing instance
- _instances[i] = instanceObject;
-
- break;
- }
- }
- // complete processing the request
- handler.complete();
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+ cout <<"TimingProvider::modifyInstance" << endl;
+ // begin processing the request
+ handler.processing();
+
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ // overwrite existing instance
+ _instances[i] = instanceObject;
+
+ break;
+ }
+ }
+ // complete processing the request
+ handler.complete();
}
void TimingProvider::createInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- const CIMInstance & instanceObject,
- ObjectPathResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ const CIMInstance & instanceObject,
+ ObjectPathResponseHandler & handler)
{
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- cout <<"TimingProvider::createInstance" << endl;
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instanceNames.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- throw CIMObjectAlreadyExistsException(
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ cout <<"TimingProvider::createInstance" << endl;
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instanceNames.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ throw CIMObjectAlreadyExistsException(
localReference.toString());
- }
- }
- // begin processing the request
- handler.processing();
- // add the new instance to the array
- _instances.append(instanceObject);
- _instanceNames.append(instanceReference);
-
- cout <<"TimingProvider::createInstance" << endl;
- // deliver the new instance
- handler.deliver(_instanceNames[_instanceNames.size() - 1]);
-
- // complete processing the request
- handler.complete();
+ }
+ }
+ // begin processing the request
+ handler.processing();
+ // add the new instance to the array
+ _instances.append(instanceObject);
+ _instanceNames.append(instanceReference);
+
+ cout <<"TimingProvider::createInstance" << endl;
+ // deliver the new instance
+ handler.deliver(_instanceNames[_instanceNames.size() - 1]);
+
+ // complete processing the request
+ handler.complete();
}
void TimingProvider::deleteInstance(
- const OperationContext & context,
- const CIMObjectPath & instanceReference,
- ResponseHandler & handler)
+ const OperationContext & context,
+ const CIMObjectPath & instanceReference,
+ ResponseHandler & handler)
{
- // convert a potential fully qualified reference into a local reference
- // (class name and keys only).
- CIMObjectPath localReference = CIMObjectPath(
- String(),
- String(),
- instanceReference.getClassName(),
- instanceReference.getKeyBindings());
-
- // begin processing the request
- handler.processing();
-
- cout <<"TimingProvider::deleteInstance" << endl;
- // instance index corresponds to reference index
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
- {
- if(localReference == _instanceNames[i])
- {
- // save the instance locally
- CIMInstance cimInstance(_instances[i]);
-
- // remove instance from the array
- _instances.remove(i);
- _instanceNames.remove(i);
-
- // exit loop
- break;
- }
- }
-
- cout <<"TimingProvider::deleteInstance" << endl;
- // complete processing the request
- handler.complete();
+ // convert a potential fully qualified reference into a local reference
+ // (class name and keys only).
+ CIMObjectPath localReference = CIMObjectPath(
+ String(),
+ String(),
+ instanceReference.getClassName(),
+ instanceReference.getKeyBindings());
+
+ // begin processing the request
+ handler.processing();
+
+ cout <<"TimingProvider::deleteInstance" << endl;
+ // instance index corresponds to reference index
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ {
+ if(localReference == _instanceNames[i])
+ {
+ // save the instance locally
+ CIMInstance cimInstance(_instances[i]);
+
+ // remove instance from the array
+ _instances.remove(i);
+ _instanceNames.remove(i);
+
+ // exit loop
+ break;
+ }
+ }
+
+ cout <<"TimingProvider::deleteInstance" << endl;
+ // complete processing the request
+ handler.complete();
}
PEGASUS_NAMESPACE_END
diff --git a/test/TestProviders/TimingTests/TimingProvider.h b/test/TestProviders/TimingTests/TimingProvider.h
index 5b16e00..4be2408 100644
--- a/test/TestProviders/TimingTests/TimingProvider.h
+++ b/test/TestProviders/TimingTests/TimingProvider.h
@@ -29,12 +29,6 @@
//
//==============================================================================
//
-// Author: Subodh Soni IBM Corporation, (ssubodh@in.ibm.com)
-//
-// Modified By:
-//
-//
-//
//%////////////////////////////////////////////////////////////////////////////
#ifndef TimingProvider_H
@@ -46,62 +40,62 @@
PEGASUS_NAMESPACE_BEGIN
class TimingProvider :
- public CIMInstanceProvider
+ public CIMInstanceProvider
{
public:
- TimingProvider(void);
- virtual ~TimingProvider(void);
+ TimingProvider(void);
+ virtual ~TimingProvider(void);
- // CIMProvider interface
- virtual void initialize(CIMOMHandle & cimom);
- virtual void terminate(void);
+ // CIMProvider interface
+ virtual void initialize(CIMOMHandle & cimom);
+ virtual void terminate(void);
- // CIMInstanceProvider interface
- virtual void getInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler);
+ // CIMInstanceProvider interface
+ virtual void getInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler);
- virtual void enumerateInstances(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler);
+ virtual void enumerateInstances(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler);
- virtual void enumerateInstanceNames(
- const OperationContext & context,
- const CIMObjectPath & ref,
- ObjectPathResponseHandler & handler);
+ virtual void enumerateInstanceNames(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ ObjectPathResponseHandler & handler);
- virtual void modifyInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const CIMInstance & obj,
- const Boolean includeQualifiers,
- const CIMPropertyList & propertyList,
- ResponseHandler & handler);
+ virtual void modifyInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const CIMInstance & obj,
+ const Boolean includeQualifiers,
+ const CIMPropertyList & propertyList,
+ ResponseHandler & handler);
- virtual void createInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const CIMInstance & obj,
- ObjectPathResponseHandler & handler);
+ virtual void createInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const CIMInstance & obj,
+ ObjectPathResponseHandler & handler);
- virtual void deleteInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- ResponseHandler & handler);
+ virtual void deleteInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ ResponseHandler & handler);
protected:
- Array<CIMObjectPath> _instanceNames;
- Array<CIMObjectPath> _instanceNames_2;
- Array<CIMInstance> _instances;
- Array<CIMInstance> _instances_2;
+ Array<CIMObjectPath> _instanceNames;
+ Array<CIMObjectPath> _instanceNames_2;
+ Array<CIMInstance> _instances;
+ Array<CIMInstance> _instances_2;
};
PEGASUS_NAMESPACE_END
diff --git a/test/TestProviders/TimingTests/TimingProviderMain.cpp b/test/TestProviders/TimingTests/TimingProviderMain.cpp
index 7a79534..8103d2d 100644
--- a/test/TestProviders/TimingTests/TimingProviderMain.cpp
+++ b/test/TestProviders/TimingTests/TimingProviderMain.cpp
@@ -29,12 +29,6 @@
//
//==============================================================================
//
-// Author: Subodh Soni IBM Corporation, (ssubodh@in.ibm.com)
-//
-// Modified By:
-//
-//
-//
//%////////////////////////////////////////////////////////////////////////////
#include <iostream>
@@ -45,15 +39,16 @@
PEGASUS_NAMESPACE_BEGIN
PEGASUS_USING_STD;
-extern "C" PEGASUS_EXPORT CIMProvider * PegasusCreateProvider(const String & name)
+extern "C" PEGASUS_EXPORT CIMProvider * PegasusCreateProvider(
+ const String & name)
{
- if(String::equalNoCase(name, "timingprovider") ||
- String::equalNoCase(name, "timingprovider (PROVIDER)"))
- {
- cout << "Entry to TimingProvider" << endl;
- return(new TimingProvider());
- }
- return(0);
+ if(String::equalNoCase(name, "timingprovider") ||
+ String::equalNoCase(name, "timingprovider (PROVIDER)"))
+ {
+ cout << "Entry to TimingProvider" << endl;
+ return(new TimingProvider());
+ }
+ return(0);
}
PEGASUS_NAMESPACE_END
diff --git a/test/TestProviders/XMLParserGen/ParserTestProvider.cpp b/test/TestProviders/XMLParserGen/ParserTestProvider.cpp
index dc13bf9..7625ac3 100644
--- a/test/TestProviders/XMLParserGen/ParserTestProvider.cpp
+++ b/test/TestProviders/XMLParserGen/ParserTestProvider.cpp
@@ -29,10 +29,6 @@
//
//==============================================================================
//
-// Author: <Subodh Soni> (<ssubodh@in.ibm.com>)
-//
-// Modified By:
-//
//%/////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
@@ -60,34 +56,34 @@ Boolean ParserTestProvider::tryTerminate(void) {
void ParserTestProvider::initialize(CIMOMHandle & cimom)
{
- cout << "ParserTestProvider::initialize" << endl;
+ cout << "ParserTestProvider::initialize" << endl;
CIMInstance instance1("Sample_PClassOne");
- CIMObjectPath reference1("Sample_PClassOne.CName=ClassOne");
- // keys
+ CIMObjectPath reference1("Sample_PClassOne.CName=ClassOne");
+ // keys
instance1.addProperty(CIMProperty("CName", String("Sample_PClassOne")));
instance1.addProperty(CIMProperty("CNum", Uint16(1)));
instance1.addProperty(CIMProperty("BadStringName", String(BADSTR_1)));
- //other
+ //other
instance1.addProperty(CIMProperty("BadStringNum", Uint16(1)));
_instances.append(instance1);
- _instanceNames.append(reference1);
+ _instanceNames.append(reference1);
CIMInstance instance2("Sample_PClassOne");
- CIMObjectPath reference2("Sample_PClassOne.CName=ClassTwo");
+ CIMObjectPath reference2("Sample_PClassOne.CName=ClassTwo");
- // keys
+ // keys
instance2.addProperty(CIMProperty("CName", String("Sample_PClassOne")));
instance2.addProperty(CIMProperty("CNum", Uint16(2)));
instance2.addProperty(CIMProperty("BadStringName", String(BADSTR_2)));
- // other
+ // other
instance2.addProperty(CIMProperty("BadStringNum", Uint16(2)));
_instances.append(instance2);
- _instanceNames.append(reference2);
+ _instanceNames.append(reference2);
}
void ParserTestProvider::terminate(void)
@@ -103,27 +99,27 @@ void ParserTestProvider::getInstance(
const CIMPropertyList & propertyList,
InstanceResponseHandler & handler)
{
- String Value;
+ String Value;
char csname[256];
int cnum;
char badstrname[256];
cout << "ParserTestProvider::getInstance" << endl;
- CIMName className = instanceReference.getClassName();
+ CIMName className = instanceReference.getClassName();
CIMNamespaceName nameSpace = instanceReference.getNameSpace();
Array<CIMKeyBinding> keys = instanceReference.getKeyBindings();
- for (int i = 0; i < (int)keys.size(); i++)
- {
- CIMName cimName = keys[i].getName();
- Value = keys[i].getValue();
+ for (int i = 0; i < (int)keys.size(); i++)
+ {
+ CIMName cimName = keys[i].getName();
+ Value = keys[i].getValue();
- if (cimName.equal("BadStringName")) {
- strncpy(badstrname, Value.getCString(), 256);
- }
- }
+ if (cimName.equal("BadStringName")) {
+ strncpy(badstrname, Value.getCString(), 256);
+ }
+ }
CIMInstance instance(CLASS_NAME);
instance.setPath(CIMObjectPath(String::EMPTY, // hostname
nameSpace,
@@ -133,7 +129,7 @@ void ParserTestProvider::getInstance(
String(CLASS_NAME)));
instance.addProperty(CIMProperty("BadStringName",
String(badstrname)));
-
+
//begin processing the request
handler.processing();
@@ -150,38 +146,38 @@ void ParserTestProvider::enumerateInstances(
const CIMPropertyList & propertyList,
InstanceResponseHandler & handler)
{
- // begin processing the request
-
- CIMName className = classReference.getClassName();
+ // begin processing the request
+
+ CIMName className = classReference.getClassName();
CIMNamespaceName nameSpace = classReference.getNameSpace();
- //cout "[className: "<<className<<"], [in namespace: " << nameSpace << "]";
+ //cout "[className: "<<className<<"], [in namespace: " << nameSpace << "]";
handler.processing();
- Array<CIMKeyBinding> keys;
-
- keys.append(CIMKeyBinding("CName",
- String(CLASS_NAME),
- CIMKeyBinding::STRING));
- keys.append(CIMKeyBinding("BadStringName",
- String(BADSTR_1),
- CIMKeyBinding::STRING));
- CIMInstance instance(CLASS_NAME);
-
- instance.setPath(CIMObjectPath(String::EMPTY,
- nameSpace,
- CLASS_NAME,
- keys));
- // keys
- instance.addProperty(CIMProperty("CName",
- String(CLASS_NAME)));
+ Array<CIMKeyBinding> keys;
+
+ keys.append(CIMKeyBinding("CName",
+ String(CLASS_NAME),
+ CIMKeyBinding::STRING));
+ keys.append(CIMKeyBinding("BadStringName",
+ String(BADSTR_1),
+ CIMKeyBinding::STRING));
+ CIMInstance instance(CLASS_NAME);
+
+ instance.setPath(CIMObjectPath(String::EMPTY,
+ nameSpace,
+ CLASS_NAME,
+ keys));
+ // keys
+ instance.addProperty(CIMProperty("CName",
+ String(CLASS_NAME)));
instance.addProperty(CIMProperty("BadStringName",
- String(BADSTR_1)));
+ String(BADSTR_1)));
- for(Uint32 i = 0, n = _instances.size(); i < n; i++)
+ for(Uint32 i = 0, n = _instances.size(); i < n; i++)
handler.deliver(_instances[i]);
- //
- handler.deliver(instance);
- handler.complete();
+ //
+ handler.deliver(instance);
+ handler.complete();
}
void ParserTestProvider::enumerateInstanceNames(
@@ -194,23 +190,23 @@ void ParserTestProvider::enumerateInstanceNames(
// begin processing the request
CIMName className = classReference.getClassName();
CIMNamespaceName nameSpace = classReference.getNameSpace();
- //DEBUG("[className: "<<className<<"], [in namespace: " << nameSpace << "]");
+ //DEBUG("[className: "<<className<<"], [in namespace: "<<nameSpace<<"]");
handler.processing();
- Array<CIMKeyBinding> keys;
+ Array<CIMKeyBinding> keys;
- keys.append(CIMKeyBinding("CName",
- String(CLASS_NAME),
- CIMKeyBinding::STRING));
- keys.append(CIMKeyBinding("BadStr",
+ keys.append(CIMKeyBinding("CName",
+ String(CLASS_NAME),
+ CIMKeyBinding::STRING));
+ keys.append(CIMKeyBinding("BadStr",
String(BADSTR_1),
- CIMKeyBinding::STRING));
+ CIMKeyBinding::STRING));
- CIMObjectPath obj_path = CIMObjectPath(String(),
- nameSpace,
- className,
- keys);
+ CIMObjectPath obj_path = CIMObjectPath(String(),
+ nameSpace,
+ className,
+ keys);
handler.deliver(obj_path);
// complete processing the request
handler.complete();
diff --git a/test/TestProviders/XMLParserGen/ParserTestProvider.h b/test/TestProviders/XMLParserGen/ParserTestProvider.h
index 844453e..6361fe7 100644
--- a/test/TestProviders/XMLParserGen/ParserTestProvider.h
+++ b/test/TestProviders/XMLParserGen/ParserTestProvider.h
@@ -29,10 +29,6 @@
//
//==============================================================================
//
-// Author: <Subodh Soni> (<ssubodh@in.ibm.com>)
-//
-// Modified By:
-//
//%/////////////////////////////////////////////////////////////////////////////
#ifndef Pegasus_ParserTestProvider_h
@@ -51,9 +47,9 @@ using namespace std;
// Till here
//
#define CLASS_NAME "SampleXML_ParserClass"
-#define CLASS_1 "Sample_PClassOne"
-#define CLASS_2 "Sample_PClassTwo"
-#define CLASS_3 "Sample_PClassThree"
+#define CLASS_1 "Sample_PClassOne"
+#define CLASS_2 "Sample_PClassTwo"
+#define CLASS_3 "Sample_PClassThree"
#define BADSTR_1 "\0\0\0\'\'\'\'\'0000<<<<<<<>"
#define BADSTR_2 "\0\0\0\'\'\'\'\'0000 "
@@ -62,57 +58,57 @@ using namespace std;
PEGASUS_NAMESPACE_BEGIN
class ParserTestProvider :
- public CIMInstanceProvider
+ public CIMInstanceProvider
{
public:
- ParserTestProvider(void);
- virtual ~ParserTestProvider(void);
- virtual Boolean tryTerminate(void);
-
- // CIMProvider interface
- virtual void initialize(CIMOMHandle & cimom);
- virtual void terminate(void);
-
- // CIMInstanceProvider interface
- virtual void getInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler);
-
- virtual void enumerateInstances(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const Boolean includeQualifiers,
- const Boolean includeClassOrigin,
- const CIMPropertyList & propertyList,
- InstanceResponseHandler & handler);
-
- virtual void enumerateInstanceNames(
- const OperationContext & context,
- const CIMObjectPath & ref,
- ObjectPathResponseHandler & handler);
-
- virtual void modifyInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const CIMInstance & obj,
- const Boolean includeQualifiers,
- const CIMPropertyList & propertyList,
- ResponseHandler & handler);
-
- virtual void createInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- const CIMInstance & obj,
- ObjectPathResponseHandler & handler);
-
- virtual void deleteInstance(
- const OperationContext & context,
- const CIMObjectPath & ref,
- ResponseHandler & handler);
+ ParserTestProvider(void);
+ virtual ~ParserTestProvider(void);
+ virtual Boolean tryTerminate(void);
+
+ // CIMProvider interface
+ virtual void initialize(CIMOMHandle & cimom);
+ virtual void terminate(void);
+
+ // CIMInstanceProvider interface
+ virtual void getInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler);
+
+ virtual void enumerateInstances(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const Boolean includeQualifiers,
+ const Boolean includeClassOrigin,
+ const CIMPropertyList & propertyList,
+ InstanceResponseHandler & handler);
+
+ virtual void enumerateInstanceNames(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ ObjectPathResponseHandler & handler);
+
+ virtual void modifyInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const CIMInstance & obj,
+ const Boolean includeQualifiers,
+ const CIMPropertyList & propertyList,
+ ResponseHandler & handler);
+
+ virtual void createInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ const CIMInstance & obj,
+ ObjectPathResponseHandler & handler);
+
+ virtual void deleteInstance(
+ const OperationContext & context,
+ const CIMObjectPath & ref,
+ ResponseHandler & handler);
protected:
Array<CIMInstance> _instances;
diff --git a/test/TestProviders/XMLParserGen/ParserTestProviderMain.cpp b/test/TestProviders/XMLParserGen/ParserTestProviderMain.cpp
index 5dfa742..5d15905 100644
--- a/test/TestProviders/XMLParserGen/ParserTestProviderMain.cpp
+++ b/test/TestProviders/XMLParserGen/ParserTestProviderMain.cpp
@@ -29,10 +29,6 @@
//
//==============================================================================
//
-// Author: <Subodh Soni> (<ssubodh@in.ibm.com>)
-//
-// Modified By:
-//
//%/////////////////////////////////////////////////////////////////////////////
#include <Pegasus/Common/Config.h>
@@ -41,14 +37,15 @@
PEGASUS_NAMESPACE_BEGIN
-extern "C" PEGASUS_EXPORT CIMProvider * PegasusCreateProvider(const String & name)
+extern "C" PEGASUS_EXPORT CIMProvider * PegasusCreateProvider(
+ const String & name)
{
- // The name is defiend in the registration mof in PG_Provider as Name
- if(String::equalNoCase(name, "ParserTestProvider"))
- {
+ // The name is defiend in the registration mof in PG_Provider as Name
+ if(String::equalNoCase(name, "ParserTestProvider"))
+ {
DEBUG("main-> started up provider");
- return(new ParserTestProvider());
- }
+ return(new ParserTestProvider());
+ }
DEBUG("main-> skipped us , searches for:[" << name << "]");
return NULL;