LockComponent comp = new LockComponent(LockType.EXCLUSIVE, LockLevel.DB, "mydb");
bldr.addLockComponent(comp).setUser("fred");
comp = new LockComponent(LockType.EXCLUSIVE, LockLevel.DB, "mydb");
comp.setTablename("mytable");
bldr.addLockComponent(comp);
LockRequest req = bldr.build();
List<LockComponent> locks = req.getComponent();
Assert.assertEquals(2, locks.size());
Assert.assertEquals("fred", req.getUser());
Assert.assertEquals(InetAddress.getLocalHost().getHostName(), req.getHostname());
}