Github user anew commented on a diff in the pull request:
https://github.com/apache/incubator-tephra/pull/18#discussion_r84399721
--- Diff:
tephra-core/src/test/java/org/apache/tephra/TransactionSystemTest.java ---
@@ -33,25 +33,33 @@
*/
public abstract class TransactionSystemTest {
- public static final byte[] C1 = new byte[] { 'c', '1' };
- public static final byte[] C2 = new byte[] { 'c', '2' };
- public static final byte[] C3 = new byte[] { 'c', '3' };
- public static final byte[] C4 = new byte[] { 'c', '4' };
+ private static final byte[] C1 = new byte[] { 'c', '1' };
+ private static final byte[] C2 = new byte[] { 'c', '2' };
+ private static final byte[] C3 = new byte[] { 'c', '3' };
+ private static final byte[] C4 = new byte[] { 'c', '4' };
protected abstract TransactionSystemClient getClient() throws Exception;
protected abstract TransactionStateStorage getStateStorage() throws
Exception;
- // Unfortunately, in-memory mode and thrift mode throw different
exceptions here
- @Test(expected = Exception.class)
+ @Test
public void testNegativeTimeout() throws Exception {
- getClient().startShort(-1);
+ try {
+ getClient().startShort(-1);
+ Assert.fail("Expected illegal argument for negative timeout");
+ } catch (IllegalArgumentException e) {
--- End diff --
I don't think you can. If I annotate the base class method with
(expected=...), then that is expected also for the sub class method. By the
way, I don't think there is a problem with coupling between the tests. They are
testing the same thing on different implementations, only that one of them
wants to make an additional assertion
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---