Package br.gov.frameworkdemoiselle.context

Examples of br.gov.frameworkdemoiselle.context.RequestContext.activate()


    boolean viewActivatedHere = !tempViewContext.isActive();
    boolean conversationActivatedHere = !tempConversationContext.isActive();
   
    if (!registered) {
      if (!tempRequestContext.isActive())
        tempRequestContext.activate();
     
      if (!tempSessionContext.isActive())
        tempSessionContext.activate();
     
      if (!tempViewContext.isActive())
View Full Code Here


   
    if (!requestContext.isActive()){
      logger.debug(bundle.getString("management-debug-starting-custom-context",
          requestContext.getClass().getCanonicalName(), managedType.getCanonicalName()));
     
      requestContext.activate();
    }
   
    if (!viewContext.isActive()){
      logger.debug(bundle.getString("management-debug-starting-custom-context",
          viewContext.getClass().getCanonicalName(), managedType.getCanonicalName()));
View Full Code Here

   
    if (!requestContext.isActive()){
      logger.debug(bundle.getString("management-debug-starting-custom-context",
          requestContext.getClass().getCanonicalName(), managedType.getCanonicalName()));
     
      requestContext.activate();
    }
   
    if (!conversationContext.isActive()){
      logger.debug(bundle.getString("management-debug-starting-custom-context",
          conversationContext.getClass().getCanonicalName(), managedType.getCanonicalName()));
View Full Code Here

      SessionContext sessionContext = Beans.getReference(SessionContext.class);
      ViewContext viewContext = Beans.getReference(ViewContext.class);
      ConversationContext conversationContext = Beans.getReference(ConversationContext.class);
     
      if (requestContext!=null){
        startedContextHere.put("request", requestContext.activate());
      }
     
      if (sessionContext!=null){
        startedContextHere.put("session", sessionContext.activate());
      }
View Full Code Here

  }

  @Test
  public void loginProcess() {
    RequestContext ctx = Beans.getReference(RequestContext.class);
    ctx.activate();

    context.login();
    assertTrue(context.isLoggedIn());
    assertNotNull(observer.getEvent());
    assertEquals("demoiselle", context.getUser().getId());
View Full Code Here

  }

  @Test
  public void logoutProcess() {
    RequestContext ctx = Beans.getReference(RequestContext.class);
    ctx.activate();

    context.login();
    context.logout();
    assertFalse(context.isLoggedIn());
    assertNull(context.getUser());
View Full Code Here

  }
 
  @Test
  public void denyWrongCredentials() {
    RequestContext ctx = Beans.getReference(RequestContext.class);
    ctx.activate();
   
    Credentials credentials = Beans.getReference(Credentials.class);
    credentials.setLogin("wronglogin");
   
    try{
View Full Code Here

  }
 
  @Test
  public void acceptRightCredentials() {
    RequestContext ctx = Beans.getReference(RequestContext.class);
    ctx.activate();
   
    Credentials credentials = Beans.getReference(Credentials.class);
    credentials.setLogin("demoiselle");
   
    try{
View Full Code Here

  @Test
  @Deprecated
  public void testAddMessageWithoutParams() {
    RequestContext context = Beans.getReference(RequestContext.class);

    context.activate();
    Message message = new DefaultMessage("Menssage without param");
    DummyMessageAppender appender = Beans.getReference(DummyMessageAppender.class);

    messageContext.add(message);
    assertEquals(appender.getMessages().size(), 1);
View Full Code Here

  @Test
  @Deprecated
  public void testAddMessageWithoutParamsIfSeverityIsInfo() {
    RequestContext context = Beans.getReference(RequestContext.class);

    context.activate();
    Message message = new DefaultMessage("Menssage without param");
    DummyMessageAppender appender = Beans.getReference(DummyMessageAppender.class);

    messageContext.add(message);
    assertEquals(appender.getMessages().get(0).getSeverity(), SeverityType.INFO);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.