Browse Source

Adapting partial code(file name start with B) to the sonar cloud rules (#1915)

* Adapting partial code(file name start with B) to the sonar cloud rules

* add @Ignore to BaseTaskQueueTest class
pull/2/head
gabry.wu 5 years ago committed by GitHub
parent
commit
b77dddfeef
  1. 9
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/BaseController.java
  2. 4
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/placeholder/BusinessTimeUtils.java
  3. 8
      dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/BaseTaskQueueTest.java

9
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/BaseController.java

@ -157,8 +157,7 @@ public class BaseController {
* @return success result code
*/
public Result success(String msg, Object list) {
Result result = getResult(msg, list);
return result;
return getResult(msg, list);
}
/**
@ -168,8 +167,7 @@ public class BaseController {
* @return success result code
*/
public Result success(Object list) {
Result result = getResult(Status.SUCCESS.getMsg(), list);
return result;
return getResult(Status.SUCCESS.getMsg(), list);
}
/**
@ -181,8 +179,7 @@ public class BaseController {
* @return success result code
*/
public Result success(String msg, Map<String, Object> object) {
Result result = getResult(msg, object);
return result;
return getResult(msg, object);
}
/**

4
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/placeholder/BusinessTimeUtils.java

@ -33,7 +33,9 @@ import static org.apache.commons.lang.time.DateUtils.addDays;
* business time utils
*/
public class BusinessTimeUtils {
private BusinessTimeUtils() {
throw new IllegalStateException("BusinessTimeUtils class");
}
/**
* get business time in parameters by different command types
*

8
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/BaseTaskQueueTest.java

@ -17,12 +17,12 @@
package org.apache.dolphinscheduler.common.queue;
import org.apache.dolphinscheduler.common.zk.ZKServer;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.*;
/**
* base task queue test for only start zk server once
*/
@Ignore
public class BaseTaskQueueTest {
protected static ITaskQueue tasksQueue = null;
@ -40,4 +40,8 @@ public class BaseTaskQueueTest {
tasksQueue.delete();
ZKServer.stop();
}
@Test
public void tasksQueueNotNull(){
Assert.assertNotNull(tasksQueue);
}
}

Loading…
Cancel
Save