@RunWith(MockitoJUnitRunner.class)
public class JU_Help {
-
- private static AAFcli cli;
- private static Help help;
- String[] strArr = {"null","null","b","c"};
- private class CmdStub extends Cmd {
+
+ private static AAFcli cli;
+ private static Help help;
+ String[] strArr = {"null","null","b","c"};
+ private class CmdStub extends Cmd {
- public CmdStub(AAFcli aafcli, String name, Param[] params) {
- super(aafcli, name, params);
- // TODO Auto-generated constructor stub
- }
-
- public CmdStub(Cmd parent, String name, Param[] params) {
- super(parent, name, params);
- // TODO Auto-generated constructor stub
- }
+ public CmdStub(AAFcli aafcli, String name, Param[] params) {
+ super(aafcli, name, params);
+ // TODO Auto-generated constructor stub
+ }
+
+ public CmdStub(Cmd parent, String name, Param[] params) {
+ super(parent, name, params);
+ // TODO Auto-generated constructor stub
+ }
- @Override
- protected int _exec(int idx, String... args) throws CadiException, APIException, LocatorException {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public void error(Future<?> future) {
- super.error(future);
- }
-
- }
-
- @Mock
- private static List<Cmd> cmds;
-
- @Before
- public void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException, CadiException {
- cli = JU_AAFCli.getAAfCli();
- cmds = new ArrayList<>();
- Param[] param = new Param[] {new Param("name",true)};
- CmdStub cmd = new CmdStub(cli, "null", param);
- cmds.add(cmd);
- help = new Help(cli, cmds);
- }
-
- @Test
- public void exec_HTTP_200() {
- try {
- assertEquals(help._exec(1, "helps"), HttpStatus.OK_200);
- assertEquals(help._exec(1, strArr), HttpStatus.OK_200);
- } catch (CadiException | APIException | LocatorException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- @Test
- public void exec_HTTP_200_1() {
- try {
- assertEquals(help._exec(1, "helps","help"), HttpStatus.OK_200);
- } catch (CadiException | APIException | LocatorException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- @Test
- public void detailhelp() {
- boolean hasError=false;
- try {
- help.detailedHelp(2, new StringBuilder("detail help test"));
- } catch (Exception e) {
- hasError=true;
- }
- assertEquals(hasError,false);
- }
+ @Override
+ protected int _exec(int idx, String... args) throws CadiException, APIException, LocatorException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public void error(Future<?> future) {
+ super.error(future);
+ }
+
+ }
+
+ @Mock
+ private static List<Cmd> cmds;
+
+ @Before
+ public void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException, CadiException {
+ cli = JU_AAFCli.getAAfCli();
+ cmds = new ArrayList<>();
+ Param[] param = new Param[] {new Param("name",true)};
+ CmdStub cmd = new CmdStub(cli, "null", param);
+ cmds.add(cmd);
+ help = new Help(cli, cmds);
+ }
+
+ @Test
+ public void exec_HTTP_200() {
+ try {
+ assertEquals(help._exec(1, "helps"), HttpStatus.OK_200);
+ assertEquals(help._exec(1, strArr), HttpStatus.OK_200);
+ } catch (CadiException | APIException | LocatorException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ @Test
+ public void exec_HTTP_200_1() {
+ try {
+ assertEquals(help._exec(1, "helps","help"), HttpStatus.OK_200);
+ } catch (CadiException | APIException | LocatorException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ @Test
+ public void detailhelp() {
+ boolean hasError=false;
+ try {
+ help.detailedHelp(2, new StringBuilder("detail help test"));
+ } catch (Exception e) {
+ hasError=true;
+ }
+ assertEquals(hasError,false);
+ }
}