/** Test whether new ClientTransactions are properly created. */ public void testGetNewClientTransaction() { try { Request invite = createTiInviteRequest(null, null, null); ClientTransaction tran = null; try { tran = tiSipProvider.getNewClientTransaction(invite); } catch (TransactionUnavailableException exc) { exc.printStackTrace(); fail( "A TransactionUnavailableException was thrown while trying to " + "create a new client transaction"); } assertNotNull( "A null ClientTransaction was returned by SipProvider." + "getNewClientTransaction().", tran); String tranBranch = tran.getBranchId(); String reqBranch = ((ViaHeader) invite.getHeader(ViaHeader.NAME)).getBranch(); assertEquals( "The newly created transaction did not have the same " + "branch id as the request that created it", tranBranch, reqBranch); assertNotNull( "The newly created transaction returned a null Dialog. " + "Please check the docs on Transaction.getDialog()", tran.getDialog()); assertNotNull( "The transaction's getRequest() method returned a null Request ", tran.getRequest()); assertEquals( "The transaction's getRequest() method returned a Request " + "that did not match the one that we used to create it!", tran.getRequest(), invite); } catch (Throwable exc) { exc.printStackTrace(); fail(exc.getClass().getName() + ": " + exc.getMessage()); } assertTrue(new Exception().getStackTrace()[0].toString(), true); }