| | |
| | | @Test() |
| | | public void testEnabledAlert() |
| | | { |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | TestCaseUtils.dsconfig( |
| | | "set-alert-handler-prop", |
| | | "--handler-name", "Dummy Alert Handler", |
| | | "--add", "enabled-alert-type:" + ALERT_TYPE |
| | | }; |
| | | assertEquals(DSConfig.main(args, false, System.out, System.err), 0); |
| | | "--add", "enabled-alert-type:" + ALERT_TYPE); |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | finally |
| | | { |
| | | args = new String[] |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | TestCaseUtils.dsconfig( |
| | | "set-alert-handler-prop", |
| | | "--handler-name", "Dummy Alert Handler", |
| | | "--remove", "enabled-alert-type:" + ALERT_TYPE |
| | | }; |
| | | assertEquals(DSConfig.main(args, false, System.out, System.err), 0); |
| | | "--remove", "enabled-alert-type:" + ALERT_TYPE); |
| | | } |
| | | } |
| | | |
| | |
| | | @Test() |
| | | public void testNotEnabledAlert() |
| | | { |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | TestCaseUtils.dsconfig( |
| | | "set-alert-handler-prop", |
| | | "--handler-name", "Dummy Alert Handler", |
| | | "--add", "enabled-alert-type:" + ALERT_TYPE + ".bogus" |
| | | }; |
| | | assertEquals(DSConfig.main(args, false, System.out, System.err), 0); |
| | | "--add", "enabled-alert-type:" + ALERT_TYPE + ".bogus"); |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | finally |
| | | { |
| | | args = new String[] |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | TestCaseUtils.dsconfig( |
| | | "set-alert-handler-prop", |
| | | "--handler-name", "Dummy Alert Handler", |
| | | "--remove", "enabled-alert-type:" + ALERT_TYPE + ".bogus" |
| | | }; |
| | | assertEquals(DSConfig.main(args, false, System.out, System.err), 0); |
| | | "--remove", "enabled-alert-type:" + ALERT_TYPE + ".bogus"); |
| | | } |
| | | } |
| | | |
| | |
| | | @Test() |
| | | public void testDisabledAlert() |
| | | { |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | TestCaseUtils.dsconfig( |
| | | "set-alert-handler-prop", |
| | | "--handler-name", "Dummy Alert Handler", |
| | | "--add", "disabled-alert-type:" + ALERT_TYPE |
| | | }; |
| | | assertEquals(DSConfig.main(args, false, System.out, System.err), 0); |
| | | "--add", "disabled-alert-type:" + ALERT_TYPE); |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | finally |
| | | { |
| | | args = new String[] |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | TestCaseUtils.dsconfig( |
| | | "set-alert-handler-prop", |
| | | "--handler-name", "Dummy Alert Handler", |
| | | "--remove", "disabled-alert-type:" + ALERT_TYPE |
| | | }; |
| | | assertEquals(DSConfig.main(args, false, System.out, System.err), 0); |
| | | "--remove", "disabled-alert-type:" + ALERT_TYPE); |
| | | } |
| | | } |
| | | |
| | |
| | | @Test() |
| | | public void testNotDisabledAlert() |
| | | { |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | TestCaseUtils.dsconfig( |
| | | "set-alert-handler-prop", |
| | | "--handler-name", "Dummy Alert Handler", |
| | | "--add", "disabled-alert-type:" + ALERT_TYPE + ".bogus" |
| | | }; |
| | | assertEquals(DSConfig.main(args, false, System.out, System.err), 0); |
| | | "--add", "disabled-alert-type:" + ALERT_TYPE + ".bogus"); |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | finally |
| | | { |
| | | args = new String[] |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | TestCaseUtils.dsconfig( |
| | | "set-alert-handler-prop", |
| | | "--handler-name", "Dummy Alert Handler", |
| | | "--remove", "disabled-alert-type:" + ALERT_TYPE + ".bogus" |
| | | }; |
| | | assertEquals(DSConfig.main(args, false, System.out, System.err), 0); |
| | | "--remove", "disabled-alert-type:" + ALERT_TYPE + ".bogus"); |
| | | } |
| | | } |
| | | |
| | |
| | | @Test() |
| | | public void testEnabledAndDisabledAlert() |
| | | { |
| | | String[] args = |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | TestCaseUtils.dsconfig( |
| | | "set-alert-handler-prop", |
| | | "--handler-name", "Dummy Alert Handler", |
| | | "--add", "enabled-alert-type:" + ALERT_TYPE, |
| | | "--add", "disabled-alert-type:" + ALERT_TYPE, |
| | | }; |
| | | assertEquals(DSConfig.main(args, false, System.out, System.err), 0); |
| | | "--add", "disabled-alert-type:" + ALERT_TYPE); |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | finally |
| | | { |
| | | args = new String[] |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password", |
| | | TestCaseUtils.dsconfig( |
| | | "set-alert-handler-prop", |
| | | "--handler-name", "Dummy Alert Handler", |
| | | "--remove", "enabled-alert-type:" + ALERT_TYPE, |
| | | "--remove", "disabled-alert-type:" + ALERT_TYPE, |
| | | }; |
| | | assertEquals(DSConfig.main(args, false, System.out, System.err), 0); |
| | | "--remove", "disabled-alert-type:" + ALERT_TYPE); |
| | | } |
| | | } |
| | | |