HueLight::HueLight()
{
-
+ m_connector = nullptr;
}
HueLight::HueLight(HueConnector *connector, std::string address)
HueLight::~HueLight()
{
-
+ m_connector = nullptr;
}
void HueLight::initAttributes()
HueSampleBundleActivator::HueSampleBundleActivator()
{
+ m_pResourceContainer = nullptr;
+ m_connector = nullptr;
}
HueSampleBundleActivator::~HueSampleBundleActivator()
{
+ m_pResourceContainer = nullptr;
+ m_connector = nullptr;
}
void HueSampleBundleActivator::activateBundle(ResourceContainerBundleAPI *resourceContainer,
SoftSensorBundleActivator::SoftSensorBundleActivator()
{
+ m_pResourceContainer = nullptr;
}
SoftSensorBundleActivator::~SoftSensorBundleActivator()
{
+ m_pResourceContainer = nullptr;
}
void SoftSensorBundleActivator::activateBundle(ResourceContainerBundleAPI *resourceContainer,
{
m_activator = nullptr;
m_deactivator = nullptr;
+ m_resourceCreator = nullptr;
+ m_resourceDestroyer = nullptr;
m_bundleHandle = nullptr;
m_loaded = false;
m_activated = false;
+ m_java_bundle = false;
+ m_id = 0;
}
BundleInfoInternal::~BundleInfoInternal()
{
m_activator = nullptr;
m_deactivator = nullptr;
+ m_resourceCreator = nullptr;
+ m_resourceDestroyer = nullptr;
m_bundleHandle = nullptr;
}
void BundleInfoInternal::setBundleInfo(RCSBundleInfo *bundleInfo)
{
- m_ID = bundleInfo->getID();
- m_path = bundleInfo->getPath();
- m_version = bundleInfo->getPath();
+ BundleInfoInternal *source = (BundleInfoInternal *)bundleInfo;
+ m_ID = source->getID();
+ m_path = source->getPath();
+ m_version = source->getVersion();
+ m_loaded = source->isLoaded();
+ m_activated = source->isActivated();
+ m_java_bundle = source->getJavaBundle();
+ m_activator = source->getBundleActivator();
+ m_bundleHandle = source->getBundleHandle();
}
}
}
{
BundleResource::BundleResource()
{
-
+ m_pNotiReceiver = nullptr;
}
BundleResource::~BundleResource()
{
-
+ m_pNotiReceiver = nullptr;
}
void BundleResource::registerObserver(NotificationReceiver *pNotiReceiver)
std::list< string > BundleResource::getAttributeNames()
{
std::list< string > ret;
- for (RCSResourceAttributes::iterator it = m_resourceAttributes.begin(); it != m_resourceAttributes.end(); ++it){
+ for (RCSResourceAttributes::iterator it = m_resourceAttributes.begin();
+ it != m_resourceAttributes.end(); ++it)
+ {
ret.push_back(it->key());
}
return ret;
}
- RCSResourceAttributes& BundleResource::getAttributes(){
+ RCSResourceAttributes &BundleResource::getAttributes()
+ {
return m_resourceAttributes;
}
- void BundleResource::setAttribute(std::string key, RCSResourceAttributes::Value&& value)
+ void BundleResource::setAttribute(std::string key, RCSResourceAttributes::Value &&value)
{
cout << "Bundle resource set attribute " << value.toString() << "|" << endl;
m_resourceAttributes[key] = value;
}
- RCSResourceAttributes::Value BundleResource::getAttribute(const std::string& key){
+ RCSResourceAttributes::Value BundleResource::getAttribute(const std::string &key)
+ {
cout << "Bundle resource get attribute " << m_resourceAttributes.at(key).toString() << "|" << endl;
return m_resourceAttributes.at(key);
}
int length = readlink("/proc/self/exe", buffer, 2047);
- buffer[length] = '\0';
+ if (length > 0 && length < 2047)
+ {
+ buffer[length] = '\0';
- strPath = strrchr(buffer, '/');
+ strPath = strrchr(buffer, '/');
- *strPath = '\0';
+ *strPath = '\0';
- pPath->append(buffer);
+ pPath->append(buffer);
+ }
}
}
}
info_logger() << "Resource container without Java support" << endl;
#endif
- if(!configFile.empty()){
+ if (!configFile.empty())
+ {
m_config = new Configuration(configFile);
if (m_config->isLoaded())
error_logger() << "Container started with invalid configfile path" << endl;
}
}
- else{
+ else
+ {
info_logger() << "No configuration file for the container provided" << endl;
}
}
return &m_instance;
}
- RCSResourceObject::Ptr ResourceContainerImpl::buildResourceObject(const std::string & strUri,
- const std::string & strResourceType)
+ RCSResourceObject::Ptr ResourceContainerImpl::buildResourceObject(const std::string &strUri,
+ const std::string &strResourceType)
{
return RCSResourceObject::Builder(strUri, strResourceType, "DEFAULT_INTERFACE").setObservable(
true).setDiscoverable(true).build();
}
}
- void ResourceContainerImpl::addBundle(const std::string &bundleId, const std::string &bundleUri, const std::string &bundlePath,
+ void ResourceContainerImpl::addBundle(const std::string &bundleId, const std::string &bundleUri,
+ const std::string &bundlePath,
std::map< string, string > params)
{
if (m_bundles.find(bundleId) != m_bundles.end())
{
RCSBundleInfo *bundleInfo = RCSBundleInfo::build();
((BundleInfoInternal *) bundleInfo)->setBundleInfo((RCSBundleInfo *) it->second);
- ret.push_back(it->second);
+ ret.push_back(bundleInfo);
}
}
return ret;
}
- void ResourceContainerImpl::addResourceConfig(const std::string &bundleId, const std::string &resourceUri,
+ void ResourceContainerImpl::addResourceConfig(const std::string &bundleId,
+ const std::string &resourceUri,
std::map< string, string > params)
{
if (m_bundles.find(bundleId) != m_bundles.end())
}
}
- void ResourceContainerImpl::removeResourceConfig(const std::string &bundleId, const std::string &resourceUri)
+ void ResourceContainerImpl::removeResourceConfig(const std::string &bundleId,
+ const std::string &resourceUri)
{
if (m_bundles.find(bundleId) != m_bundles.end())
{
}
}
- void ResourceContainerImpl::removeSoBundleResource(const std::string &bundleId, const std::string &resourceUri)
+ void ResourceContainerImpl::removeSoBundleResource(const std::string &bundleId,
+ const std::string &resourceUri)
{
if (m_mapResources.find(resourceUri) != m_mapResources.end())
{
Ignore("./ResourceContainerInvalidConfig.xml", "./ResourceContainerInvalidConfig.xml")
Command("./TestBundleJava/hue-0.1-jar-with-dependencies.jar","./TestBundleJava/hue-0.1-jar-with-dependencies.jar", Copy("$TARGET", "$SOURCE"))
Ignore("./TestBundleJava/hue-0.1-jar-with-dependencies.jar", "./TestBundleJava/hue-0.1-jar-with-dependencies.jar")
+
+if env.get('TEST') == '1':
+ target_os = env.get('TARGET_OS')
+ if target_os == 'linux':
+ from tools.scons.RunTest import *
+ run_test(container_gtest_env,
+ '',
+ 'service/resource-encapsulation/src/resourceContainer/unittests/container_test')
\ No newline at end of file