public void testTestingNode()
{
long testStartTime = System.currentTimeMillis();
Injector injector = Guice.createInjector(new TestingNodeModule(), new ApplicationNameModule("test-application"));
NodeInfo nodeInfo = injector.getInstance(NodeInfo.class);
assertNotNull(nodeInfo);
assertEquals(nodeInfo.getApplication(), "test-application");
assertTrue(nodeInfo.getEnvironment().matches("test\\d+"));
assertEquals(nodeInfo.getPool(), "general");
assertNotNull(nodeInfo.getNodeId());
assertNotNull(nodeInfo.getLocation());
assertNull(nodeInfo.getBinarySpec());
assertNull(nodeInfo.getConfigSpec());
assertNotNull(nodeInfo.getInstanceId());
assertNotEquals(nodeInfo.getNodeId(), nodeInfo.getInstanceId());
assertEquals(nodeInfo.getInternalIp().toString(), "localhost/127.0.0.1");
assertEquals(nodeInfo.getBindIp(), nodeInfo.getInternalIp());
assertEquals(nodeInfo.getExternalAddress(), "127.0.0.1");
assertGreaterThanOrEqual(nodeInfo.getStartTime(), testStartTime);
// make sure toString doesn't throw an exception
assertNotNull(nodeInfo.toString());
}