Package org.teiid.dqp.service

Examples of org.teiid.dqp.service.SessionService



public class TestLogonImpl extends TestCase {

  public void testLogonResult() throws Exception {
    SessionService ssi = Mockito.mock(SessionService.class);
    DQPWorkContext.setWorkContext(new DQPWorkContext());
    String userName = "Fred"; //$NON-NLS-1$
    String applicationName = "test"; //$NON-NLS-1$
    Properties p = new Properties();
    p.setProperty(TeiidURL.CONNECTION.USER_NAME, userName);
    p.setProperty(TeiidURL.CONNECTION.APP_NAME, applicationName);

    SessionMetadata session = new SessionMetadata();
    session.setUserName(userName);
    session.setApplicationName(applicationName);
    session.setSessionId(String.valueOf(1));
    session.setSessionToken(new SessionToken(1, userName));

    Mockito.stub(ssi.createSession(userName, null, applicationName,p, false, true)).toReturn(session);

    LogonImpl impl = new LogonImpl(ssi, "fakeCluster"); //$NON-NLS-1$

    LogonResult result = impl.logon(p);
    assertEquals(userName, result.getUserName());
View Full Code Here

TOP

Related Classes of org.teiid.dqp.service.SessionService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.