Search in sources :

Example 1 with RunWithSubject

use of org.eclipse.scout.rt.testing.platform.runner.RunWithSubject in project scout.rt by eclipse.

the class ClientTestRunnerDifferentSubjectTest method test2.

@Test
@RunWithSubject("john")
public void test2() {
    ISession clientSession = IClientSession.CURRENT.get();
    assertTrue(clientSession instanceof JUnitClientSession);
    assertEquals("john", getCurrentUser());
    m_clientSessions.add(clientSession);
}
Also used : ISession(org.eclipse.scout.rt.shared.ISession) JUnitClientSession(org.eclipse.scout.rt.testing.client.runner.ClientTestRunnerDifferentSubjectTest.JUnitClientSession) RunWithSubject(org.eclipse.scout.rt.testing.platform.runner.RunWithSubject) Test(org.junit.Test)

Example 2 with RunWithSubject

use of org.eclipse.scout.rt.testing.platform.runner.RunWithSubject 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);
}
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.ServerTestRunnerDifferentSubjectTest.JUnitServerSession) RunWithSubject(org.eclipse.scout.rt.testing.platform.runner.RunWithSubject) Test(org.junit.Test)

Aggregations

ISession (org.eclipse.scout.rt.shared.ISession)2 RunWithSubject (org.eclipse.scout.rt.testing.platform.runner.RunWithSubject)2 Test (org.junit.Test)2 ITransaction (org.eclipse.scout.rt.platform.transaction.ITransaction)1 JUnitClientSession (org.eclipse.scout.rt.testing.client.runner.ClientTestRunnerDifferentSubjectTest.JUnitClientSession)1 JUnitServerSession (org.eclipse.scout.rt.testing.server.runner.ServerTestRunnerDifferentSubjectTest.JUnitServerSession)1