forked from I2P_Developers/i2p.i2p
fix BandwidthLimiterTest
This commit is contained in:
@@ -14,7 +14,11 @@ import java.io.OutputStream;
|
|||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static junit.framework.TestCase.*;
|
||||||
|
import net.i2p.router.Router;
|
||||||
import net.i2p.router.RouterContext;
|
import net.i2p.router.RouterContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,15 +32,14 @@ import net.i2p.router.RouterContext;
|
|||||||
* 10 concurrent threads is, well, slow.
|
* 10 concurrent threads is, well, slow.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class BandwidthLimiterTest extends TestCase{
|
public class BandwidthLimiterTest {
|
||||||
private RouterContext _context;
|
private static RouterContext _context;
|
||||||
private final static int NUM_KB = 256;
|
private final static int NUM_KB = 256;
|
||||||
|
|
||||||
public void setUp() {
|
@BeforeClass
|
||||||
_context = new RouterContext(null);
|
public static void setUp() {
|
||||||
}
|
_context = new RouterContext(new Router());
|
||||||
|
_context.initAll();
|
||||||
public void tearDown(){
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void prepareLimiter(int inKBps, int outKBps, int inBurst, int outBurst) {
|
private void prepareLimiter(int inKBps, int outKBps, int inBurst, int outBurst) {
|
||||||
@@ -102,6 +105,7 @@ public class BandwidthLimiterTest extends TestCase{
|
|||||||
* with various limits) and log the times.
|
* with various limits) and log the times.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Test
|
||||||
public void testOutbound() {
|
public void testOutbound() {
|
||||||
double error;
|
double error;
|
||||||
double predict;
|
double predict;
|
||||||
@@ -137,6 +141,7 @@ public class BandwidthLimiterTest extends TestCase{
|
|||||||
* with various limits) and log the times.
|
* with various limits) and log the times.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Test
|
||||||
public void testInbound() {
|
public void testInbound() {
|
||||||
double predict;
|
double predict;
|
||||||
double error;
|
double error;
|
||||||
@@ -168,6 +173,7 @@ public class BandwidthLimiterTest extends TestCase{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
public void testOutboundContention() {
|
public void testOutboundContention() {
|
||||||
double predict;
|
double predict;
|
||||||
double error;
|
double error;
|
||||||
|
Reference in New Issue
Block a user