1
2
3
4
5
6
7
8
9
10
11 package org.mule.util.store;
12
13 import org.mule.api.store.ObjectStore;
14 import org.mule.api.store.ObjectStoreException;
15 import org.mule.tck.testmodels.fruit.Banana;
16
17 import java.io.Serializable;
18
19 import static org.junit.Assert.fail;
20
21 public class SimpleMemoryObjectStoreContractTestCase extends AbstractObjectStoreContractTestCase
22 {
23 @Override
24 public ObjectStore<Serializable> getObjectStore()
25 {
26 return new SimpleMemoryObjectStore<Serializable>();
27 }
28
29 @Override
30 public Serializable getStorableValue()
31 {
32 return new Banana();
33 }
34
35 public void testStoreNullValue() throws Exception
36 {
37 try
38 {
39 getObjectStore().store("key", null);
40 fail("store() called with null value must throw ObjectStoreException");
41 }
42 catch (ObjectStoreException ose)
43 {
44
45 }
46 }
47 }