package webapp; import org.junit.*; import static org.junit.Assert.*; import com.meterware.httpunit.*; /* * to get a web page */ public class BasicExampleTest { private String uri; @Before public void setUp(){ uri="http://www.lif.univ-mrs.fr/~lugiez/"; } @Test public void isThereLinkTestmain( ) { try { // create the conversation object which will maintain state for us WebConversation wc = new WebConversation(); //get an answer from uri throw the conversation WebResponse response = wc.getResponse(uri ); //test that the response does exists //to see the text from this page print the result of response.getText() System.out.println(response.getText()); assertNotNull(response.getText()); } catch (Exception e) { System.err.println( "Exception: " + e ); //why put a failure there? answer this question as asked in tp5 fail(); } } }