// Test that existing exclusive partition with new shared_write coalesces to
// exclusive
@Test
public void testExSWPart() {
LockRequestBuilder bldr = new LockRequestBuilder();
LockComponent comp = new LockComponent(LockType.EXCLUSIVE, LockLevel.DB, "mydb");
comp.setTablename("mytable");
comp.setPartitionname("mypart");
bldr.addLockComponent(comp);
comp = new LockComponent(LockType.SHARED_WRITE, LockLevel.DB, "mydb");
comp.setTablename("mytable");
comp.setPartitionname("mypart");
bldr.addLockComponent(comp).setUser("fred");
LockRequest req = bldr.build();
List<LockComponent> locks = req.getComponent();
Assert.assertEquals(1, locks.size());
Assert.assertEquals(LockType.EXCLUSIVE, locks.get(0).getType());