Package info.galleria.service.ejb

Source Code of info.galleria.service.ejb.GroupServiceIntegrationTest

package info.galleria.service.ejb;

import static org.junit.Assert.*;
import info.galleria.domain.Group;

import org.junit.*;
import org.slf4j.*;

public class GroupServiceIntegrationTest extends AbstractIntegrationTest
{
  private static final Logger logger = LoggerFactory.getLogger(GroupServiceIntegrationTest.class);
  private GroupService groupService;

  @BeforeClass
  public static void beforeClass() throws Exception
  {
    logger.info("Entering beforeClass method of {}", GroupServiceIntegrationTest.class);
    AbstractIntegrationTest.setUpBeforeClass();
  }

  @AfterClass
  public static void afterClass() throws Exception
  {
    logger.info("Entering afterClass method of {}", GroupServiceIntegrationTest.class);
    AbstractIntegrationTest.tearDownAfterClass();
  }

  @Override
  public void setUp() throws Exception
  {
    logger.info("Entering setUp of method {}", testMethod.getMethodName());
    super.setUp();
    groupService = (GroupService) context.lookup("java:global/galleria/galleria-ejb/GroupService");
  }

  @Override
  public void tearDown() throws Exception
  {
    logger.info("Entering setUp of method {}", testMethod.getMethodName());
    super.tearDown();
  }

  @Test
  public void testCreateDefaultGroup() throws Exception
  {
    Group registeredUsersGroup = groupService.getOrCreateRegisteredUsersGroup();
    assertNotNull(registeredUsersGroup);
  }

  @Test
  public void testGetDefaultGroup() throws Exception
  {
    Group registeredUsersGroup = groupService.getOrCreateRegisteredUsersGroup();
    Group secondGroup = groupService.getOrCreateRegisteredUsersGroup();

    assertNotNull(registeredUsersGroup);
    assertNotNull(secondGroup);
    assertEquals(registeredUsersGroup, secondGroup);
  }
}
TOP

Related Classes of info.galleria.service.ejb.GroupServiceIntegrationTest

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.