tephra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From poornachandra <...@git.apache.org>
Subject [GitHub] incubator-tephra pull request #18: [TEPHRA-194] Make startShort() throw Ille...
Date Thu, 20 Oct 2016 22:28:58 GMT
Github user poornachandra commented on a diff in the pull request:

    https://github.com/apache/incubator-tephra/pull/18#discussion_r84387594
  
    --- 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 --
    
    What if some other exception is thrown? Would be good to use `@Test(expected = IllegalArgumentException.class)`


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message