You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2020/07/22 07:30:07 UTC

[shardingsphere-elasticjob] branch master updated: Remove expired test cases (#1248)

This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere-elasticjob.git


The following commit(s) were added to refs/heads/master by this push:
     new 1fb80b5  Remove expired test cases (#1248)
1fb80b5 is described below

commit 1fb80b5dff0547ac593e1613bd96383836a6049c
Author: Liang Zhang <te...@163.com>
AuthorDate: Wed Jul 22 15:29:59 2020 +0800

    Remove expired test cases (#1248)
---
 .../executor/prod/TaskExecutorThreadTest.java      | 35 ----------------------
 1 file changed, 35 deletions(-)

diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java
index 1d71bb0..56936c8 100755
--- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java
@@ -29,7 +29,6 @@ import org.apache.shardingsphere.elasticjob.api.listener.ShardingContexts;
 import org.apache.shardingsphere.elasticjob.cloud.executor.fixture.TestSimpleJob;
 import org.apache.shardingsphere.elasticjob.cloud.executor.prod.TaskExecutor.TaskThread;
 import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType;
-import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException;
 import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO;
 import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine;
 import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties;
@@ -41,7 +40,6 @@ import org.mockito.junit.MockitoJUnitRunner;
 import java.util.Collections;
 import java.util.LinkedHashMap;
 
-import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.verify;
 
 @RunWith(MockitoJUnitRunner.class)
@@ -70,39 +68,6 @@ public final class TaskExecutorThreadTest {
         verify(executorDriver).sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(TaskState.TASK_FINISHED).build());
     }
     
-    // TODO the test case is not reach to catch block
-    @Test
-    //(expected = JobSystemException.class)
-    public void assertLaunchTaskWithWrongElasticJobClass() {
-        TaskInfo taskInfo = buildWrongElasticJobClass();
-        TaskThread taskThread = new TaskExecutor(new TestSimpleJob()).new TaskThread(executorDriver, taskInfo);
-        try {
-            taskThread.run();
-        } catch (final JobSystemException ex) {
-            assertTrue(ex.getMessage().startsWith(String.format("ElasticJob: Class '%s' must implements ElasticJob interface.", TaskExecutorThreadTest.class.getSimpleName())));
-            throw ex;
-        }
-    }
-    
-    @Test
-    public void assertLaunchTaskWithWrongClass() {
-        TaskInfo taskInfo = buildWrongClass();
-        TaskThread taskThread = new TaskExecutor(new TestSimpleJob()).new TaskThread(executorDriver, taskInfo);
-        try {
-            taskThread.run();
-        } catch (final JobSystemException ex) {
-            assertTrue(ex.getMessage().startsWith("ElasticJob: Class 'WrongClass' initialize failure, the error message is 'WrongClass'."));
-        }
-    }
-    
-    private TaskInfo buildWrongClass() {
-        return buildTaskInfo(buildJobConfigurationYaml()).build();
-    }
-    
-    private TaskInfo buildWrongElasticJobClass() {
-        return buildTaskInfo(buildJobConfigurationYaml()).build();
-    }
-    
     private TaskInfo buildJavaTransientTaskInfo() {
         return buildTaskInfo(buildJobConfigurationYaml()).build();
     }