Package it.hotel.aspects

Examples of it.hotel.aspects.AddMultiLingualInterceptor


public class TestAddMultiLingualInterceptor extends TestCase {

  public void testInvoke() throws Exception {
   
    AddMultiLingualInterceptor interceptor = new AddMultiLingualInterceptor();
    MethodInvocation invoke = createMock(MethodInvocation.class);
    ILocaleContainer localeContainer = createMock(ILocaleContainer.class);
    ILabelManager labelManager = createMock(ILabelManager.class);
    interceptor.setLabelManager(labelManager);
    interceptor.setLocaleContainer(localeContainer);
   
    expect(localeContainer.getLocale()).andReturn("it");
    expectLastCall().anyTimes();
    expect(labelManager.add(isA(Label.class))).andReturn(true);
    expectLastCall().anyTimes();
   
    replay(localeContainer);
    replay(labelManager);
   
   
    Hotel hotel = new Hotel();
    hotel.setBriefdescription("Questo è un bedlkfj");
   
    try {
      expect(invoke.getArguments()).andReturn(new Object[] {(Object)hotel});
      expect(invoke.proceed()).andReturn(null);
      replay(invoke);
      interceptor.invoke(invoke);
     
    }catch(Throwable t){
      assertTrue(false);
    }
   
View Full Code Here

TOP

Related Classes of it.hotel.aspects.AddMultiLingualInterceptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.