igalshilman commented on a change in pull request #7872: [FLINK-11420][core]
Fixed duplicate method of TraversableSerializer
URL: https://github.com/apache/flink/pull/7872#discussion_r261708410
##########
File path:
flink-core/src/test/java/org/apache/flink/api/common/typeutils/SerializerTestInstance.java
##########
@@ -62,19 +62,27 @@ protected int getLength() {
}
//
--------------------------------------------------------------------------------------------
-
+
public void testAll() {
- testInstantiate();
- testGetLength();
- testCopy();
- testCopyIntoNewElements();
- testCopyIntoReusedElements();
- testSerializeIndividually();
- testSerializeIndividuallyReusingValues();
- testSerializeAsSequenceNoReuse();
- testSerializeAsSequenceReusingValues();
- testSerializedCopyIndividually();
- testSerializedCopyAsSequence();
- testSerializabilityAndEquals();
+ try {
Review comment:
I would suggest maybe replacing this with:
```
for (Method method : getClass().getMethods()) {
if (method.getAnnotation(Test.class) == null) {
continue;
}
try {
method.invoke(this);
}
catch (IllegalAccessException e) {
throw new RuntimeException("Unable to invoke
test " + method.getName(), e);
}
catch (InvocationTargetException e) {
sneakyThrow(e.getCause());
}
}
```
where sneakyThrow is defined as follows
```
private static <E extends Throwable> void sneakyThrow(Throwable e) throws E {
throw (E) e;
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services