Package org.strecks.injection.internal

Examples of org.strecks.injection.internal.InjectionAnnotationReader


  @Test
  public void testAutoCreateSession()
  {

    InjectionAnnotationReader c = new InjectionAnnotationReader();
    RequestSessionAction action = new RequestSessionAction();

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = createMock(HttpServletRequest.class);
    HttpSession session = createNiceMock(HttpSession.class);

    expect(request.getSession(false)).andReturn(session);
View Full Code Here


  @Test
  public void testNonAutoCreateSession()
  {

    InjectionAnnotationReader c = new InjectionAnnotationReader();
    RequestSessionAction action = new RequestSessionAction();

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
    HttpSession session = EasyMock.createMock(HttpSession.class);

    expect(request.getSession(false)).andReturn(session);
View Full Code Here

 
  @Test
  public void testAutoCreateWithNoSession()
  {

    InjectionAnnotationReader c = new InjectionAnnotationReader();
    RequestSessionAction action = new RequestSessionAction();

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
    HttpSession session = EasyMock.createMock(HttpSession.class);

    expect(request.getSession(false)).andReturn(null);
View Full Code Here

  @Test(expectedExceptions=StaleSessionException.class)
  public void testRequiredSession()
  {

    InjectionAnnotationReader c = new InjectionAnnotationReader();
    RequestSessionAction action = new RequestSessionAction();

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
    HttpSession session = EasyMock.createMock(HttpSession.class);

    expect(request.getSession(false)).andReturn(session);
View Full Code Here

   */
  @Test(expectedExceptions=StaleSessionException.class)
  public void testRequiredAutoCreateSession()
  {

    InjectionAnnotationReader c = new InjectionAnnotationReader();
    RequestSessionAction action = new RequestSessionAction();

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
    HttpSession session = EasyMock.createMock(HttpSession.class);

    expect(request.getSession(false)).andReturn(session);
View Full Code Here

  @Test
  public void testAutoCreateRequest()
  {

    InjectionAnnotationReader c = new InjectionAnnotationReader();
    RequestSessionAction action = new RequestSessionAction();

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = EasyMock.createNiceControl().createMock(HttpServletRequest.class);

    expect(request.getAttribute("autoCreateRequest")).andReturn(null);
View Full Code Here

  @Test
  public void testNonAutoCreateRequest()
  {

    InjectionAnnotationReader c = new InjectionAnnotationReader();
    RequestSessionAction action = new RequestSessionAction();

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);

    expect(request.getAttribute("nonAutoCreateRequest")).andReturn(null);
View Full Code Here

  {

    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    ServletContext context = createStrictMock(ServletContext.class);

    InjectionAnnotationReader c = new InjectionAnnotationReader();
    ActionWithWebHelper action = new ActionWithWebHelper();

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();
    InjectionWrapper inputWrapper = inputs.get("webHelper");

    ActionContext injectionContext = new TestContextImpl(request, null, context, null, null);

    inputWrapper.inject(action, injectionContext);
View Full Code Here

{

  @Test
  public void testPresent()
  {
    InjectionAnnotationReader c = new InjectionAnnotationReader();
    ActionWithRedirectHelper action = new ActionWithRedirectHelper();

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = createMock(HttpServletRequest.class);
    RedirectHelper redirectHelper = createMock(RedirectHelper.class);

    expect(request.getAttribute(InfrastructureKeys.REDIRECT_HELPER)).andReturn(redirectHelper);
View Full Code Here

  }

  @Test
  public void testNotPresent()
  {
    InjectionAnnotationReader c = new InjectionAnnotationReader();
    ActionWithRedirectHelper action = new ActionWithRedirectHelper();

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = createMock(HttpServletRequest.class);
    RedirectHelperImpl redirectHelper = createNiceMock(RedirectHelperImpl.class);

    expect(request.getAttribute(InfrastructureKeys.REDIRECT_HELPER)).andReturn(null);
View Full Code Here

TOP

Related Classes of org.strecks.injection.internal.InjectionAnnotationReader

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.