1 package net.sf.beanrunner.factory.impl; 2 3 import net.sf.beanrunner.factory.BeanRunnerNewInstanceException; 4 5 public class NestedBeanInstanceFactory extends SingleValueInstanceFactory { 6 7 public NestedBeanInstanceFactory(Class key) throws BeanRunnerNewInstanceException { 8 super(); 9 try { 10 setValue(key.newInstance()); 11 } catch (IllegalAccessException ex) { 12 throw new BeanRunnerNewInstanceException( 13 "Unable to create an instance of " 14 + key.getName() 15 + " try using BeanRunner.addTestValue() to create a concrete instance of this type", 16 ex); 17 } catch (InstantiationException ex) { 18 throw new BeanRunnerNewInstanceException( 19 "Unable to create an instance of " 20 + key.getName() 21 + " try using BeanRunner.addTestValue() to create a concrete instance of this type", 22 ex); 23 } 24 } 25 26 }