<groupId>junit-addons</groupId>
<artifactId>junit-addons</artifactId>
</dependency>
+ <dependency>
+<groupId>org.slf4j</groupId>
+<artifactId>slf4j-api</artifactId>
+<version>1.6.1</version>
+</dependency>
+
</dependencies>
</project>
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class BaseExpectations extends Expectations {
protected Mockery context;
protected boolean showAllExpectations;
private final Synchroniser synchroniser = new Synchroniser();
+ protected static final Logger logger = LoggerFactory.getLogger(BaseExpectations.class);
@Before
public void before() throws Exception {
values.add(lastValue);
boolean match = match(lastValue);
if (match && (logMatch != null)) {
- System.out.println("Match: " + logMatch + " " + value);
+ logger.debug("Match: " + logMatch + " " + value);
}
return match;
}
public Object invoke(Invocation invocation) throws Throwable {
if (logInvocation) {
- System.out.println("Invoke: returning " + lastValue);
+ logger.debug("Invoke: returning " + lastValue);
}
return lastValue;
}
int state = element.getState();
logger.debug("Bundle:" + element.getSymbolicName() + ",v" + element.getVersion() + ", state:" + stateToString(state));
if (state != Bundle.ACTIVE && state != Bundle.RESOLVED) {
- System.out.println("Bundle:" + element.getSymbolicName() + " state:" + stateToString(state));
+ logger.debug("Bundle:" + element.getSymbolicName() + " state:" + stateToString(state));
// UNCOMMENT to see why bundles didn't resolve!
} catch (IOException e) {
logger.error("IO Exception while trying to recieve packet", e);
}
- logger.debug("Handling packet from {}:{} (len={})", packet.getAddress().getHostAddress(), packet.getPort(), packet.getLength());
+ logger.debug(String.format("Handling packet from {%s}:{%d} (len={%d})", packet.getAddress().getHostAddress(), packet.getPort(),
+ packet.getLength()));
try {
lispSouthboundService.handlePacket(packet);
handleMapRegisterPacket(mapRegisterPacket);
EidToLocatorRecord eidToLocator = lastMapRegister().getEidToLocatorRecord().get(0);
- System.out.println(((Ipv4) LispAFIConvertor.toAFI(eidToLocator.getLispAddressContainer())).getIpv4Address().getValue());
assertEquals(getIP("153.16.254.1"), LispAFIConvertor.toAFI(eidToLocator.getLispAddressContainer()));
assertEquals(1, eidToLocator.getLocatorRecord().size());
handleMapRequestAsByteArray(mapRequestPacket);
assertEquals(getIPV6("2610:d0:ffff:192:0:0:0:1"), LispAFIConvertor.toAFI(lastMapRequest().getSourceEid().getLispAddressContainer()));
- System.out.println(((Ipv6) LispAFIConvertor.toAFI(lastMapRequest().getEidRecord().get(0).getLispAddressContainer())).getIpv6Address()
- .getValue());
assertEquals(getIPV6("2610:d0:ffff:192:0:0:0:2"), LispAFIConvertor.toAFI(lastMapRequest().getEidRecord().get(0).getLispAddressContainer()));
}