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

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 * business time utils
*/ */
public class BusinessTimeUtils { public class BusinessTimeUtils {
private BusinessTimeUtils() {
throw new IllegalStateException("BusinessTimeUtils class");
}
/** /**
* get business time in parameters by different command types * 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; package org.apache.dolphinscheduler.common.queue;
import org.apache.dolphinscheduler.common.zk.ZKServer; import org.apache.dolphinscheduler.common.zk.ZKServer;
import org.junit.AfterClass; import org.junit.*;
import org.junit.BeforeClass;
/** /**
* base task queue test for only start zk server once * base task queue test for only start zk server once
*/ */
@Ignore
public class BaseTaskQueueTest { public class BaseTaskQueueTest {
protected static ITaskQueue tasksQueue = null; protected static ITaskQueue tasksQueue = null;
@ -40,4 +40,8 @@ public class BaseTaskQueueTest {
tasksQueue.delete(); tasksQueue.delete();
ZKServer.stop(); ZKServer.stop();
} }
@Test
public void tasksQueueNotNull(){
Assert.assertNotNull(tasksQueue);
}
} }

Loading…
Cancel
Save