You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/07/22 03:24:29 UTC

[GitHub] [shardingsphere-elasticjob] Technoboy- opened a new pull request #1236: Add test case for TaskExecutor's constructor for job type

Technoboy- opened a new pull request #1236:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1236


   Fixes #1231.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] Technoboy- commented on a change in pull request #1236: Add test case for TaskExecutor's constructor for job type

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on a change in pull request #1236:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1236#discussion_r458525147



##########
File path: elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java
##########
@@ -127,4 +130,20 @@ public void assertShutdown() {
     public void assertError() {
         taskExecutor.error(executorDriver, "");
     }
+    
+    @Test
+    @SneakyThrows
+    public void testConstructor() {

Review comment:
       Ok




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] terrymanu merged pull request #1236: Add test case for TaskExecutor's constructor for job type

Posted by GitBox <gi...@apache.org>.
terrymanu merged pull request #1236:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1236


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] terrymanu commented on a change in pull request #1236: Add test case for TaskExecutor's constructor for job type

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #1236:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1236#discussion_r458524015



##########
File path: elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java
##########
@@ -127,4 +130,20 @@ public void assertShutdown() {
     public void assertError() {
         taskExecutor.error(executorDriver, "");
     }
+    
+    @Test
+    @SneakyThrows
+    public void testConstructor() {

Review comment:
       Please use assertXXX instead of testXXX for test case method




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] Technoboy- commented on a change in pull request #1236: Add test case for TaskExecutor's constructor for job type

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on a change in pull request #1236:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1236#discussion_r458551497



##########
File path: elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java
##########
@@ -127,4 +130,20 @@ public void assertShutdown() {
     public void assertError() {
         taskExecutor.error(executorDriver, "");
     }
+    
+    @Test
+    @SneakyThrows
+    public void assertConstructor() {
+        TestSimpleJob testSimpleJob = new TestSimpleJob();
+        taskExecutor = new TaskExecutor(testSimpleJob);
+        Field fieldElasticJob = TaskExecutor.class.getDeclaredField("elasticJob");
+        fieldElasticJob.setAccessible(true);
+        Field fieldElasticJobType = TaskExecutor.class.getDeclaredField("elasticJobType");
+        fieldElasticJobType.setAccessible(true);
+        assertTrue(fieldElasticJob.get(taskExecutor) == testSimpleJob);
+        assertNull(fieldElasticJobType.get(taskExecutor));
+        taskExecutor = new TaskExecutor("simpleJob");
+        assertEquals("simpleJob", fieldElasticJobType.get(taskExecutor));

Review comment:
       Ok, thanks for reviewing!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] terrymanu commented on a change in pull request #1236: Add test case for TaskExecutor's constructor for job type

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #1236:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1236#discussion_r458546342



##########
File path: elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java
##########
@@ -127,4 +130,20 @@ public void assertShutdown() {
     public void assertError() {
         taskExecutor.error(executorDriver, "");
     }
+    
+    @Test
+    @SneakyThrows
+    public void assertConstructor() {
+        TestSimpleJob testSimpleJob = new TestSimpleJob();
+        taskExecutor = new TaskExecutor(testSimpleJob);
+        Field fieldElasticJob = TaskExecutor.class.getDeclaredField("elasticJob");
+        fieldElasticJob.setAccessible(true);
+        Field fieldElasticJobType = TaskExecutor.class.getDeclaredField("elasticJobType");
+        fieldElasticJobType.setAccessible(true);
+        assertTrue(fieldElasticJob.get(taskExecutor) == testSimpleJob);
+        assertNull(fieldElasticJobType.get(taskExecutor));
+        taskExecutor = new TaskExecutor("simpleJob");
+        assertEquals("simpleJob", fieldElasticJobType.get(taskExecutor));

Review comment:
       Please use assertThat instead of assertEquals




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org