use of org.talend.esb.servicelocator.client.internal.NodePath in project tesb-rt-se by Talend.
the class EndpointNodeTest method getExpiryTimeMissingNode.
@Test
public void getExpiryTimeMissingNode() throws Exception {
NodePath expiryPath = endpointNode.child(TIMETOLIVE);
expect(backend.nodeExists(expiryPath)).andReturn(false);
replay(backend);
Date answer = endpointNode.getExpiryTime();
assertNull(answer);
verify(backend);
}
use of org.talend.esb.servicelocator.client.internal.NodePath in project tesb-rt-se by Talend.
the class EndpointNodeTest method setLivePersistent.
@Test
public void setLivePersistent() throws Exception {
NodePath livePath = endpointNode.child(LIVE);
backend.ensurePathExists(livePath, CreateMode.PERSISTENT);
backend.ensurePathDeleted(endpointNode.child(TIMETOLIVE), false);
replay(backend);
endpointNode.setLive(true);
verify(backend);
}
use of org.talend.esb.servicelocator.client.internal.NodePath in project tesb-rt-se by Talend.
the class EndpointNodeTest method setExpiryTime.
@Test
public void setExpiryTime() throws Exception {
final Date expiryTime = new Date();
NodePath expiryPath = endpointNode.child(TIMETOLIVE);
backend.ensurePathExists(eq(expiryPath), eq(CreateMode.PERSISTENT), anyObject(byte[].class));
replay(backend);
endpointNode.setExpiryTime(expiryTime, true);
verify(backend);
}
use of org.talend.esb.servicelocator.client.internal.NodePath in project tesb-rt-se by Talend.
the class EndpointNodeTest method ensureRemoved.
@Test
public void ensureRemoved() throws Exception {
NodePath livePath = endpointNode.child(LIVE);
NodePath expiryPath = endpointNode.child(TIMETOLIVE);
backend.ensurePathDeleted(livePath, false);
backend.ensurePathDeleted(expiryPath, false);
backend.ensurePathDeleted(endpointNode, true);
replay(backend);
endpointNode.ensureRemoved();
verify(backend);
}
use of org.talend.esb.servicelocator.client.internal.NodePath in project tesb-rt-se by Talend.
the class EndpointNodeTest method getExpiryTime.
@Test
public void getExpiryTime() throws Exception {
final Date expected = new Date();
NodePath expiryPath = endpointNode.child(TIMETOLIVE);
expect(backend.nodeExists(expiryPath)).andReturn(true);
expect(backend.getContent(expiryPath)).andReturn(getDateBytes(expected));
replay(backend);
Date answer = endpointNode.getExpiryTime();
assertEquals(expected, answer);
verify(backend);
}
Aggregations