jruby-ehcache 0.5.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.txt +17 -15
- data/Rakefile +21 -7
- data/VERSION +1 -1
- data/config/ehcache.yml +6 -6
- data/config/ehcache_manual_rmi.yml +6 -6
- data/examples/ehcache.xml +44 -0
- data/examples/jruby-ehcache.rb +13 -0
- data/ext/{ehcache-2.2.0/ehcache-core-2.2.0.jar → ehcache-2.3.0/ehcache-core-2.3.0.jar} +0 -0
- data/ext/ehcache-2.3.0/ehcache-terracotta-2.3.0.jar +0 -0
- data/ext/{ehcache-2.2.0 → ehcache-2.3.0}/slf4j-api-1.5.11.jar +0 -0
- data/ext/{ehcache-2.2.0 → ehcache-2.3.0}/slf4j-jdk14-1.5.11.jar +0 -0
- data/ext/{ehcache-2.2.0/terracotta-toolkit-1.0-runtime-1.0.0.jar → ehcache-2.3.0/terracotta-toolkit-1.1-runtime-2.0.0.jar} +0 -0
- data/lib/ehcache.rb +5 -5
- data/lib/ehcache/cache.rb +50 -119
- data/lib/ehcache/cache_manager.rb +55 -51
- data/lib/ehcache/config.rb +42 -119
- data/lib/ehcache/element.rb +13 -23
- data/lib/ehcache/extensions.rb +3 -0
- data/lib/ehcache/java.rb +35 -5
- data/lib/ehcache/yaml_config.rb +251 -0
- data/test/ehcache.xml +44 -0
- data/test/ehcache.yml +67 -0
- data/test/test_cache.rb +36 -0
- data/test/test_cache_manager.rb +27 -0
- data/test/test_configuration.rb +29 -0
- data/test/test_ehcache.rb +13 -2
- data/test/test_element.rb +37 -0
- data/test/test_helper.rb +21 -1
- data/test/test_yaml_config.rb +159 -0
- metadata +38 -18
- data/ext/ehcache-2.2.0/ehcache-terracotta-2.2.0.jar +0 -0
- data/lib/ehcache/status.rb +0 -9
- data/lib/ehcache/version.rb +0 -9
- data/setup.rb +0 -1585
- data/test/test_ehcachejr.rb +0 -11
data/test/ehcache.xml
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
|
3
|
+
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
4
|
+
xsi:noNamespaceSchemaLocation="../../main/config/ehcache.xsd">
|
5
|
+
|
6
|
+
<!-- Disable for test ehcache.xml. Should go to the same place. -->
|
7
|
+
<diskStore path="java.io.tmpdir"/>
|
8
|
+
|
9
|
+
<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
|
10
|
+
properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1, multicastGroupPort=4446, timeToLive=0"/>
|
11
|
+
|
12
|
+
|
13
|
+
<cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
|
14
|
+
properties="hostName=, port=, socketTimeoutMillis="/>
|
15
|
+
|
16
|
+
|
17
|
+
<defaultCache
|
18
|
+
name="default"
|
19
|
+
maxElementsInMemory="10"
|
20
|
+
eternal="false"
|
21
|
+
timeToIdleSeconds="5"
|
22
|
+
timeToLiveSeconds="10"
|
23
|
+
overflowToDisk="true"
|
24
|
+
/>
|
25
|
+
|
26
|
+
|
27
|
+
<!-- Sample cache named sampleCache1 -->
|
28
|
+
<cache name="sampleCache1"
|
29
|
+
maxElementsInMemory="10000"
|
30
|
+
maxElementsOnDisk="1000"
|
31
|
+
eternal="false"
|
32
|
+
timeToIdleSeconds="360"
|
33
|
+
timeToLiveSeconds="1000"
|
34
|
+
overflowToDisk="true">
|
35
|
+
</cache>
|
36
|
+
|
37
|
+
<!-- Sample cache named sampleCache2. Is eternal. Is diskPersistent but does not overflow to disk -->
|
38
|
+
<cache name="sampleCache2"
|
39
|
+
maxElementsInMemory="1000"
|
40
|
+
eternal="true"
|
41
|
+
overflowToDisk="false"
|
42
|
+
diskPersistent="true"
|
43
|
+
/>
|
44
|
+
</ehcache>
|
data/test/ehcache.yml
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
name: testing
|
2
|
+
update_check: false
|
3
|
+
monitoring: autodetect
|
4
|
+
dynamic_config: true
|
5
|
+
|
6
|
+
disk_store:
|
7
|
+
path: java.io.tmpdir
|
8
|
+
|
9
|
+
transaction_manager:
|
10
|
+
class: net.sf.ehcache.transaction.manager.DefaultTransactionManagerLookup
|
11
|
+
properties: jndiName=java:/TransactionManager
|
12
|
+
property_separator: ";"
|
13
|
+
|
14
|
+
peer_providers:
|
15
|
+
- class: net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory
|
16
|
+
properties: peerDiscovery=automatic,multicastGroupAddress=230.0.0.1,multicastGroupPort=4446,timeToLive=1
|
17
|
+
property_separator: ","
|
18
|
+
|
19
|
+
peer_listeners:
|
20
|
+
- class: net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory
|
21
|
+
|
22
|
+
default_cache:
|
23
|
+
max_elements_in_memory: 10000
|
24
|
+
time_to_live_seconds: 0
|
25
|
+
time_to_idle_seconds: 0
|
26
|
+
overflow_to_disk: true
|
27
|
+
eternal: false
|
28
|
+
disk_spool_buffer_size_mb: 30
|
29
|
+
disk_persistent: false
|
30
|
+
disk_expiry_thread_interval_seconds: 120
|
31
|
+
memory_store_eviction_policy: LRU
|
32
|
+
|
33
|
+
caches:
|
34
|
+
# Sample cache named sampleCache1
|
35
|
+
- name: sampleCache1
|
36
|
+
max_elements_in_memory: 10000
|
37
|
+
max_elements_on_disk: 1000
|
38
|
+
eternal: false
|
39
|
+
time_to_idle_seconds: 360
|
40
|
+
time_to_live_seconds: 1000
|
41
|
+
overflow_to_disk: true
|
42
|
+
|
43
|
+
#Sample cache named sampleCache2. Is eternal. Is diskPersistent but does not overflow to disk
|
44
|
+
- name: sampleCache2
|
45
|
+
max_elements_in_memory: 1000
|
46
|
+
eternal: true
|
47
|
+
overflow_to_disk: false
|
48
|
+
disk_persistent: true
|
49
|
+
|
50
|
+
- name: sampleCacheWithCacheConfigurations
|
51
|
+
max_elements_in_memory: 10
|
52
|
+
eternal: false
|
53
|
+
time_to_idle_seconds: 100
|
54
|
+
time_to_live_seconds: 100
|
55
|
+
overflow_to_disk: false
|
56
|
+
bootstrap_loader:
|
57
|
+
class: net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory
|
58
|
+
properties: "bootstrapAsynchronously=true, maximumChunkSizeBytes=5000000"
|
59
|
+
property_separator: ","
|
60
|
+
event_listeners:
|
61
|
+
- class: net.sf.ehcache.distribution.RMICacheReplicatorFactory
|
62
|
+
properties: "replicateAsynchronously=false, replicatePuts=false, replicatePutsViaCopy=false, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=false"
|
63
|
+
- class: net.sf.ehcache.distribution.RMICacheReplicatorFactory
|
64
|
+
properties: "replicateAsynchronously=false, replicatePuts=false, replicatePutsViaCopy=false, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=false"
|
65
|
+
# extensions:
|
66
|
+
# - class: com.example.FileWatchingCacheRefresherExtensionFactory
|
67
|
+
# properties: "refreshIntervalMillis=18000, loaderTimeout=3000, flushPeriod=whatever, someOtherProperty=someValue"
|
data/test/test_cache.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestCache < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@manager = Ehcache::CacheManager.new
|
7
|
+
@cache = @manager.cache
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
@manager.shutdown if @manager
|
12
|
+
end
|
13
|
+
|
14
|
+
must 'correctly implement compare and swap' do
|
15
|
+
@cache.put('number', 42, {:ttl => 120})
|
16
|
+
assert_equal(42, @cache['number'])
|
17
|
+
@cache.compare_and_swap('number') {|n| n - 31}
|
18
|
+
assert_equal(11, @cache['number'])
|
19
|
+
end
|
20
|
+
|
21
|
+
must 'have aliases for isKeyInCache called include and member' do
|
22
|
+
@cache.put('something', 'no matter')
|
23
|
+
for key in %w[something nothing]
|
24
|
+
assert_equal(@cache.isKeyInCache(key), @cache.include?(key))
|
25
|
+
assert_equal(@cache.isKeyInCache(key), @cache.member?(key))
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
must 'implement each and include Enumerable' do
|
30
|
+
assert_kind_of(Enumerable, @cache)
|
31
|
+
assert_respond_to(@cache, :each)
|
32
|
+
@cache.put('1', 1)
|
33
|
+
@cache.put('2', 2)
|
34
|
+
assert @cache.all? {|e| e.is_a?(Java::NetSfEhcache::Element)}
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestCacheManager < Test::Unit::TestCase
|
4
|
+
def setup
|
5
|
+
@cache_manager = Ehcache::CacheManager.new
|
6
|
+
end
|
7
|
+
|
8
|
+
def teardown
|
9
|
+
@cache_manager.shutdown if @cache_manager
|
10
|
+
end
|
11
|
+
|
12
|
+
must 'be the real Ehcache Java CacheManager' do
|
13
|
+
assert_kind_of(Java::NetSfEhcache::CacheManager, @cache_manager)
|
14
|
+
end
|
15
|
+
|
16
|
+
must 'use the ehcache.xml file in the test directory' do
|
17
|
+
@cache_manager.cache_names.each do |name|
|
18
|
+
puts "Cache: #{name}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
must 'implement each and include Enumerable' do
|
23
|
+
assert_kind_of(Enumerable, @cache_manager)
|
24
|
+
assert_respond_to(@cache_manager, :each)
|
25
|
+
assert @cache_manager.all? {|cache| cache.is_a?(Java::NetSfEhcache::Ehcache)}
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestConfiguration < Test::Unit::TestCase
|
4
|
+
def setup
|
5
|
+
create_config
|
6
|
+
end
|
7
|
+
|
8
|
+
def test_is_a_real_ehcache_java_configuration_object
|
9
|
+
assert_valid_configuration(@config)
|
10
|
+
end
|
11
|
+
|
12
|
+
must 'initialize with ehcache.xml' do
|
13
|
+
create_config(File.join(File.dirname(__FILE__), 'ehcache.xml'))
|
14
|
+
assert_valid_configuration(@config)
|
15
|
+
assert_not_nil(@config.configuration_source)
|
16
|
+
cache_configs = @config.cache_configurations
|
17
|
+
assert_equal(2, cache_configs.size)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def create_config(*args)
|
23
|
+
@config = Ehcache::Config::Configuration.create(*args)
|
24
|
+
end
|
25
|
+
|
26
|
+
def assert_valid_configuration(config)
|
27
|
+
assert_kind_of(Java::NetSfEhcacheConfig::Configuration, config)
|
28
|
+
end
|
29
|
+
end
|
data/test/test_ehcache.rb
CHANGED
@@ -3,9 +3,20 @@ require File.dirname(__FILE__) + '/test_helper.rb'
|
|
3
3
|
class TestEhcache < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def setup
|
6
|
+
@manager = Ehcache::CacheManager.new
|
7
|
+
@cache = @manager.cache
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
@manager.shutdown if @manager
|
6
12
|
end
|
7
13
|
|
8
|
-
def
|
9
|
-
|
14
|
+
def test_demo_usage
|
15
|
+
@cache.put("answer", "42", {:ttl => 120})
|
16
|
+
answer = @cache.get("answer")
|
17
|
+
assert_equal("42", answer.value)
|
18
|
+
assert_equal(120, answer.ttl)
|
19
|
+
question = @cache["question"] || 'unknown'
|
20
|
+
assert_equal('unknown', question)
|
10
21
|
end
|
11
22
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestElement < Test::Unit::TestCase
|
4
|
+
ALIASES = {
|
5
|
+
:tti => :time_to_idle,
|
6
|
+
:ttl => :time_to_live
|
7
|
+
}
|
8
|
+
|
9
|
+
ALIASES.each do |short, long|
|
10
|
+
must "have reader alias named #{short} referring to #{long}" do
|
11
|
+
element = Ehcache::Element.new('', '')
|
12
|
+
assert_respond_to(element, long)
|
13
|
+
assert_respond_to(element, short)
|
14
|
+
assert_equal(element.send(long), element.send(long))
|
15
|
+
end
|
16
|
+
|
17
|
+
must "have writer alias named #{short} referring to #{long}" do
|
18
|
+
element = Ehcache::Element.new('', '')
|
19
|
+
long_writer = "#{long}=".to_sym
|
20
|
+
short_writer = "#{short}=".to_sym
|
21
|
+
assert_respond_to(element, long_writer)
|
22
|
+
assert_respond_to(element, short_writer)
|
23
|
+
|
24
|
+
element.send(long_writer, 1)
|
25
|
+
assert_equal(1, element.send(long))
|
26
|
+
assert_equal(1, element.send(short))
|
27
|
+
element.send(short_writer, 2)
|
28
|
+
assert_equal(2, element.send(long))
|
29
|
+
assert_equal(2, element.send(short))
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
must 'process ttl option on create' do
|
34
|
+
element = Ehcache::Element.create('k', 'v', :ttl => 42)
|
35
|
+
assert_equal(element.ttl, 42)
|
36
|
+
end
|
37
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -1,2 +1,22 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
|
1
3
|
require 'test/unit'
|
2
|
-
require
|
4
|
+
require 'ehcache'
|
5
|
+
require 'java'
|
6
|
+
|
7
|
+
module Test::Unit
|
8
|
+
class TestCase
|
9
|
+
def self.must(name, &block)
|
10
|
+
test_name = "test_#{name.gsub(/[\s.]+/, '_')}".to_sym
|
11
|
+
defined = instance_method(test_name) rescue false
|
12
|
+
raise "#{test_name} is already defined in #{self}" if defined
|
13
|
+
if block_given?
|
14
|
+
define_method(test_name, &block)
|
15
|
+
else
|
16
|
+
define_method(test_name) do
|
17
|
+
flunk "No implementation provided for #{name}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,159 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestConfiguration < Test::Unit::TestCase
|
4
|
+
def setup
|
5
|
+
@yaml_file = File.join(File.dirname(__FILE__), 'ehcache.yml')
|
6
|
+
@config = Ehcache::Config::Configuration.create(@yaml_file)
|
7
|
+
end
|
8
|
+
|
9
|
+
must 'have valid top level attributes' do
|
10
|
+
assert_equal('testing', @config.getName)
|
11
|
+
assert_equal(false, @config.getUpdateCheck)
|
12
|
+
assert_equal(Ehcache::Config::Configuration::Monitoring::AUTODETECT, @config.getMonitoring)
|
13
|
+
assert_equal(true, @config.getDynamicConfig)
|
14
|
+
end
|
15
|
+
|
16
|
+
must 'have valid disk store configuration' do
|
17
|
+
disk_store = @config.getDiskStoreConfiguration
|
18
|
+
assert_not_nil(disk_store)
|
19
|
+
assert_equal(java.lang.System.getProperty('java.io.tmpdir'),
|
20
|
+
disk_store.getPath)
|
21
|
+
end
|
22
|
+
|
23
|
+
must 'have valid transaction manager' do
|
24
|
+
tx_mgr = @config.getTransactionManagerLookupConfiguration
|
25
|
+
assert_factory_configuration_equals(tx_mgr,
|
26
|
+
:class => 'net.sf.ehcache.transaction.manager.DefaultTransactionManagerLookup',
|
27
|
+
:properties => 'jndiName=java:/TransactionManager',
|
28
|
+
:property_separator => ';')
|
29
|
+
end
|
30
|
+
|
31
|
+
must 'have valid peer provider' do
|
32
|
+
peer_providers = @config.getCacheManagerPeerProviderFactoryConfiguration
|
33
|
+
assert_equal(1, peer_providers.size)
|
34
|
+
peer_provider = peer_providers.first
|
35
|
+
assert_factory_configuration_equals(peer_provider,
|
36
|
+
:class => 'net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory',
|
37
|
+
:properties => 'peerDiscovery=automatic,multicastGroupAddress=230.0.0.1,multicastGroupPort=4446,timeToLive=1',
|
38
|
+
:property_separator => ',')
|
39
|
+
end
|
40
|
+
|
41
|
+
must 'have valid peer listener' do
|
42
|
+
peer_listeners = @config.getCacheManagerPeerListenerFactoryConfigurations
|
43
|
+
assert_equal(1, peer_listeners.size)
|
44
|
+
peer_listener = peer_listeners.first
|
45
|
+
assert_factory_configuration_equals(peer_listener,
|
46
|
+
:class => 'net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory')
|
47
|
+
end
|
48
|
+
|
49
|
+
must 'have valid default cache' do
|
50
|
+
default_cache = @config.getDefaultCacheConfiguration
|
51
|
+
expected = {
|
52
|
+
:getMaxElementsInMemory => 10000,
|
53
|
+
:getTimeToLiveSeconds => 0,
|
54
|
+
:getTimeToIdleSeconds => 0,
|
55
|
+
:isOverflowToDisk => true,
|
56
|
+
:isEternal => false,
|
57
|
+
:getDiskSpoolBufferSizeMB => 30,
|
58
|
+
:isDiskPersistent => false,
|
59
|
+
:getDiskExpiryThreadIntervalSeconds => 120,
|
60
|
+
:getMemoryStoreEvictionPolicy => Java::NetSfEhcacheStore::MemoryStoreEvictionPolicy::LRU
|
61
|
+
}
|
62
|
+
expected.each do |key, value|
|
63
|
+
assert_equal(value, default_cache.send(key))
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
must 'have two cache configurations' do
|
68
|
+
caches = @config.getCacheConfigurations
|
69
|
+
assert_equal(3, caches.size)
|
70
|
+
assert(caches.containsKey("sampleCache1"), "Should have sampleCache1")
|
71
|
+
assert(caches.containsKey("sampleCache2"), "Should have sampleCache2")
|
72
|
+
end
|
73
|
+
|
74
|
+
must 'have valid sampleCache1 configuration' do
|
75
|
+
cache = @config.getCacheConfigurations['sampleCache1']
|
76
|
+
expected = {
|
77
|
+
:getMaxElementsInMemory => 10000,
|
78
|
+
:getMaxElementsOnDisk => 1000,
|
79
|
+
:getTimeToLiveSeconds => 1000,
|
80
|
+
:getTimeToIdleSeconds => 360,
|
81
|
+
:isOverflowToDisk => true,
|
82
|
+
:isEternal => false
|
83
|
+
}
|
84
|
+
expected.each do |key, value|
|
85
|
+
assert_equal(value, cache.send(key))
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
must 'have valid sampleCache2 configuration' do
|
90
|
+
cache = @config.getCacheConfigurations['sampleCache2']
|
91
|
+
expected = {
|
92
|
+
:getMaxElementsInMemory => 1000,
|
93
|
+
:isOverflowToDisk => false,
|
94
|
+
:isEternal => true,
|
95
|
+
:isDiskPersistent => true
|
96
|
+
}
|
97
|
+
expected.each do |key, value|
|
98
|
+
assert_equal(value, cache.send(key))
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
must 'have valid sampleCacheWithCacheConfigurations configuration' do
|
103
|
+
cache = @config.getCacheConfigurations['sampleCacheWithCacheConfigurations']
|
104
|
+
expected = {
|
105
|
+
:getMaxElementsInMemory => 10,
|
106
|
+
:isEternal => false,
|
107
|
+
:getTimeToIdleSeconds => 100,
|
108
|
+
:getTimeToLiveSeconds => 100,
|
109
|
+
:isOverflowToDisk => false
|
110
|
+
}
|
111
|
+
expected.each do |key, value|
|
112
|
+
assert_equal(value, cache.send(key))
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
must 'have 2 event listeners in sampleCacheWithCacheConfigurations' do
|
117
|
+
cache = @config.getCacheConfigurations['sampleCacheWithCacheConfigurations']
|
118
|
+
assert_equal(2, cache.getCacheEventListenerConfigurations.size)
|
119
|
+
expected = {
|
120
|
+
:getFullyQualifiedClassPath => 'net.sf.ehcache.distribution.RMICacheReplicatorFactory',
|
121
|
+
:getProperties => "replicateAsynchronously=false, replicatePuts=false, replicatePutsViaCopy=false, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=false"
|
122
|
+
}
|
123
|
+
cache.getCacheEventListenerConfigurations.each do |event_listener|
|
124
|
+
expected.each do |key, value|
|
125
|
+
assert_equal(value, event_listener.send(key))
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
must 'have valid bootstrap loader in sampleCacheWithCacheConfigurations' do
|
131
|
+
cache = @config.getCacheConfigurations['sampleCacheWithCacheConfigurations']
|
132
|
+
assert_not_nil(cache.getBootstrapCacheLoaderFactoryConfiguration)
|
133
|
+
expected = {
|
134
|
+
:getFullyQualifiedClassPath => "net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory",
|
135
|
+
:getProperties => "bootstrapAsynchronously=true, maximumChunkSizeBytes=5000000",
|
136
|
+
:getPropertySeparator => ","
|
137
|
+
}
|
138
|
+
bootstrap_loader = cache.getBootstrapCacheLoaderFactoryConfiguration
|
139
|
+
expected.each do |key, value|
|
140
|
+
assert_equal(value, bootstrap_loader.send(key))
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
private
|
145
|
+
|
146
|
+
def assert_factory_configuration_equals(factory, values)
|
147
|
+
assert_not_nil(factory)
|
148
|
+
assert_kind_of(Hash, values)
|
149
|
+
if values.has_key?(:class)
|
150
|
+
assert_equal(values[:class], factory.getFullyQualifiedClassPath)
|
151
|
+
end
|
152
|
+
if values.has_key?(:properties)
|
153
|
+
assert_equal(values[:properties], factory.getProperties)
|
154
|
+
end
|
155
|
+
if values.has_key?(:property_separator)
|
156
|
+
assert_equal(values[:property_separator], factory.getPropertySeparator)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|