コード例 #1
0
 @Override
 public void setUp() throws Exception {
   super.setUp();
   defaultFactory = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
   System.setProperty(
       Context.INITIAL_CONTEXT_FACTORY, "org.crsh.shell.factory.JPAInitialContextFactory");
 }
コード例 #2
0
 @Override
 protected void tearDown() throws Exception {
   super.tearDown();
   if (defaultFactory == null) {
     System.clearProperty(Context.INITIAL_CONTEXT_FACTORY);
   } else {
     System.setProperty(Context.INITIAL_CONTEXT_FACTORY, defaultFactory);
   }
 }