-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCrawlerHardTest.java
More file actions
32 lines (27 loc) · 1.04 KB
/
Copy pathCrawlerHardTest.java
File metadata and controls
32 lines (27 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package info.kgeorgiy.java.advanced.crawler;
import org.junit.Assert;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import java.io.IOException;
/**
* @author Georgiy Korneev (kgeorgiy@kgeorgiy.info)
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class CrawlerHardTest extends CrawlerEasyTest {
@Test
public void test10_singleConnectionPerHost() throws IOException {
test("http://www.ifmo.ru", 2, Integer.MAX_VALUE, Integer.MAX_VALUE, 1, 10, 10);
}
@Test
public void test11_limitedConnectionsPerHost() throws IOException {
test("http://www.ifmo.ru", 2, Integer.MAX_VALUE, Integer.MAX_VALUE, 10, 10, 10);
}
@Test
public void test12_limitedConnectionsPerformance() throws IOException {
final long time = test("http://www.ifmo.ru", 2, Integer.MAX_VALUE, Integer.MAX_VALUE, 3, 100, 100);
System.out.println("Time: " + time);
Assert.assertTrue("Too parallel", time > 2000);
Assert.assertTrue("Not parallel", time < 4000);
}
}