/** Tests validateSetup with invalid config. */
 @Test(expected = RuntimeException.class)
 public void testValidateSetup_invalid() {
   Class<? extends TransactionManager> tmClass = JdbcConnectionsTransactionManager.class;
   UtilityForBo2Test.setCurrentTransactionManager(tmClass);
   JotmConnectionStrategy subject = new JotmConnectionStrategy();
   ReflectionUtils.invokeMethodByUniqueName(
       subject, "validateSetup", new Object[] {}); // $NON-NLS-1$
 }
示例#2
0
 /** Unit test for handleSetter. */
 @Test
 public void testHandleMethod_concreteNoAccessor() {
   TypeAnalysis analysis = new TypeAnalysis();
   analysis.clazz = AbstractSampleInterfaceImpl.class;
   Method method = ReflectionUtils.getMethodByUniqueName("toString", analysis.clazz);
   analysis.handleMethod(method);
   Assert.assertTrue(analysis.abstractGetters.isEmpty());
   Assert.assertTrue(analysis.concreteGetters.isEmpty());
   Assert.assertTrue(analysis.abstractSetters.isEmpty());
   Assert.assertTrue(analysis.concreteSetters.isEmpty());
   Assert.assertTrue(analysis.abstractMethods.isEmpty());
   Assert.assertTrue(analysis.concreteMethods.contains(method));
 }
 /** Tests validateSetup */
 @Test
 public void testValidateSetup_valid() {
   JotmConnectionStrategy subject = new JotmConnectionStrategy();
   ReflectionUtils.invokeMethodByUniqueName(
       subject, "validateSetup", new Object[] {}); // $NON-NLS-1$
 }