title: Quickfix/J - do I need to call Session.lookupSession(sessionId).logon();
body: <p>Is it neccessary to call this line</p>
  
  <pre><code>Session.lookupSession(is).logon();
  </code></pre>
  
  <p>in this code</p>
  
  <pre><code>socketInitiator.start();
              SessionID sessionId = socketInitiator.getSessions().get(0);
              Session.lookupSession(id).logon();
              while (!Session.lookupSession(id).isLoggedOn()) {
                  System.out.println("Waiting for login success");
                  Thread.sleep(500);
              }
  </code></pre>
  
  <p>what is its purpose, as when I omit it, it still gets by the while loop.</p>
  
  <p>EDIT_<strong><em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>___</strong></p>
  
  <p>I was using this in a unit test</p>
  
  <pre><code>socketInitiator.start();
              SessionID sessionId = socketInitiator.getSessions().get(0);
              Session.lookupSession(id).logon();
              while (!Session.lookupSession(id).isLoggedOn()) {
                  System.out.println("Waiting for login success");
                  Thread.sleep(500);
              }
          System.out.println("Logged In...booking SingleOrder from session: " + sessionId);
  
  
          //check that the party receives the fix message
          assertTrue(isBookSingleOrderReceivedFromFixInbound(sessionId));
  </code></pre>