fork download
  1.  
  2. import java.io.IOException;
  3. import java.io.OutputStreamWriter;
  4. import java.net.MalformedURLException;
  5. import java.net.URL;
  6. import java.net.URLConnection;
  7. import java.util.logging.Level;
  8. import java.util.logging.Logger;
  9. import org.junit.After;
  10. import org.junit.AfterClass;
  11. import org.junit.Before;
  12. import org.junit.BeforeClass;
  13. import org.junit.Ignore;
  14. import org.junit.Test;
  15. import static org.junit.Assert.*;
  16.  
  17. public class PageRankServiceTest {
  18.  
  19. public PageRankServiceTest() {
  20. }
  21.  
  22. @BeforeClass
  23. public static void setUpClass() throws Exception {
  24. }
  25.  
  26. @AfterClass
  27. public static void tearDownClass() throws Exception {
  28. }
  29.  
  30. @Before
  31. public void setUp() {
  32. }
  33.  
  34. @After
  35. public void tearDown() {
  36. }
  37.  
  38. /**
  39.   * Test of getFirstMatch method, of class PageRankService.
  40.   */
  41. @Test
  42. @Ignore
  43. public void testGetFirstMatch() {
  44. System.out.println("getFirstMatch");
  45. String searchPattern = "";
  46. String textString = "";
  47. int expResult = 0;
  48. int result = PageRankService.getFirstMatch(searchPattern, textString);
  49. assertEquals(expResult, result);
  50. // TODO review the generated test code and remove the default call to fail.
  51. // fail("The test case is a prototype.");
  52. }
  53.  
  54.  
  55.  
  56. @Test
  57. public void testfromWhysoft() {
  58. System.out.println("getPageRank");
  59. String url = "http://s...content-available-to-author-only...s.hu";
  60. int expResult = 0;
  61. try {
  62. URL url2 = new URL("http://s...content-available-to-author-only...s.hu:80");
  63. conn = url2.openConnection();
  64. conn.setDoOutput(true);
  65. System.out.println(conn.getOutputStream());
  66. //OutputStreamWriter wr = new OutputStreamWriter();
  67. } catch(MalformedURLException me){
  68. System.out.println("na");
  69. }catch (IOException ex) {
  70. Logger.getLogger(PageRankServiceTest.class.getName()).log(Level.SEVERE, null, ex);
  71. }
  72.  
  73. }
  74. }
  75.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:17: error: class PageRankServiceTest is public, should be declared in a file named PageRankServiceTest.java
public class PageRankServiceTest {
       ^
Main.java:48: error: cannot find symbol
        int result = PageRankService.getFirstMatch(searchPattern, textString);
                     ^
  symbol:   variable PageRankService
  location: class PageRankServiceTest
2 errors
stdout
Standard output is empty