@Test(expected = EtiqetException.class) public void invalidImplementation() throws Exception { JmsConfiguration jmsConfiguration = aJmsConfigurationBuilder() .withImplementation("invalid.class") .build(); when(jmsConfigXmlParser.parse(anyString(), eq(JmsConfiguration.class))).thenReturn(jmsConfiguration); JmsConfigExtractor jmsConfigExtractor = new JmsConfigExtractor(jmsConfigXmlParser); jmsConfigExtractor.retrieveConfiguration("file"); }
public JmsConfig retrieveConfiguration(final String configPath) throws EtiqetException { final JmsConfiguration jmsConfiguration = jmsConfigXmlParser.parse(configPath, JmsConfiguration.class); final Class<?> constructorClass; try { constructorClass = Class.forName(jmsConfiguration.getImplementation()); } catch (ReflectiveOperationException e) { throw new EtiqetException(e); } return new JmsConfig( constructorClass, constructorArguments(jmsConfiguration.getConstructorArgs()), setterArguments(jmsConfiguration.getProperties()), jmsConfiguration.getDefaultTopic(), binaryMessageConverterDelegateClass(jmsConfiguration) ); }
JmsConfigExtractor { public JmsConfig retrieveConfiguration(final String configPath) throws EtiqetException { final JmsConfiguration jmsConfiguration = jmsConfigXmlParser.parse(configPath, JmsConfiguration.class); final Class<?> constructorClass; try { constructorClass = Class.forName(jmsConfiguration.getImplementation()); } catch (ReflectiveOperationException e) { throw new EtiqetException(e); } return new JmsConfig( constructorClass, constructorArguments(jmsConfiguration.getConstructorArgs()), setterArguments(jmsConfiguration.getProperties()), jmsConfiguration.getDefaultTopic(), binaryMessageConverterDelegateClass(jmsConfiguration) ); } }
JmsConfigExtractor { public JmsConfig retrieveConfiguration(final String configPath) throws EtiqetException { final JmsConfiguration jmsConfiguration = jmsConfigXmlParser.parse(configPath, JmsConfiguration.class); final Class<?> constructorClass; try { constructorClass = Class.forName(jmsConfiguration.getImplementation()); } catch (ReflectiveOperationException e) { throw new EtiqetException(e); } return new JmsConfig( constructorClass, constructorArguments(jmsConfiguration.getConstructorArgs()), setterArguments(jmsConfiguration.getProperties()), jmsConfiguration.getDefaultTopic(), binaryMessageConverterDelegateClass(jmsConfiguration) ); } JmsConfigExtractor(final JmsConfigXmlParser jmsConfigXmlParser); }
JmsConfigExtractor { public JmsConfig retrieveConfiguration(final String configPath) throws EtiqetException { final JmsConfiguration jmsConfiguration = jmsConfigXmlParser.parse(configPath, JmsConfiguration.class); final Class<?> constructorClass; try { constructorClass = Class.forName(jmsConfiguration.getImplementation()); } catch (ReflectiveOperationException e) { throw new EtiqetException(e); } return new JmsConfig( constructorClass, constructorArguments(jmsConfiguration.getConstructorArgs()), setterArguments(jmsConfiguration.getProperties()), jmsConfiguration.getDefaultTopic(), binaryMessageConverterDelegateClass(jmsConfiguration) ); } JmsConfigExtractor(final JmsConfigXmlParser jmsConfigXmlParser); JmsConfig retrieveConfiguration(final String configPath); }
JmsConfigExtractor { public JmsConfig retrieveConfiguration(final String configPath) throws EtiqetException { final JmsConfiguration jmsConfiguration = jmsConfigXmlParser.parse(configPath, JmsConfiguration.class); final Class<?> constructorClass; try { constructorClass = Class.forName(jmsConfiguration.getImplementation()); } catch (ReflectiveOperationException e) { throw new EtiqetException(e); } return new JmsConfig( constructorClass, constructorArguments(jmsConfiguration.getConstructorArgs()), setterArguments(jmsConfiguration.getProperties()), jmsConfiguration.getDefaultTopic(), binaryMessageConverterDelegateClass(jmsConfiguration) ); } JmsConfigExtractor(final JmsConfigXmlParser jmsConfigXmlParser); JmsConfig retrieveConfiguration(final String configPath);  }