AutoRefactored removing unnecessary local variable/dead store before return.
| | |
| | | protected final TestParentCfg getParentCfg(final String name, final ServerManagementContext serverContext) |
| | | throws Exception { |
| | | ServerManagedObject<RootCfg> root = serverContext.getRootConfigurationManagedObject(); |
| | | TestParentCfg parent = root.getChild(TestCfg.getTestOneToManyParentRelationDefinition(), name) |
| | | .getConfiguration(); |
| | | return parent; |
| | | return root.getChild(TestCfg.getTestOneToManyParentRelationDefinition(), name).getConfiguration(); |
| | | } |
| | | |
| | | protected static final Entry CONFIG_ENTRY = LDIF.makeEntry( |
| | |
| | | final int prime = 31; |
| | | int result = 1; |
| | | result = prime * result + ((first == null) ? 0 : first.hashCode()); |
| | | result = prime * result + ((second == null) ? 0 : second.hashCode()); |
| | | return result; |
| | | return prime * result + ((second == null) ? 0 : second.hashCode()); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | * @return a string containing a standard LDIF Change Record. |
| | | */ |
| | | public final String[] getStandardLDIFChangeRecord() { |
| | | |
| | | // @formatter:off |
| | | final String[] cr = { |
| | | return new String[] { |
| | | "version: 1", |
| | | "dn: uid=scarter,ou=People,dc=example,dc=com", |
| | | "changetype: add", |
| | |
| | | "modifiersName: cn=Internal Client,cn=Root DNs,cn=config" |
| | | }; |
| | | // @formatter:on |
| | | return cr; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return a string containing a standard LDIF Change Record. |
| | | */ |
| | | public final String[] getStandardLDIFChangeRecord() { |
| | | |
| | | // @formatter:off |
| | | final String[] cr = { |
| | | return new String[] { |
| | | "version: 1", |
| | | "dn: uid=scarter,ou=People,dc=example,dc=com", |
| | | "changetype: add", |
| | |
| | | "modifiersName: cn=Internal Client,cn=Root DNs,cn=config" |
| | | }; |
| | | // @formatter:on |
| | | return cr; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return a string containing a standard LDIF Change Record. |
| | | */ |
| | | public final String[] getAddLDIFChangeRecord() { |
| | | |
| | | // @formatter:off |
| | | final String[] cr = { |
| | | return new String[] { |
| | | "version: 1", |
| | | "dn: uid=scarter,ou=People,dc=example,dc=com", |
| | | "changetype: add", |
| | |
| | | "description::V2hhdCBhIGNhcmVmdWwgcmVhZGVyIHlvdSBhcmUgIQ==" |
| | | }; |
| | | // @formatter:on |
| | | return cr; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public final String[] getStandardEntry() { |
| | | // @formatter:off |
| | | final String[] entry = { |
| | | return new String[] { |
| | | "dn: uid=user.0,ou=People,dc=example,dc=com", |
| | | "objectClass: person", |
| | | "objectClass: inetorgperson", |
| | |
| | | "modifiersName: cn=Internal Client,cn=Root DNs,cn=config" |
| | | }; |
| | | // @formatter:on |
| | | return entry; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public final String[] getStandardEntry() { |
| | | // @formatter:off |
| | | final String[] entry = { |
| | | return new String[] { |
| | | "dn: uid=user.0,ou=People,dc=example,dc=com", |
| | | "objectClass: person", |
| | | "objectClass: inetorgperson", |
| | |
| | | "modifiersName: cn=Internal Client,cn=Root DNs,cn=config" |
| | | }; |
| | | // @formatter:on |
| | | return entry; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @DataProvider(name = "validArguments") |
| | | Object[][] createValidArguments() throws Exception { |
| | | Object[][] data = new Object[][] { |
| | | return new Object[][] { |
| | | { args("-c", "numusers=1", "example.template"), |
| | | // 2 base entries + users |
| | | expectedErrOutput(INFO_MAKELDIF_PROCESSING_COMPLETE.get(3)) }, |
| | |
| | | // 2 base entries + users |
| | | expectedErrOutput(INFO_MAKELDIF_PROCESSING_COMPLETE.get(7)) }, |
| | | }; |
| | | return data; |
| | | } |
| | | |
| | | @DataProvider(name = "invalidArguments") |
| | | Object[][] createInValidArguments() throws Exception { |
| | | Object[][] data = new Object[][] { |
| | | return new Object[][] { |
| | | { // check that usage is written to output when arguments are invalid |
| | | args(), |
| | | expectedErrOutput(INFO_MAKELDIF_TOOL_DESCRIPTION.get()) }, |
| | |
| | | { args("-s", "non-numeric" , "example.template"), |
| | | expectedErrOutput(ERR_ERROR_PARSING_ARGS.get("")) }, |
| | | }; |
| | | return data; |
| | | } |
| | | |
| | | @Test(dataProvider = "validArguments") |
| | |
| | | |
| | | CompareResult result = |
| | | Responses.newCompareResult(getResultCode(compareOperation)); |
| | | result = getResponseResult(compareOperation, result); |
| | | return result; |
| | | return getResponseResult(compareOperation, result); |
| | | } |
| | | |
| | | @Override |