| | |
| | | import static org.testng.Assert.assertEquals; |
| | | |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.opends.server.admin.std.meta.RootCfgDefn; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.testng.annotations.BeforeClass; |
| | |
| | | public void testBuilderSetBaseDN(String baseDN) |
| | | throws DirectoryException { |
| | | DNPropertyDefinition.Builder localBuilder = DNPropertyDefinition |
| | | .createBuilder("test-property"); |
| | | .createBuilder(RootCfgDefn.getInstance(), "test-property"); |
| | | localBuilder.setBaseDN(baseDN); |
| | | DNPropertyDefinition pd = localBuilder.getInstance(); |
| | | |
| | |
| | | public void testValidateLegalValues(String baseDN, String value) |
| | | throws DirectoryException { |
| | | DNPropertyDefinition.Builder localBuilder = DNPropertyDefinition |
| | | .createBuilder("test-property"); |
| | | .createBuilder(RootCfgDefn.getInstance(), "test-property"); |
| | | localBuilder.setBaseDN(baseDN); |
| | | DNPropertyDefinition pd = localBuilder.getInstance(); |
| | | pd.validateValue(DN.decode(value)); |
| | |
| | | public void testValidateIllegalValues(String baseDN, String value) |
| | | throws DirectoryException { |
| | | DNPropertyDefinition.Builder localBuilder = DNPropertyDefinition |
| | | .createBuilder("test-property"); |
| | | .createBuilder(RootCfgDefn.getInstance(), "test-property"); |
| | | localBuilder.setBaseDN(baseDN); |
| | | DNPropertyDefinition pd = localBuilder.getInstance(); |
| | | pd.validateValue(DN.decode(value)); |
| | |
| | | @Test(dataProvider = "testLegalValues") |
| | | public void testDecodeLegalValues(String baseDN, String value) { |
| | | DNPropertyDefinition.Builder localBuilder = DNPropertyDefinition |
| | | .createBuilder("test-property"); |
| | | .createBuilder(RootCfgDefn.getInstance(), "test-property"); |
| | | localBuilder.setBaseDN(baseDN); |
| | | DNPropertyDefinition pd = localBuilder.getInstance(); |
| | | pd.decodeValue(value); |
| | |
| | | @Test(dataProvider = "testIllegalValues", expectedExceptions = IllegalPropertyValueStringException.class) |
| | | public void testDecodeIllegalValues(String baseDN, String value) { |
| | | DNPropertyDefinition.Builder localBuilder = DNPropertyDefinition |
| | | .createBuilder("test-property"); |
| | | .createBuilder(RootCfgDefn.getInstance(), "test-property"); |
| | | localBuilder.setBaseDN(baseDN); |
| | | DNPropertyDefinition pd = localBuilder.getInstance(); |
| | | pd.decodeValue(value); |