Skip to content

Commit

Permalink
fix @test annotation (apache#9596)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangchengming666 authored Jan 23, 2022
1 parent c589064 commit 3339e88
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ private void initDic() {
dic.buildRouterChain();
}

@Test()
@Test
public void testTimeoutExceptionCode() {
List<Invoker<DemoService>> invokers = new ArrayList<Invoker<DemoService>>();
invokers.add(new Invoker<DemoService>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private void resetInvokerToNoException() {
given(invoker3.getInterface()).willReturn(AvailableClusterInvokerTest.class);
}

@Test()
@Test
public void testInvokeNoException() {

resetInvokerToNoException();
Expand All @@ -96,7 +96,7 @@ public void testInvokeNoException() {
Assertions.assertSame(result, ret);
}

@Test()
@Test
public void testInvokeWithException() {

// remove invokers for test exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void testInvokeExceptoin() {
Assertions.assertNull(RpcContext.getServiceContext().getInvoker());
}

@Test()
@Test
public void testInvokeNoExceptoin() {

resetInvokerToNoException();
Expand All @@ -99,7 +99,7 @@ public void testInvokeNoExceptoin() {
Assertions.assertSame(result, ret);
}

@Test()
@Test
public void testNoInvoke() {
dic = mock(Directory.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void testInvokeBizException() {
}
}

@Test()
@Test
public void testInvokeNoException() {

resetInvoker1ToNoException();
Expand All @@ -118,7 +118,7 @@ public void testInvokeNoException() {
assertSame(result, ret);
}

@Test()
@Test
public void testNoInvoke() {
dic = mock(Directory.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void testInvokeWithRuntimeException() {
}
}

@Test()
@Test
public void testInvokeWithRPCException() {
given(invoker1.invoke(invocation)).willThrow(new RpcException());
given(invoker1.isAvailable()).willReturn(true);
Expand All @@ -120,7 +120,7 @@ public void testInvokeWithRPCException() {
}
}

@Test()
@Test
public void testInvoke_retryTimes() {
given(invoker1.invoke(invocation)).willThrow(new RpcException(RpcException.TIMEOUT_EXCEPTION));
given(invoker1.isAvailable()).willReturn(false);
Expand All @@ -143,7 +143,7 @@ public void testInvoke_retryTimes() {
}
}

@Test()
@Test
public void testInvoke_retryTimes2() {
int finalRetries = 1;
given(invoker1.invoke(invocation)).willThrow(new RpcException(RpcException.TIMEOUT_EXCEPTION));
Expand All @@ -170,7 +170,7 @@ public void testInvoke_retryTimes2() {
}
}

@Test()
@Test
public void testInvoke_retryTimes_withBizException() {
given(invoker1.invoke(invocation)).willThrow(new RpcException(RpcException.BIZ_EXCEPTION));
given(invoker1.isAvailable()).willReturn(false);
Expand All @@ -192,7 +192,7 @@ public void testInvoke_retryTimes_withBizException() {
}
}

@Test()
@Test
public void testInvoke_without_retry() {
int withoutRetry = 0;
final URL url = URL.valueOf("test://localhost/" + Demo.class.getName() + "?loadbalance=roundrobin&retries=" + withoutRetry);
Expand All @@ -219,7 +219,7 @@ public void testInvoke_without_retry() {
}
}

@Test()
@Test
public void testInvoke_when_retry_illegal() {
int illegalRetry = -1;
final URL url = URL.valueOf("test://localhost/" + Demo.class.getName() + "?loadbalance=roundrobin&retries=" + illegalRetry);
Expand All @@ -246,7 +246,7 @@ public void testInvoke_when_retry_illegal() {
}
}

@Test()
@Test
public void testNoInvoke() {
dic = mock(Directory.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void testClearRpcContext() {
Assertions.assertTrue(afterInvoke != null && afterInvoke.size() == 0, "clear attachment failed!");
}

@Test()
@Test
public void testInvokeNoException() {

resetInvokerToNoException();
Expand All @@ -151,7 +151,7 @@ public void testInvokeNoException() {
Assertions.assertSame(result, ret);
}

@Test()
@Test
public void testInvokeWithIllegalForksParam() {
URL url = URL.valueOf("test://test:11/test?forks=-1");
given(dic.getUrl()).willReturn(url);
Expand Down

0 comments on commit 3339e88

Please sign in to comment.