forked from I2P_Developers/i2p.i2p
Create a new RouterContext for net.i2p.router.tunnel tests (can't cast I2PAppContext)
This commit is contained in:
@ -11,7 +11,6 @@ package net.i2p.router.tunnel;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.data.Hash;
|
||||
import net.i2p.data.TunnelId;
|
||||
@ -28,7 +27,7 @@ public class FragmentTest extends TestCase{
|
||||
protected RouterContext _context;
|
||||
|
||||
public void setUp() {
|
||||
_context = (RouterContext) I2PAppContext.getGlobalContext();
|
||||
_context = new RouterContext(null);
|
||||
_context.random().nextBoolean();
|
||||
FragmentHandler.MAX_DEFRAGMENT_TIME = 10*1000;
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.Hash;
|
||||
import net.i2p.data.TunnelId;
|
||||
import net.i2p.data.i2np.DataMessage;
|
||||
@ -34,7 +33,7 @@ public class InboundGatewayTest extends TestCase{
|
||||
private TunnelGateway _gw;
|
||||
|
||||
public void setUp() {
|
||||
_context = (RouterContext) I2PAppContext.getGlobalContext();
|
||||
_context = new RouterContext(null);
|
||||
_config = prepareConfig(8);
|
||||
_preprocessor = new TrivialPreprocessor(_context);
|
||||
_sender = new InboundSender(_context, _config.getConfig(0));
|
||||
|
@ -23,7 +23,7 @@ public class InboundTest extends TestCase{
|
||||
private RouterContext _context;
|
||||
|
||||
public void setUp() {
|
||||
_context = (RouterContext) I2PAppContext.getGlobalContext();
|
||||
_context = new RouterContext(null);
|
||||
}
|
||||
|
||||
public void testInbound() {
|
||||
|
@ -32,7 +32,7 @@ public class OutboundGatewayTest extends TestCase{
|
||||
private TunnelGateway _gw;
|
||||
|
||||
public void setUp() {
|
||||
_context = (RouterContext) I2PAppContext.getGlobalContext();
|
||||
_context = new RouterContext(null);
|
||||
_config = prepareConfig(8);
|
||||
_preprocessor = new TrivialPreprocessor(_context);
|
||||
_sender = new OutboundSender(_context, _config);
|
||||
|
@ -23,7 +23,7 @@ public class OutboundTest extends TestCase{
|
||||
private RouterContext _context;
|
||||
|
||||
public void setUp() {
|
||||
_context = (RouterContext) I2PAppContext.getGlobalContext();
|
||||
_context = new RouterContext(null);
|
||||
}
|
||||
|
||||
public void testOutbound() {
|
||||
|
Reference in New Issue
Block a user