コード例 #1
0
 public void testSingletonCreation() {
   final ObjectFactory objectFactory = LibBaseBoot.getInstance().getObjectFactory();
   final ObjectFactorySingleton objectFactorySingleton1 =
       objectFactory.get(ObjectFactorySingleton.class);
   final ObjectFactorySingleton objectFactorySingleton2 =
       objectFactory.get(ObjectFactorySingleton.class);
   assertTrue(objectFactorySingleton1 == objectFactorySingleton2);
 }
コード例 #2
0
 public void testNotSingletonCreation() {
   final ObjectFactory objectFactory = LibBaseBoot.getInstance().getObjectFactory();
   final ArrayList objectFactorySingleton1 = objectFactory.get(ArrayList.class);
   final ArrayList objectFactorySingleton2 = objectFactory.get(ArrayList.class);
   assertTrue(objectFactorySingleton1 != objectFactorySingleton2);
 }