@BeforeMethod
  public void setUp() throws Exception {
    cleanupDB();
    m_mockStoreManager = EasyMock.createMock(IActiveMailboxStoreManager.class);
    ICustomerManager customerMgrMock = new CustomerManagerMock();
    IIslandManager islandMgrMock = createNiceMock(IIslandManager.class);
    int islandId =
        0; // needs to match value for feed/search passed into TestUtils.createCustomer() call to
    // customer manager
    boolean provisioned = true; // needs to be provisioned-enabled
    Island island =
        new Island(islandId, "fooIsland", null, provisioned, false, "fooPlatform", "fooSchema");
    expect(islandMgrMock.getIsland(islandId)).andReturn(island).anyTimes();
    expect(islandMgrMock.isValidIsland(islandId)).andReturn(true).anyTimes();
    replay(islandMgrMock);
    ManagementContainerInjector.getInjector()
        .withService(islandMgrMock, getClass().getName())
        .withService(customerMgrMock, getClass().getName());

    m_customer =
        TestUtils.createActiveMailboxTestCustomer(
            Capabilities.ActiveMailboxSupport.AM_CUSTOMER_ENCRYPTION);
    assertNotNull("Customer should have been created", m_customer);

    TestUtils.cleanupTestUsers(m_customer.getCustID());

    m_user = TestUtils.createUser(m_customer, "user-1", "1", "password");
    assertNotNull("User should have been created", m_user);
  }
示例#2
0
 @BeforeClass
 protected void setUp() throws Exception {
   super.setUp();
   // Be sure your classpath points to the parent of the WEB-INF directory
   setConfigFile("/WEB-INF/struts-config.xml");
   setInitParameter("validating", "false");
   m_customer = TestUtils.createTestCustomer();
   m_user = TestUtils.createUser(m_customer, "system");
 }