Search in sources :

Example 1 with EngineResourceInfo

use of com.dtstack.taier.base.resource.EngineResourceInfo in project Taier by DTStack.

the class AbstractRdbsClientTest method testJudgeSlots.

@Test
public void testJudgeSlots() throws Exception {
    JobClient jobClient = new JobClient();
    JudgeResult result = testRdbsClient.judgeSlots(jobClient);
    Assert.assertEquals(JudgeResult.JudgeType.NOT_OK, result.getResult());
    EngineResourceInfo info = PowerMockito.mock(EngineResourceInfo.class);
    when(info.judgeSlots(any(JobClient.class))).thenReturn(JudgeResult.ok());
    MemberModifier.field(TestRdbsClient.class, "resourceInfo").set(testRdbsClient, info);
    JudgeResult judgeResult = testRdbsClient.judgeSlots(jobClient);
    Assert.assertEquals(JudgeResult.JudgeType.OK, judgeResult.getResult());
}
Also used : EngineResourceInfo(com.dtstack.taier.base.resource.EngineResourceInfo) JudgeResult(com.dtstack.taier.pluginapi.pojo.JudgeResult) JobClient(com.dtstack.taier.pluginapi.JobClient) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

EngineResourceInfo (com.dtstack.taier.base.resource.EngineResourceInfo)1 JobClient (com.dtstack.taier.pluginapi.JobClient)1 JudgeResult (com.dtstack.taier.pluginapi.pojo.JudgeResult)1 Test (org.junit.Test)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1