/** * Test that when we update a constraint the ordering is not modified. * * @throws Exception */ @SuppressWarnings("unchecked") @Test public void testUpdateConstraint() throws Exception { HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(name.getMethodName())); Constraints.add(desc, CheckConfigurationConstraint.class, CheckWasRunConstraint.class); Constraints.setConfiguration(desc, CheckConfigurationConstraint.class, CheckConfigurationConstraint.getConfiguration()); List<? extends Constraint> constraints = Constraints.getConstraints(desc, this.getClass().getClassLoader()); assertEquals(2, constraints.size()); // check to make sure the order didn't change assertEquals(CheckConfigurationConstraint.class, constraints.get(0) .getClass()); assertEquals(CheckWasRunConstraint.class, constraints.get(1).getClass()); }
/** * Test that when we update a constraint the ordering is not modified. * * @throws Exception */ @SuppressWarnings("unchecked") @Test public void testUpdateConstraint() throws Exception { HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(name.getMethodName())); Constraints.add(desc, CheckConfigurationConstraint.class, CheckWasRunConstraint.class); Constraints.setConfiguration(desc, CheckConfigurationConstraint.class, CheckConfigurationConstraint.getConfiguration()); List<? extends Constraint> constraints = Constraints.getConstraints(desc, this.getClass().getClassLoader()); assertEquals(2, constraints.size()); // check to make sure the order didn't change assertEquals(CheckConfigurationConstraint.class, constraints.get(0) .getClass()); assertEquals(CheckWasRunConstraint.class, constraints.get(1).getClass()); }