use of org.eclipse.scout.rt.testing.server.runner.ServerTestRunnerDifferentSubjectTest.JUnitServerSession in project scout.rt by eclipse.
the class ServerTestRunnerDifferentSubjectTest 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);
}
use of org.eclipse.scout.rt.testing.server.runner.ServerTestRunnerDifferentSubjectTest.JUnitServerSession in project scout.rt by eclipse.
the class ServerTestRunnerDifferentSubjectTest 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(2, m_serverSessions.size());
// (beforeClass), (before,test1,after), (before,test2,after), (afterClass)
assertEquals(4, m_transactions.size());
}
use of org.eclipse.scout.rt.testing.server.runner.ServerTestRunnerDifferentSubjectTest.JUnitServerSession in project scout.rt by eclipse.
the class ServerTestRunnerDifferentSubjectTest 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);
}
use of org.eclipse.scout.rt.testing.server.runner.ServerTestRunnerDifferentSubjectTest.JUnitServerSession in project scout.rt by eclipse.
the class ServerTestRunnerDifferentSubjectTest method test2.
@Test
@RunWithSubject("john")
public void test2() {
ISession serverSession = IServerSession.CURRENT.get();
assertTrue(serverSession instanceof JUnitServerSession);
assertEquals("john", serverSession.getUserId());
m_serverSessions.add(serverSession);
ITransaction transaction = ITransaction.CURRENT.get();
assertNotNull(transaction);
m_transactions.add(transaction);
}
Aggregations