Hi there,

Followed instructions to get wicket working with Spring dependency
injections. It does work in most of the scenarios. 

One scenario that is troubling me is unit testing. I have following
simple class. So long as I have one unit test in the class, it works
fine. If I add more than one test case, setUp method is called more than
twice and wicket throws the exception "Application name can only be set
once.". I tried converting setUp to static and using BeforeClass
annotation so that it's initialized only once. This fails as theApp
dependency is not filled by spring.

Any ideas/help will be greatly appreciated.

public  class TesterMe {

        protected WicketTester tester;

        @Autowired
        protected WicketApplication theApp;

        @Autowired
        protected AnnotationSessionFactoryBean sessionFactory;

        @Before
        public void setUp() {
                Assert.assertNotNull("Could not get application", theApp);
                tester = new WicketTester(theApp);
                
        }

@Test
public void testSomething()
{
}
}

Regards,

Niranjan


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to