Search in sources :

Example 1 with JUnitServerSession

use of org.eclipse.scout.rt.testing.server.runner.ServerTestRunnerSameSessionTest.JUnitServerSession in project scout.rt by eclipse.

the class ServerTestRunnerSameSessionTest method test2.

@Test
public void test2() {
    ISession serverSession = IServerSession.CURRENT.get();
    assertTrue(serverSession instanceof JUnitServerSession);
    assertEquals("anna", serverSession.getUserId());
    m_serverSessions.add(serverSession);
    ITransaction transaction = ITransaction.CURRENT.get();
    assertNotNull(transaction);
    m_transactions.add(transaction);
}
Also used : ISession(org.eclipse.scout.rt.shared.ISession) ITransaction(org.eclipse.scout.rt.platform.transaction.ITransaction) JUnitServerSession(org.eclipse.scout.rt.testing.server.runner.ServerTestRunnerSameSessionTest.JUnitServerSession) Test(org.junit.Test)

Example 2 with JUnitServerSession

use of org.eclipse.scout.rt.testing.server.runner.ServerTestRunnerSameSessionTest.JUnitServerSession in project scout.rt by eclipse.

the class ServerTestRunnerSameSessionTest method afterClass.

@AfterClass
public static void afterClass() {
    ISession serverSession = IServerSession.CURRENT.get();
    assertTrue(serverSession instanceof JUnitServerSession);
    assertEquals("anna", serverSession.getUserId());
    m_serverSessions.add(serverSession);
    ITransaction transaction = ITransaction.CURRENT.get();
    assertNotNull(transaction);
    m_transactions.add(transaction);
    assertEquals(1, m_serverSessions.size());
    // (beforeClass), (before,test1,after), (before,test2,after), (afterClass)
    assertEquals(4, m_transactions.size());
}
Also used : ISession(org.eclipse.scout.rt.shared.ISession) ITransaction(org.eclipse.scout.rt.platform.transaction.ITransaction) JUnitServerSession(org.eclipse.scout.rt.testing.server.runner.ServerTestRunnerSameSessionTest.JUnitServerSession) AfterClass(org.junit.AfterClass)

Example 3 with JUnitServerSession

use of org.eclipse.scout.rt.testing.server.runner.ServerTestRunnerSameSessionTest.JUnitServerSession in project scout.rt by eclipse.

the class ServerTestRunnerSameSessionTest method test1.

@Test
public void test1() {
    ISession serverSession = IServerSession.CURRENT.get();
    assertTrue(serverSession instanceof JUnitServerSession);
    assertEquals("anna", serverSession.getUserId());
    m_serverSessions.add(serverSession);
    ITransaction transaction = ITransaction.CURRENT.get();
    assertNotNull(transaction);
    m_transactions.add(transaction);
}
Also used : ISession(org.eclipse.scout.rt.shared.ISession) ITransaction(org.eclipse.scout.rt.platform.transaction.ITransaction) JUnitServerSession(org.eclipse.scout.rt.testing.server.runner.ServerTestRunnerSameSessionTest.JUnitServerSession) Test(org.junit.Test)

Example 4 with JUnitServerSession

use of org.eclipse.scout.rt.testing.server.runner.ServerTestRunnerSameSessionTest.JUnitServerSession in project scout.rt by eclipse.

the class ServerTestRunnerSameSessionTest method beforeClass.

@BeforeClass
public static void beforeClass() {
    m_serverSessions = new HashSet<>();
    ISession serverSession = IServerSession.CURRENT.get();
    assertTrue(serverSession instanceof JUnitServerSession);
    assertEquals("anna", serverSession.getUserId());
    m_serverSessions.add(serverSession);
    m_transactions = new HashSet<>();
    ITransaction transaction = ITransaction.CURRENT.get();
    assertNotNull(transaction);
    m_transactions.add(transaction);
}
Also used : ISession(org.eclipse.scout.rt.shared.ISession) ITransaction(org.eclipse.scout.rt.platform.transaction.ITransaction) JUnitServerSession(org.eclipse.scout.rt.testing.server.runner.ServerTestRunnerSameSessionTest.JUnitServerSession) BeforeClass(org.junit.BeforeClass)

Aggregations

ITransaction (org.eclipse.scout.rt.platform.transaction.ITransaction)4 ISession (org.eclipse.scout.rt.shared.ISession)4 JUnitServerSession (org.eclipse.scout.rt.testing.server.runner.ServerTestRunnerSameSessionTest.JUnitServerSession)4 Test (org.junit.Test)2 AfterClass (org.junit.AfterClass)1 BeforeClass (org.junit.BeforeClass)1