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. URLConnection conn;
  64. conn = url2.openConnection();
  65. conn.setDoOutput(true);
  66. System.out.println(conn.getOutputStream());
  67. //OutputStreamWriter wr = new OutputStreamWriter();
  68. } catch(MalformedURLException me){
  69. System.out.println("na");
  70. }catch (IOException ex) {
  71. Logger.getLogger(PageRankServiceTest.class.getName()).log(Level.SEVERE, null, ex);
  72. }
  73.  
  74. }
  75. }
  76.  
Success #stdin #stdout 0.03s 25796KB
stdin
Standard input is empty
stdout
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class PageRankServiceTest {

    public PageRankServiceTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    /**
     * Test of getFirstMatch method, of class PageRankService.
     */
    @Test
    @Ignore
    public void testGetFirstMatch() {
        System.out.println("getFirstMatch");
        String searchPattern = "";
        String textString = "";
        int expResult = 0;
        int result = PageRankService.getFirstMatch(searchPattern, textString);
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        // fail("The test case is a prototype.");
    }



    @Test
    public void testfromWhysoft() {
        System.out.println("getPageRank");
        String url = "http://s...content-available-to-author-only...s.hu";
        int expResult = 0;
        try {
            URL url2 = new URL("http://s...content-available-to-author-only...s.hu:80");
            URLConnection conn;
            conn = url2.openConnection();
            conn.setDoOutput(true);
            System.out.println(conn.getOutputStream());
            //OutputStreamWriter wr = new OutputStreamWriter();
        } catch(MalformedURLException me){
            System.out.println("na");
        }catch (IOException ex) {
            Logger.getLogger(PageRankServiceTest.class.getName()).log(Level.SEVERE, null, ex);
        } 

    }
}