| | |
| | | */ |
| | | package org.opends.server.backends; |
| | | |
| | | import static org.opends.server.TestCaseUtils.*; |
| | | import static org.opends.server.protocols.internal.InternalClientConnection.*; |
| | | import static org.opends.server.protocols.internal.Requests.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | "add: objectClass", |
| | | "objectClass: extensibleObject"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "add: objectClass", |
| | | "objectClass: extensibleObject"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "changetype: modify", |
| | | "delete: attributeTypes"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "changetype: modify", |
| | | "replace: attributeTypes"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | String attrName = "testaddattributetypesuccessful"; |
| | | assertFalse(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | } |
| | | |
| | |
| | | String attrName = "testaddattributetypesuccessfulnooid"; |
| | | assertFalse(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | } |
| | | |
| | |
| | | String attrName = "testaddattributetypenospacebeforeparenthesis"; |
| | | assertFalse(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | } |
| | | |
| | |
| | | "98-schema-test-attrtype.ldif"); |
| | | assertFalse(schemaFile.exists()); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | assertTrue(schemaFile.exists()); |
| | | } |
| | |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(args), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | } |
| | | |
| | |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(args), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | assertTrue(schemaFile.exists()); |
| | | } |
| | |
| | | "add: attributeTypes", |
| | | "attributeTypes: invalidsyntax"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "SYNTAX 1.3.6.1.4.1.1466.115.121.1.99999 SINGLE-VALUE " + |
| | | "X-ORGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, System.err) == 0); |
| | | assertNotEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE " + |
| | | "X-ORGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, System.err) == 0); |
| | | assertNotEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE " + |
| | | "X-ORGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, System.err) == 0); |
| | | assertNotEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE " + |
| | | "X-ORGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, System.err) == 0); |
| | | assertNotEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE " + |
| | | "X-APPROX 'xxxundefinedxxx' X-ORGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, System.err) == 0); |
| | | assertNotEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE " + |
| | | "USAGE xxxinvalidxxx X-ORGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, System.err) == 0); |
| | | assertNotEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE " + |
| | | "X-ORGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, System.err) == 0); |
| | | assertNotEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE " + |
| | | "X-ORGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, System.err) == 0); |
| | | assertNotEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN " + |
| | | "'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN " + |
| | | "'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | String attrName = "testremoveattributetypesuccessful"; |
| | | assertFalse(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | } |
| | | |
| | |
| | | String attrName = "testremoveattributetypesuccessful"; |
| | | assertFalse(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | } |
| | | |
| | |
| | | String attrName = "testremoveattributetypeundefined"; |
| | | assertFalse(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | String attrName = "name"; |
| | | assertTrue(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | } |
| | | |
| | |
| | | String attrName = "uid"; |
| | | assertTrue(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | } |
| | | |
| | |
| | | String attrName = "testremoveattributetypereferencedbynf"; |
| | | assertFalse(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | } |
| | | |
| | |
| | | String attrName = "testremoveattributetypereferencedbydcr"; |
| | | assertFalse(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | } |
| | | |
| | |
| | | String attrName = "testremoveatrefbymruat"; |
| | | assertFalse(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | |
| | | MatchingRuleUse mru = |
| | | DirectoryServer.getSchema().getMatchingRuleUse(matchingRule); |
| | |
| | | String ocName = "testaddobjectclasssuccessful"; |
| | | assertFalse(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | } |
| | | |
| | |
| | | String ocName = "testaddobjectclasssuccessfulnooid"; |
| | | assertFalse(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | } |
| | | |
| | |
| | | "98-schema-test-oc.ldif"); |
| | | assertFalse(schemaFile.exists()); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | assertTrue(schemaFile.exists()); |
| | | } |
| | |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(args), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | } |
| | | |
| | |
| | | String ocName = "testaddobjectclassmultipleconflicts"; |
| | | assertFalse(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | } |
| | | |
| | |
| | | String ocName = "testremovethenaddobjectclasssuccessful"; |
| | | assertFalse(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | } |
| | | |
| | |
| | | "add: objectClasses", |
| | | "objectClasses: invalidsyntax"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "'testAddOCUndefinedSuperior' SUP undefined STRUCTURAL " + |
| | | "MUST cn X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "SUP testAddOCObsoleteSuperiorSup STRUCTURAL MUST cn " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "STRUCTURAL MUST testAddOCObsoleteRequiredAttrAT " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "STRUCTURAL MAY testAddOCObsoleteOptionalAttrAT " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "'testAddOCUndefinedRequired' SUP top STRUCTURAL " + |
| | | "MUST undefined X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "MUST ( cn $ xxxundefinedxxx ) " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "'testAddOCUndefinedOptional' SUP top STRUCTURAL " + |
| | | "MAY undefined X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "MAY ( cn $ xxxundefinedxxx ) " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "'testAddAbstractOCWithNonAbstractSuperior' SUP person " + |
| | | "ABSTRACT MAY description X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "'testAddAuxiliaryOCWithStructuralSuperior' SUP person " + |
| | | "AUXILIARY MAY description X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "'testAddStructuralOCWithAuxiliarySuperior' SUP posixAccount " + |
| | | "STRUCTURAL MAY description X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | String ocName = "testremoveobjectclasssuccessful"; |
| | | assertFalse(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | } |
| | | |
| | |
| | | String ocName = "person"; |
| | | assertTrue(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | } |
| | | |
| | |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(args), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | } |
| | | |
| | |
| | | String ocName = "testremoveobjectclassreferencedbydcr"; |
| | | assertFalse(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | |
| | | String[] args = |
| | | { |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | } |
| | | |
| | | private String[] standardArgs(String path) |
| | | { |
| | | return new String[] { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertTrue(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Tests the behavior of the schema backend when attempting to add a new name |
| | | * form that doesn't already exist. |
| | |
| | | String nameFormName = "testaddnameformsuccessful"; |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | } |
| | | |
| | |
| | | "98-schema-test-nameform.ldif"); |
| | | assertFalse(schemaFile.exists()); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | assertTrue(schemaFile.exists()); |
| | | } |
| | |
| | | String nameFormName = "testaddnameformwithundefinedreqat"; |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | } |
| | | |
| | |
| | | String nameFormName = "testaddnameformwithmultipleundefinedreqat"; |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | } |
| | | |
| | |
| | | String nameFormName = "testaddnameformwithundefinedoptat"; |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | } |
| | | |
| | |
| | | String nameFormName = "testaddnameformwithmultipleundefinedoptat"; |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | } |
| | | |
| | |
| | | String nameFormName = "testaddnameformwithundefinedoc"; |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | } |
| | | |
| | |
| | | String nameFormName = "testaddnameformwithauxiliaryoc"; |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | } |
| | | |
| | |
| | | String nameFormName = "testaddnameformwithobsoleteoc"; |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | } |
| | | |
| | |
| | | "MUST testAddNFWithObsoleteReqATAT " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "MUST cn MAY testAddNFWithObsoleteOptATAT " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | String nameFormName = "testaddnameformocconflict2"; |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertTrue(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertEquals(runModify(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | } |
| | | |
| | |
| | | String nameFormName = "testremovenameformsuccessful"; |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | } |
| | | |
| | |
| | | String nameFormName = "testremovethenaddnameformsuccessful"; |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | } |
| | | |
| | |
| | | "OC testRemoveNameFormReferencedByDSROC MUST cn " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | String nameFormName = "testremovenameformreferencedbydsrnf"; |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | } |
| | | |
| | |
| | | "NAME 'testAddDITContentRuleSuccessful' NOT description " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | String ocName = "testaddditcontentrulesuccessfuloc"; |
| | | assertFalse(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | |
| | | ObjectClass oc = DirectoryServer.getSchema().getObjectClass(ocName); |
| | | assertNotNull(oc); |
| | |
| | | String ocName = "testreplaceditcontentrulesuccessfuloc"; |
| | | assertFalse(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(args), 0); |
| | | |
| | | ObjectClass oc = DirectoryServer.getSchema().getObjectClass(ocName); |
| | | assertNotNull(oc); |
| | |
| | | "X-SCHEMA-FILE '98-schema-test-dcr.ldif' " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | String ocName = "testadddcrtoaltschemafileoc"; |
| | | assertFalse(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | |
| | |
| | | "98-schema-test-dcr.ldif"); |
| | | assertFalse(schemaFile.exists()); |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | |
| | | ObjectClass oc = DirectoryServer.getSchema().getObjectClass(ocName); |
| | | assertNotNull(oc); |
| | |
| | | "NAME 'testRemoveThenAddDITContentRule' MAY sn " + |
| | | "NOT description X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | String ocName = "testremovethenaddditcontentruleoc"; |
| | | assertFalse(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | |
| | | ObjectClass oc = DirectoryServer.getSchema().getObjectClass(ocName); |
| | | assertNotNull(oc); |
| | |
| | | "NAME 'testAddDITContentRuleUndefinedOC' NOT description " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "NAME 'testAddDITContentRuleAuxiliaryOC' NOT description " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "NAME 'testAddDITContentRuleObsoleteOC' NOT description " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "NAME 'testAddDITContentRuleConflictingOC2' NOT description " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "NAME 'testAddDITContentRuleUndefinedAuxOC' " + |
| | | "AUX xxxundefinedxxx X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "AUX ( posixAccount $ xxxundefinedxxx ) " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "NAME 'testAddDITContentRuleAuxOCNotAuxOC' " + |
| | | "AUX person X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "AUX ( posixAccount $ person ) " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "AUX testAddDITContentRuleObsoleteAuxOCAuxiliary " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "NAME 'testAddDITContentRuleUndefinedReqAT' " + |
| | | "MUST xxxundefinedxxx X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "MUST ( cn $ xxxundefinedxxx ) " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "NAME 'testAddDITContentRuleUndefinedOptAT' " + |
| | | "MAY xxxundefinedxxx X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "MAY ( cn $ xxxundefinedxxx ) " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "NAME 'testAddDITContentRuleUndefinedNotAT' " + |
| | | "NOT xxxundefinedxxx X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "NOT ( description $ xxxundefinedxxx ) " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "NAME 'testAddDCRProhibitReqStructuralAT' " + |
| | | "NOT cn X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "NAME 'testAddDCRProhibitReqAuxiliaryAT' AUX posixAccount " + |
| | | "NOT uid X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "MUST testAddDCRObsoleteReqATAT " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "MAY testAddDCRObsoleteOptATAT " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "NOT testAddDCRObsoleteNotATAT " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "NAME 'testRemoveDITContentRuleSuccessful' NOT description " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | String ocName = "testremoveditcontentrulesuccessfuloc"; |
| | | assertFalse(DirectoryServer.getSchema().hasObjectClass(ocName)); |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | |
| | | ObjectClass oc = DirectoryServer.getSchema().getObjectClass(ocName); |
| | | assertNotNull(oc); |
| | |
| | | "FORM testAddDITStructureRuleSuccessfulNF " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | int ruleID = 999001; |
| | | assertFalse(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | } |
| | | |
| | |
| | | int ruleID = 999002; |
| | | assertFalse(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(args), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | } |
| | | |
| | |
| | | "X-SCHEMA-FILE '98-schema-test-dsr.ldif' " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | int ruleID = 999010; |
| | | assertFalse(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | |
| | |
| | | "98-schema-test-dsr.ldif"); |
| | | assertFalse(schemaFile.exists()); |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | |
| | | assertTrue(schemaFile.exists()); |
| | |
| | | "FORM testRemoveAndAddDITStructureRuleSuccessfulNF " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | int ruleID = 999003; |
| | | assertFalse(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | } |
| | | |
| | |
| | | "FORM xxxundefinedxxx " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | int ruleID = 999004; |
| | | assertFalse(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | } |
| | | |
| | |
| | | "FORM testAddDSRUndefinedSuperiorNF SUP 999000 " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | int ruleID = 999005; |
| | | assertFalse(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | } |
| | | |
| | |
| | | "FORM testAddDITStructureRuleObsoleteNameFormNF " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "FORM testAddDITStructureRuleObsoleteSuperiorNF2 SUP 999012 " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "FORM testRemoveDITStructureRuleSuccessfulNF " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | int ruleID = 999006; |
| | | assertFalse(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | } |
| | | |
| | |
| | | "FORM testRemoveSuperiorDITStructureRuleNF " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | int ruleID = 999007; |
| | | assertFalse(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | assertTrue(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | |
| | | |
| | |
| | | "FORM testRemoveSuperiorDITStructureRuleNF " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | args = new String[] |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | assertFalse(DirectoryServer.getSchema().hasDITStructureRule(ruleID)); |
| | | } |
| | | |
| | |
| | | |
| | | assertFalse(DirectoryServer.getSchema().hasMatchingRuleUse(matchingRule)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | |
| | | MatchingRuleUse mru = |
| | | DirectoryServer.getSchema().getMatchingRuleUse(matchingRule); |
| | |
| | | |
| | | assertFalse(DirectoryServer.getSchema().hasMatchingRuleUse(matchingRule)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | File schemaFile = new File(SchemaConfigManager.getSchemaDirectoryPath(), |
| | | "98-schema-test-mru.ldif"); |
| | | assertFalse(schemaFile.exists()); |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | |
| | | MatchingRuleUse mru = |
| | | DirectoryServer.getSchema().getMatchingRuleUse(matchingRule); |
| | |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(args), 0); |
| | | |
| | | MatchingRuleUse mru = |
| | | DirectoryServer.getSchema().getMatchingRuleUse(matchingRule); |
| | |
| | | |
| | | assertFalse(DirectoryServer.getSchema().hasMatchingRuleUse(matchingRule)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | |
| | | MatchingRuleUse mru = |
| | | DirectoryServer.getSchema().getMatchingRuleUse(matchingRule); |
| | |
| | | |
| | | assertFalse(DirectoryServer.getSchema().hasMatchingRuleUse(matchingRule)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | |
| | | MatchingRuleUse mru = |
| | | DirectoryServer.getSchema().getMatchingRuleUse(matchingRule); |
| | |
| | | "NAME 'testAddMRUMRUndefined' APPLIES cn " + |
| | | "X-ORIGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | assertFalse(DirectoryServer.getSchema().hasMatchingRuleUse(matchingRule)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | assertFalse(DirectoryServer.getSchema().hasMatchingRuleUse(matchingRule)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | assertFalse(DirectoryServer.getSchema().hasMatchingRuleUse(matchingRule)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | assertFalse(DirectoryServer.getSchema().hasMatchingRuleUse(matchingRule)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | assertNotEquals(runModify(standardArgs(path)), 0); |
| | | } |
| | | |
| | | assertFalse(LDAPModify.mainModify(args, false, null, null) == 0); |
| | | private int runModify(String[] args) |
| | | { |
| | | return LDAPModify.mainModify(args, false, null, null); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | assertFalse(DirectoryServer.getSchema().hasMatchingRuleUse(matchingRule)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | |
| | | MatchingRuleUse mru = |
| | | DirectoryServer.getSchema().getMatchingRuleUse(matchingRule); |
| | |
| | | String attrName = "testattributetypesmatchingrule"; |
| | | assertFalse(DirectoryServer.getSchema().hasAttributeType(attrName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 20); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 20); |
| | | } |
| | | |
| | | |
| | |
| | | String objectClassName = "testobjectclassesmatchingrule"; |
| | | assertFalse(DirectoryServer.getSchema().hasObjectClass(objectClassName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 20); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 20); |
| | | } |
| | | |
| | | |
| | |
| | | String nameFormName = "testnameformsmatchingrule"; |
| | | assertFalse(DirectoryServer.getSchema().hasNameForm(nameFormName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 20); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 20); |
| | | } |
| | | |
| | | |
| | |
| | | String objectClassName = "testditcontentrulesmatchingruleoc"; |
| | | assertNull(DirectoryServer.getSchema().getObjectClass(objectClassName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 20); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 20); |
| | | } |
| | | |
| | | |
| | |
| | | String objectClassName = "testditcontentrulesmatchingruleoc1"; |
| | | assertNull(DirectoryServer.getSchema().getObjectClass(objectClassName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 20); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 20); |
| | | } |
| | | |
| | | |
| | |
| | | String attrName = "testmatchingruleusematchingruleat1"; |
| | | assertNull(DirectoryServer.getSchema().getAttributeType(attrName)); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 20); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 20); |
| | | } |
| | | |
| | | |
| | |
| | | "objectClasses: ( testissue1318oc2-oid NAME 'testIssue1381OC2' " + |
| | | "MUST testIssue1381AT )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | } |
| | | |
| | | /** |
| | |
| | | * are added without a space before closing parenthesis. |
| | | */ |
| | | @Test |
| | | public void testAddAttributeTypeNoSpaceBeforeParenthesis() throws Exception |
| | | public void testAddAttributeTypeNoSpaceBeforeParenthesis() throws Exception |
| | | { |
| | | |
| | | String path = TestCaseUtils.createTempFile( |
| | | String path = TestCaseUtils.createTempFile( |
| | | "dn: cn=schema", |
| | | "changetype: modify", |
| | | "add: attributeTypes", |
| | |
| | | " caseIgnoreOrderingMatch SUBSTR caseIgnoreSubstringsMatch " + |
| | | "SYNTAX 1.3.6.1.4.1.1466.115.121.1.44 X-ORIGIN 'RFC 4519')"); |
| | | |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | } |
| | | |
| | | /** |
| | | * Tests to ensure that the schema subentry includes the lastmod attributes |
| | |
| | | "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE " + |
| | | "X-ORGIN 'SchemaBackendTestCase' )"); |
| | | |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-f", path |
| | | }; |
| | | |
| | | // Sleep longer than the TimeThread delay to ensure the modifytimestamp |
| | | // will be different. |
| | | Thread.sleep(6000); |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(runModifyWithSystemErr(standardArgs(path)), 0); |
| | | |
| | | schemaEntry = DirectoryServer.getEntry(DN.valueOf("cn=schema")); |
| | | assertNotNull(schemaEntry); |
| | |
| | | |
| | | ByteString newMTValue = |
| | | schemaEntry.getAttribute(mtType).get(0).iterator().next(); |
| | | assertFalse(oldMTValue.equals(newMTValue)); |
| | | assertNotEquals(oldMTValue, newMTValue); |
| | | } |
| | | |
| | | |
| | | private int runModifyWithSystemErr(String[] args) |
| | | { |
| | | return LDAPModify.mainModify(args, false, null, System.err); |
| | | } |
| | | |
| | | /** |
| | | * Tests the ability to properly handle adding and removing a schema |