1
2
3
4
5
6
7
8
9
10
11 package org.mule.object;
12
13 import org.mule.api.object.ObjectFactory;
14 import org.mule.object.SingletonObjectFactory;
15
16 public class SingletonObjectFactoryTestCase extends AbstractObjectFactoryTestCase
17 {
18
19
20 public ObjectFactory getObjectFactory()
21 {
22 return new SingletonObjectFactory();
23 }
24
25
26 public void testGetObjectClass() throws Exception
27 {
28 SingletonObjectFactory factory = (SingletonObjectFactory) getObjectFactory();
29 factory.setObjectClass(Object.class);
30 factory.initialise();
31 assertEquals(Object.class, factory.getObjectClass());
32 }
33
34
35 public void testGet() throws Exception
36 {
37 SingletonObjectFactory factory = (SingletonObjectFactory) getObjectFactory();
38 factory.setObjectClass(Object.class);
39 factory.initialise();
40 assertSame(factory.getInstance(), factory.getInstance());
41 }
42
43 }