/**
    Stores a copy of the provided instance locally in the errorInstance
    class property, and also creates a copy of the instance in the static
    repository namespace. The instance is then read back out of the repository
    and compared against the one stored by the class.
*/
void EmbeddedInstanceProvider::createInstance(
    const OperationContext& context,
    const CIMObjectPath& ref,
    const CIMInstance& obj,
    ObjectPathResponseHandler& handler)
{
    handler.processing();
    errorInstance.reset(new CIMInstance(obj));
    Array<CIMName> propNameList;
    propNameList.append(CIMName("errorKey"));
    propNameList.append(CIMName("EmbeddedInst"));
    CIMPropertyList propList(propNameList);
    CIMClass objClass = cimom.getClass(
        context,
        STATIC_REPOSITORY,
        obj.getClassName(),
        false,
        true,
        false,
        propList);
    CIMObjectPath objPath = obj.buildPath(objClass);
    errorInstance->setPath(objPath);

    repositoryPath = cimom.createInstance(
        context, STATIC_REPOSITORY, *errorInstance);

    CIMInstance repositoryInstance = cimom.getInstance(
        context,
        STATIC_REPOSITORY,
        repositoryPath,
        false,
        false,
        false,
        propList);
    repositoryInstance.setPath(repositoryPath);
    
    if (!errorInstance->identical(repositoryInstance))
    {
        throw Exception(
            "Repository instance and local instance for embedded error not "
                "identical");
    }

    handler.deliver(objPath);
    handler.complete();
}
Пример #2
0
void _testIndicationServiceInstance(CIMClient &client)
{
    // Get CIM_IndicationService instance names
    Array<CIMObjectPath> servicePaths = client.enumerateInstanceNames(
        PEGASUS_NAMESPACENAME_INTEROP,
        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE);
    PEGASUS_TEST_ASSERT(servicePaths.size() == 1);

    // Get CIM_IndicationService instances
    Array<CIMInstance> serviceInstances = client.enumerateInstances(
        PEGASUS_NAMESPACENAME_INTEROP,
        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE);
    PEGASUS_TEST_ASSERT(serviceInstances.size() == 1);

    // Get CIM_IndicationService instance
    CIMInstance serinstance = client.getInstance(
        PEGASUS_NAMESPACENAME_INTEROP,
        servicePaths[0]);

    CIMInstance instance = serviceInstances[0];

    _testPropertyValue(
        instance,
        _PROPERTY_FILTERCREATIONENABLED,
        CIMValue(_PROPERTY_FILTERCREATIONENABLED_VALUE));

    _testPropertyValue(
        instance,
        _PROPERTY_SUBSCRIPTIONREMOVALACTION,
        CIMValue(_PROPERTY_SUBSCRIPTIONREMOVALACTION_VALUE));

    _testSubscriptionRemovalIntervalValue(instance);

    _testPropertyValue(
        instance,
        _PROPERTY_DELIVERYRETRYATTEMPTS,
        CIMValue(_PROPERTY_DELIVERYRETRYATTEMPTS_VALUE));

    _testDeliveryRetryIntervalValue(instance);

    // Test GetInstance() on CIM_IndicationService,
    // with property list set.
    Array<CIMName> props;
    props.append(_PROPERTY_DELIVERYRETRYATTEMPTS);
    props.append(_PROPERTY_DELIVERYRETRYINTERVAL);
    CIMPropertyList propList(props);

    CIMInstance seInstance = client.getInstance(
        PEGASUS_NAMESPACENAME_INTEROP,
        servicePaths[0],
        false,
        true,
        true,
        propList);

    _testPropertyValue(
        seInstance,
        _PROPERTY_DELIVERYRETRYATTEMPTS,
        CIMValue(_PROPERTY_DELIVERYRETRYATTEMPTS_VALUE));

    _testDeliveryRetryIntervalValue(instance);

    cout << "+++++ CIM_IndicationService instance"
                " test completed successfully." << endl;
}
Пример #3
0
void _testIndicationServiceCapabilitiesInstance(CIMClient &client)
{
    // Get CIM_IndicationServiceCapabilities instances
    Array<CIMInstance> capInstances = client.enumerateInstances(
        PEGASUS_NAMESPACENAME_INTEROP,
        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES);
    PEGASUS_TEST_ASSERT(capInstances.size() == 1);

    // Get CIM_IndicationServiceCapabilities instance names
    Array<CIMObjectPath> capPaths = client.enumerateInstanceNames(
        PEGASUS_NAMESPACENAME_INTEROP,
        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES);
    PEGASUS_TEST_ASSERT(capPaths.size() == 1);

    // Get CIM_IndicationServiceCapabilities instance
    CIMInstance instance = client.getInstance(
        PEGASUS_NAMESPACENAME_INTEROP,
        capPaths[0]);

    instance = capInstances[0];

    _testPropertyValue(
        instance,
        _PROPERTY_FILTERCREATIONENABLEDISSETTABLE,
        CIMValue(Boolean(false)));

    _testPropertyValue(
        instance,
        _PROPERTY_DELIVERYRETRYATTEMPTSISSETTABLE,
        CIMValue(Boolean(false)));

    _testPropertyValue(
        instance,
        _PROPERTY_DELIVERYRETRYINTERVALISSETTABLE,
        CIMValue(Boolean(false)));

    _testPropertyValue(
        instance,
        _PROPERTY_SUBSCRIPTIONREMOVALACTIONISSETTABLE,
        CIMValue(Boolean(false)));

    _testPropertyValue(
        instance,
        _PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVALISSETTABLE,
        CIMValue(Boolean(false)));

    CIMValue value(CIMTYPE_UINT32, false);

    _testPropertyValue(
        instance,
        _PROPERTY_MAXLISTENERDESTINATIONS,
        value);

    _testPropertyValue(
        instance,
        _PROPERTY_MAXACTIVESUBSCRIPTIONS,
        value);

    _testPropertyValue(
        instance,
        _PROPERTY_SUBSCRIPTIONSPERSISTED,
        CIMValue(Boolean(true)));

    // Test GetInstance() on CIM_IndicationServiceCapabilities,
    // with property list set.
    Array<CIMName> props;
    props.append(_PROPERTY_SUBSCRIPTIONREMOVALACTIONISSETTABLE);
    props.append(_PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVALISSETTABLE);
    CIMPropertyList propList(props);

    CIMInstance caInstance = client.getInstance(
        PEGASUS_NAMESPACENAME_INTEROP,
        capPaths[0],
        false,
        true,
        true,
        propList);

    _testPropertyValue(
        caInstance,
        _PROPERTY_SUBSCRIPTIONREMOVALACTIONISSETTABLE,
        CIMValue(Boolean(false)));

    _testPropertyValue(
        caInstance,
        _PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVALISSETTABLE,
        CIMValue(Boolean(false)));

    cout << "+++++ CIM_IndicationServiceCapabilities instance"
                " test completed successfully." << endl;
}
Пример #4
0
 static PMacc::traits::StringProperty getStringProperties()
 {
     PMacc::traits::StringProperty propList( "name", "Vay" );
     return propList;
 }
Пример #5
0
 static PMacc::traits::StringProperty getStringProperties()
 {
     PMacc::traits::StringProperty propList( "name", "other" );
     propList["param"] = "free streaming";
     return propList;
 }