Commit 255d3227 authored by Ivan Tyagov's avatar Ivan Tyagov Committed by Julien Muchembled

portal_caches tool is expected to allow only Cache Factory instances inside

parent b031c0e4
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
<item>Ram Cache</item> <item>Ram Cache</item>
</portal_type> </portal_type>
<portal_type id="Cache Tool"> <portal_type id="Cache Tool">
<item>Cache Bag</item>
<item>Cache Factory</item> <item>Cache Factory</item>
</portal_type> </portal_type>
<portal_type id="Category"> <portal_type id="Category">
......
...@@ -11,7 +11,6 @@ Cache Bag | Ram Cache ...@@ -11,7 +11,6 @@ Cache Bag | Ram Cache
Cache Factory | Cache Bag Cache Factory | Cache Bag
Cache Factory | Distributed Ram Cache Cache Factory | Distributed Ram Cache
Cache Factory | Ram Cache Cache Factory | Ram Cache
Cache Tool | Cache Bag
Cache Tool | Cache Factory Cache Tool | Cache Factory
Category Tool | Base Category Category Tool | Base Category
Category | Category Category | Category
...@@ -56,4 +55,4 @@ Simulation Movement | Applied Rule ...@@ -56,4 +55,4 @@ Simulation Movement | Applied Rule
Simulation Tool | Applied Rule Simulation Tool | Applied Rule
Template Tool | Business Template Template Tool | Business Template
Trash Tool | Trash Bin Trash Tool | Trash Bin
Types Tool | Base Type Types Tool | Base Type
\ No newline at end of file
...@@ -44,11 +44,11 @@ class TestDocumentWithFlare(TestDocument): ...@@ -44,11 +44,11 @@ class TestDocumentWithFlare(TestDocument):
def setSystemPreference(self): def setSystemPreference(self):
system_preference = TestDocument.setSystemPreference(self) system_preference = TestDocument.setSystemPreference(self)
memcached = _getPersistentMemcachedServerDict() memcached = _getPersistentMemcachedServerDict()
# create a Cache Bag for tests # create a Cache Factory for tests
cache_bag = self.portal.portal_caches.newContent(portal_type = 'Cache Bag') cache_factory = self.portal.portal_caches.newContent(portal_type = 'Cache Factory')
cache_bag.cache_duration = 15768000 cache_factory.cache_duration = 15768000
cache_plugin = cache_bag.newContent(portal_type='Distributed Ram Cache') cache_plugin = cache_factory.newContent(portal_type='Distributed Ram Cache')
system_preference.setPreferredConversionCacheFactory(cache_bag.getId()) system_preference.setPreferredConversionCacheFactory(cache_factory.getId())
persistent_memcached_plugin = self.portal.portal_memcached.persistent_memcached_plugin persistent_memcached_plugin = self.portal.portal_memcached.persistent_memcached_plugin
persistent_memcached_plugin.setUrlString('%s:%s' %(memcached['hostname'], memcached['port'])) persistent_memcached_plugin.setUrlString('%s:%s' %(memcached['hostname'], memcached['port']))
cache_plugin.setSpecialiseValue(persistent_memcached_plugin) cache_plugin.setSpecialiseValue(persistent_memcached_plugin)
......
...@@ -49,11 +49,11 @@ class TestIngestionWithFlare(TestIngestion): ...@@ -49,11 +49,11 @@ class TestIngestionWithFlare(TestIngestion):
def setSystemPreference(self): def setSystemPreference(self):
default_pref = self.portal.portal_preferences.default_site_preference default_pref = self.portal.portal_preferences.default_site_preference
memcached = _getPersistentMemcachedServerDict() memcached = _getPersistentMemcachedServerDict()
# create a Cache Bag for tests # create a Cache Factory for tests
cache_bag = self.portal.portal_caches.newContent(portal_type = 'Cache Bag') cache_factory = self.portal.portal_caches.newContent(portal_type = 'Cache Factory')
cache_bag.cache_duration = 15768000 cache_factory.cache_duration = 15768000
cache_plugin = cache_bag.newContent(portal_type='Distributed Ram Cache') cache_plugin = cache_factory.newContent(portal_type='Distributed Ram Cache')
default_pref.setPreferredConversionCacheFactory(cache_bag.getId()) default_pref.setPreferredConversionCacheFactory(cache_factory.getId())
persistent_memcached_plugin = self.portal.portal_memcached.persistent_memcached_plugin persistent_memcached_plugin = self.portal.portal_memcached.persistent_memcached_plugin
persistent_memcached_plugin.setUrlString('%s:%s' %(memcached['hostname'], memcached['port'])) persistent_memcached_plugin.setUrlString('%s:%s' %(memcached['hostname'], memcached['port']))
cache_plugin.setSpecialiseValue(persistent_memcached_plugin) cache_plugin.setSpecialiseValue(persistent_memcached_plugin)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment