Github user GJL commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5220#discussion_r159449988
  
    --- Diff: 
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendCancelTest.java
 ---
    @@ -42,70 +39,54 @@
     /**
      * Tests for the CANCEL command.
      */
    -public class CliFrontendCancelTest {
    +public class CliFrontendCancelTest extends TestLogger {
     
        @BeforeClass
        public static void init() {
                CliFrontendTestUtils.pipeSystemOutToNull();
        }
     
        @Test
    -   public void testCancel() {
    -           try {
    -                   // test unrecognized option
    -                   {
    -                           String[] parameters = {"-v", "-l"};
    -                           CliFrontend testFrontend = new 
CliFrontend(CliFrontendTestUtils.getConfigDir());
    -                           int retCode = testFrontend.cancel(parameters);
    -                           assertTrue(retCode != 0);
    -                   }
    -
    -                   // test missing job id
    -                   {
    -                           String[] parameters = {};
    -                           CliFrontend testFrontend = new 
CliFrontend(CliFrontendTestUtils.getConfigDir());
    -                           int retCode = testFrontend.cancel(parameters);
    -                           assertTrue(retCode != 0);
    -                   }
    +   public void testCancel() throws Exception {
     
    -                   // test cancel properly
    -                   {
    -                           JobID jid = new JobID();
    +           // test cancel properly
    +           {
    +                   JobID jid = new JobID();
     
    -                           String[] parameters = { jid.toString() };
    -                           CancelTestCliFrontend testFrontend = new 
CancelTestCliFrontend(false);
    +                   String[] parameters = { jid.toString() };
    +                   CancelTestCliFrontend testFrontend = new 
CancelTestCliFrontend(false);
     
    -                           int retCode = testFrontend.cancel(parameters);
    -                           assertTrue(retCode == 0);
    +                   int retCode = testFrontend.cancel(parameters);
    +                   assertTrue(retCode == 0);
    --- End diff --
    
    nit: Code is copied but it's better to use `assertEquals` for proper 
failure reasons. 


---

Reply via email to