Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: e19e8826dcea0bc4cb935c16aa4023bd5314dab6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * Copyright (c) 2013 Eike Stepper (Berlin, Germany) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Eike Stepper - initial API and implementation
 */
package org.eclipse.emf.cdo.tests.bugzilla;

import org.eclipse.emf.cdo.tests.AbstractCDOTest;

import org.eclipse.emf.internal.cdo.session.CDOSessionImpl;
import org.eclipse.emf.internal.cdo.session.SessionUtil;

import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;

/**
 * Bug 417825 - Invalidator can die if CDOSession can not be activated within 100ms.
 *
 * @author Eike Stepper
 */
public class Bugzilla_417825_Test extends AbstractCDOTest
{
  public void testInvalidatorLifecycle() throws Exception
  {
    SessionUtil.setTestDelayInSessionActivation(new Runnable()
    {
      public void run()
      {
        // The session invalidator polls its queue every 100ms, so wait a little longer to see if it died
        ConcurrencyUtil.sleep(500L);
      }
    });

    try
    {
      CDOSessionImpl session2 = (CDOSessionImpl)openSession();
      assertEquals(true, session2.isActive());
      assertEquals(true, session2.getInvalidator().isActive());
    }
    finally
    {
      SessionUtil.setTestDelayInSessionActivation(null);
    }
  }
}

Back to the top