| | |
| | | connectionOptions.setSSLConnectionFactory(sslConnectionFactory); |
| | | } |
| | | |
| | | if (noop.isPresent()) |
| | | { |
| | | // We don't actually need to open a connection or perform the search, |
| | | // so we're done. We should return 0 to either mean that the processing |
| | | // was successful or that there were no matching entries, based on |
| | | // countEntries.isPresent() (but in either case the return value should |
| | | // be zero). |
| | | return 0; |
| | | } |
| | | |
| | | AtomicInteger nextMessageID = new AtomicInteger(1); |
| | | connection = new LDAPConnection(hostNameValue, portNumber, |
| | | connectionOptions, out, err); |
| | |
| | | |
| | | |
| | | /** |
| | | * Tests a simple invocation using the "--noop" option with a valid argument |
| | | * set. |
| | | */ |
| | | @Test() |
| | | public void testNoOpSearchValidArguments() |
| | | { |
| | | String[] args = |
| | | { |
| | | "-h", "doesnt.need.to.resolve", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-V", "3", |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "--noop", |
| | | "(objectClass=*)" |
| | | }; |
| | | |
| | | assertEquals(LDAPSearch.mainSearch(args, false, null, System.err), 0); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Tests a simple invocation using the "--noop" option with an invalid |
| | | * argument set. |
| | | */ |
| | | @Test() |
| | | public void testNoOpSearchInvalidArguments() |
| | | { |
| | | String[] args = |
| | | { |
| | | "-h", "doesnt.need.to.resolve", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-V", "3", |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | "-b", "", |
| | | "-s", "invalid", |
| | | "--noop", |
| | | "(objectClass=*)" |
| | | }; |
| | | |
| | | assertFalse(LDAPSearch.mainSearch(args, false, null, System.err) == 0); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Tests a simple LDAP search over SSL using blind trust. |
| | | */ |
| | | @Test() |