Package thrift.test

Examples of thrift.test.JavaTestHelper


    assertTrue(vmd.valueMetaData.isTypedef());
    assertFalse(vmd.keyMetaData.isTypedef());
  }

  public void testToString() throws Exception {
    JavaTestHelper object = new JavaTestHelper();
    object.req_int = 0;
    object.req_obj = "";

    object.req_bin = ByteBuffer.wrap(new byte[] {
      0, -1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13, 14, -15,
      16, -17, 18, -19, 20, -21, 22, -23, 24, -25, 26, -27, 28, -29,
      30, -31, 32, -33, 34, -35, 36, -37, 38, -39, 40, -41, 42, -43, 44,
      -45, 46, -47, 48, -49, 50, -51, 52, -53, 54, -55, 56, -57, 58, -59,
      60, -61, 62, -63, 64, -65, 66, -67, 68, -69, 70, -71, 72, -73, 74,
      -75, 76, -77, 78, -79, 80, -81, 82, -83, 84, -85, 86, -87, 88, -89,
      90, -91, 92, -93, 94, -95, 96, -97, 98, -99, 100, -101, 102, -103,
      104, -105, 106, -107, 108, -109, 110, -111, 112, -113, 114, -115,
      116, -117, 118, -119, 120, -121, 122, -123, 124, -125, 126, -127,
    });

    assertEquals("JavaTestHelper(req_int:0, req_obj:, req_bin:"+
        "00 FF 02 FD 04 FB 06 F9 08 F7 0A F5 0C F3 0E F1 10 EF 12 ED 14 "+
        "EB 16 E9 18 E7 1A E5 1C E3 1E E1 20 DF 22 DD 24 DB 26 D9 28 D7 "+
        "2A D5 2C D3 2E D1 30 CF 32 CD 34 CB 36 C9 38 C7 3A C5 3C C3 3E "+
        "C1 40 BF 42 BD 44 BB 46 B9 48 B7 4A B5 4C B3 4E B1 50 AF 52 AD "+
        "54 AB 56 A9 58 A7 5A A5 5C A3 5E A1 60 9F 62 9D 64 9B 66 99 68 "+
        "97 6A 95 6C 93 6E 91 70 8F 72 8D 74 8B 76 89 78 87 7A 85 7C 83 "+
        "7E 81)",
        object.toString());
    object.req_bin = ByteBuffer.wrap(new byte[] {
      0, -1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13, 14, -15,
      16, -17, 18, -19, 20, -21, 22, -23, 24, -25, 26, -27, 28, -29,
      30, -31, 32, -33, 34, -35, 36, -37, 38, -39, 40, -41, 42, -43, 44,
      -45, 46, -47, 48, -49, 50, -51, 52, -53, 54, -55, 56, -57, 58, -59,
      60, -61, 62, -63, 64, -65, 66, -67, 68, -69, 70, -71, 72, -73, 74,
      -75, 76, -77, 78, -79, 80, -81, 82, -83, 84, -85, 86, -87, 88, -89,
      90, -91, 92, -93, 94, -95, 96, -97, 98, -99, 100, -101, 102, -103,
      104, -105, 106, -107, 108, -109, 110, -111, 112, -113, 114, -115,
      116, -117, 118, -119, 120, -121, 122, -123, 124, -125, 126, -127,
      0,
    });

    assertEquals("JavaTestHelper(req_int:0, req_obj:, req_bin:"+
        "00 FF 02 FD 04 FB 06 F9 08 F7 0A F5 0C F3 0E F1 10 EF 12 ED 14 "+
        "EB 16 E9 18 E7 1A E5 1C E3 1E E1 20 DF 22 DD 24 DB 26 D9 28 D7 "+
        "2A D5 2C D3 2E D1 30 CF 32 CD 34 CB 36 C9 38 C7 3A C5 3C C3 3E "+
        "C1 40 BF 42 BD 44 BB 46 B9 48 B7 4A B5 4C B3 4E B1 50 AF 52 AD "+
        "54 AB 56 A9 58 A7 5A A5 5C A3 5E A1 60 9F 62 9D 64 9B 66 99 68 "+
        "97 6A 95 6C 93 6E 91 70 8F 72 8D 74 8B 76 89 78 87 7A 85 7C 83 "+
        "7E 81...)",
        object.toString());

    object.req_bin = ByteBuffer.wrap(new byte[] {});
    object.setOpt_binIsSet(true);

    assertEquals("JavaTestHelper(req_int:0, req_obj:, req_bin:)",
        object.toString());
  }
View Full Code Here


    assertEquals("JavaTestHelper(req_int:0, req_obj:, req_bin:)",
        object.toString());
  }

  public void testBytesBufferFeatures() throws Exception {
    JavaTestHelper o = new JavaTestHelper();
    o.setReq_bin((ByteBuffer)null);
    assertNull(o.getReq_bin());
    o.setReq_bin((byte[])null);
    assertNull(o.getReq_bin());
  }
View Full Code Here

    assertTrue(vmd.valueMetaData.isTypedef());
    assertFalse(vmd.keyMetaData.isTypedef());
  }

  public void testToString() throws Exception {
    JavaTestHelper object = new JavaTestHelper();
    object.req_int = 0;
    object.req_obj = "";

    object.req_bin = ByteBuffer.wrap(new byte[] {
      0, -1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13, 14, -15,
      16, -17, 18, -19, 20, -21, 22, -23, 24, -25, 26, -27, 28, -29,
      30, -31, 32, -33, 34, -35, 36, -37, 38, -39, 40, -41, 42, -43, 44,
      -45, 46, -47, 48, -49, 50, -51, 52, -53, 54, -55, 56, -57, 58, -59,
      60, -61, 62, -63, 64, -65, 66, -67, 68, -69, 70, -71, 72, -73, 74,
      -75, 76, -77, 78, -79, 80, -81, 82, -83, 84, -85, 86, -87, 88, -89,
      90, -91, 92, -93, 94, -95, 96, -97, 98, -99, 100, -101, 102, -103,
      104, -105, 106, -107, 108, -109, 110, -111, 112, -113, 114, -115,
      116, -117, 118, -119, 120, -121, 122, -123, 124, -125, 126, -127,
    });

    assertEquals("JavaTestHelper(req_int:0, req_obj:, req_bin:"+
        "00 FF 02 FD 04 FB 06 F9 08 F7 0A F5 0C F3 0E F1 10 EF 12 ED 14 "+
        "EB 16 E9 18 E7 1A E5 1C E3 1E E1 20 DF 22 DD 24 DB 26 D9 28 D7 "+
        "2A D5 2C D3 2E D1 30 CF 32 CD 34 CB 36 C9 38 C7 3A C5 3C C3 3E "+
        "C1 40 BF 42 BD 44 BB 46 B9 48 B7 4A B5 4C B3 4E B1 50 AF 52 AD "+
        "54 AB 56 A9 58 A7 5A A5 5C A3 5E A1 60 9F 62 9D 64 9B 66 99 68 "+
        "97 6A 95 6C 93 6E 91 70 8F 72 8D 74 8B 76 89 78 87 7A 85 7C 83 "+
        "7E 81)",
        object.toString());
    object.req_bin = ByteBuffer.wrap(new byte[] {
      0, -1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13, 14, -15,
      16, -17, 18, -19, 20, -21, 22, -23, 24, -25, 26, -27, 28, -29,
      30, -31, 32, -33, 34, -35, 36, -37, 38, -39, 40, -41, 42, -43, 44,
      -45, 46, -47, 48, -49, 50, -51, 52, -53, 54, -55, 56, -57, 58, -59,
      60, -61, 62, -63, 64, -65, 66, -67, 68, -69, 70, -71, 72, -73, 74,
      -75, 76, -77, 78, -79, 80, -81, 82, -83, 84, -85, 86, -87, 88, -89,
      90, -91, 92, -93, 94, -95, 96, -97, 98, -99, 100, -101, 102, -103,
      104, -105, 106, -107, 108, -109, 110, -111, 112, -113, 114, -115,
      116, -117, 118, -119, 120, -121, 122, -123, 124, -125, 126, -127,
      0,
    });

    assertEquals("JavaTestHelper(req_int:0, req_obj:, req_bin:"+
        "00 FF 02 FD 04 FB 06 F9 08 F7 0A F5 0C F3 0E F1 10 EF 12 ED 14 "+
        "EB 16 E9 18 E7 1A E5 1C E3 1E E1 20 DF 22 DD 24 DB 26 D9 28 D7 "+
        "2A D5 2C D3 2E D1 30 CF 32 CD 34 CB 36 C9 38 C7 3A C5 3C C3 3E "+
        "C1 40 BF 42 BD 44 BB 46 B9 48 B7 4A B5 4C B3 4E B1 50 AF 52 AD "+
        "54 AB 56 A9 58 A7 5A A5 5C A3 5E A1 60 9F 62 9D 64 9B 66 99 68 "+
        "97 6A 95 6C 93 6E 91 70 8F 72 8D 74 8B 76 89 78 87 7A 85 7C 83 "+
        "7E 81...)",
        object.toString());

    object.req_bin = ByteBuffer.wrap(new byte[] {});
    object.setOpt_binIsSet(true);

    assertEquals("JavaTestHelper(req_int:0, req_obj:, req_bin:)",
        object.toString());
  }
View Full Code Here

    assertEquals("JavaTestHelper(req_int:0, req_obj:, req_bin:)",
        object.toString());
  }

  public void testBytesBufferFeatures() throws Exception {
    JavaTestHelper o = new JavaTestHelper();
    o.setReq_bin((ByteBuffer)null);
    assertNull(o.getReq_bin());
    o.setReq_bin((byte[])null);
    assertNull(o.getReq_bin());
  }
View Full Code Here

/**
*/
public class EqualityTest {
  public static void main(String[] args) throws Exception {
    JavaTestHelper lhs, rhs;


    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_int = 1;
    rhs.req_int = 1;
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_int = 1;
    rhs.req_int = 2;
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_int = 1;
    rhs.req_int = 1;
    rhs.setReq_intIsSet(true);
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_int = 1;
    rhs.req_int = 2;
    rhs.setReq_intIsSet(true);
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_int = 1;
    rhs.req_int = 1;
    lhs.setReq_intIsSet(true);
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_int = 1;
    rhs.req_int = 2;
    lhs.setReq_intIsSet(true);
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_int = 1;
    rhs.req_int = 1;
    lhs.setReq_intIsSet(true);
    rhs.setReq_intIsSet(true);
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_int = 1;
    rhs.req_int = 2;
    lhs.setReq_intIsSet(true);
    rhs.setReq_intIsSet(true);
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_int = 1;
    rhs.opt_int = 1;
    // this_present = False
    // that_present = False
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_int = 1;
    rhs.opt_int = 2;
    // this_present = False
    // that_present = False
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_int = 1;
    rhs.opt_int = 1;
    rhs.setOpt_intIsSet(true);
    // this_present = False
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_int = 1;
    rhs.opt_int = 2;
    rhs.setOpt_intIsSet(true);
    // this_present = False
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_int = 1;
    rhs.opt_int = 1;
    lhs.setOpt_intIsSet(true);
    // this_present = True
    // that_present = False
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_int = 1;
    rhs.opt_int = 2;
    lhs.setOpt_intIsSet(true);
    // this_present = True
    // that_present = False
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_int = 1;
    rhs.opt_int = 1;
    lhs.setOpt_intIsSet(true);
    rhs.setOpt_intIsSet(true);
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_int = 1;
    rhs.opt_int = 2;
    lhs.setOpt_intIsSet(true);
    rhs.setOpt_intIsSet(true);
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_obj = "foo";
    rhs.req_obj = "foo";
    lhs.req_obj = null;
    rhs.req_obj = null;
    // this_present = False
    // that_present = False
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_obj = "foo";
    rhs.req_obj = "bar";
    lhs.req_obj = null;
    rhs.req_obj = null;
    // this_present = False
    // that_present = False
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_obj = "foo";
    rhs.req_obj = "foo";
    lhs.req_obj = null;
    // this_present = False
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_obj = "foo";
    rhs.req_obj = "bar";
    lhs.req_obj = null;
    // this_present = False
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_obj = "foo";
    rhs.req_obj = "foo";
    rhs.req_obj = null;
    // this_present = True
    // that_present = False
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_obj = "foo";
    rhs.req_obj = "bar";
    rhs.req_obj = null;
    // this_present = True
    // that_present = False
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_obj = "foo";
    rhs.req_obj = "foo";
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_obj = "foo";
    rhs.req_obj = "bar";
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_obj = "foo";
    rhs.opt_obj = "foo";
    lhs.opt_obj = null;
    rhs.opt_obj = null;
    // this_present = False
    // that_present = False
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_obj = "foo";
    rhs.opt_obj = "bar";
    lhs.opt_obj = null;
    rhs.opt_obj = null;
    // this_present = False
    // that_present = False
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_obj = "foo";
    rhs.opt_obj = "foo";
    lhs.opt_obj = null;
    // this_present = False
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_obj = "foo";
    rhs.opt_obj = "bar";
    lhs.opt_obj = null;
    // this_present = False
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_obj = "foo";
    rhs.opt_obj = "foo";
    rhs.opt_obj = null;
    // this_present = True
    // that_present = False
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_obj = "foo";
    rhs.opt_obj = "bar";
    rhs.opt_obj = null;
    // this_present = True
    // that_present = False
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_obj = "foo";
    rhs.opt_obj = "foo";
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_obj = "foo";
    rhs.opt_obj = "bar";
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.req_bin = ByteBuffer.wrap(new byte[]{1,2});
    lhs.req_bin = null;
    rhs.req_bin = null;
    // this_present = False
    // that_present = False
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.req_bin = ByteBuffer.wrap(new byte[]{3,4});
    lhs.req_bin = null;
    rhs.req_bin = null;
    // this_present = False
    // that_present = False
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.req_bin = ByteBuffer.wrap(new byte[]{1,2});
    lhs.req_bin = null;
    // this_present = False
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.req_bin = ByteBuffer.wrap(new byte[]{3,4});
    lhs.req_bin = null;
    // this_present = False
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.req_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.req_bin = null;
    // this_present = True
    // that_present = False
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.req_bin = ByteBuffer.wrap(new byte[]{3,4});
    rhs.req_bin = null;
    // this_present = True
    // that_present = False
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.req_bin = ByteBuffer.wrap(new byte[]{1,2});
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.req_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.req_bin = ByteBuffer.wrap(new byte[]{3,4});
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.opt_bin = ByteBuffer.wrap(new byte[]{1,2});
    lhs.opt_bin = null;
    rhs.opt_bin = null;
    // this_present = False
    // that_present = False
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.opt_bin = ByteBuffer.wrap(new byte[]{3,4});
    lhs.opt_bin = null;
    rhs.opt_bin = null;
    // this_present = False
    // that_present = False
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.opt_bin = ByteBuffer.wrap(new byte[]{1,2});
    lhs.opt_bin = null;
    // this_present = False
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.opt_bin = ByteBuffer.wrap(new byte[]{3,4});
    lhs.opt_bin = null;
    // this_present = False
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.opt_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.opt_bin = null;
    // this_present = True
    // that_present = False
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.opt_bin = ByteBuffer.wrap(new byte[]{3,4});
    rhs.opt_bin = null;
    // this_present = True
    // that_present = False
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.opt_bin = ByteBuffer.wrap(new byte[]{1,2});
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != true)
      throw new RuntimeException("Failure");
    if (lhs.hashCode() != rhs.hashCode())
      throw new RuntimeException("Failure");

    lhs = new JavaTestHelper();
    rhs = new JavaTestHelper();
    lhs.opt_bin = ByteBuffer.wrap(new byte[]{1,2});
    rhs.opt_bin = ByteBuffer.wrap(new byte[]{3,4});
    // this_present = True
    // that_present = True
    if (lhs.equals(rhs) != false)
      throw new RuntimeException("Failure");

  }
View Full Code Here

    assertTrue(vmd.valueMetaData.isTypedef());
    assertFalse(vmd.keyMetaData.isTypedef());
  }

  public void testToString() throws Exception {
    JavaTestHelper object = new JavaTestHelper();
    object.req_int = 0;
    object.req_obj = "";

    object.req_bin = ByteBuffer.wrap(new byte[] {
      0, -1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13, 14, -15,
      16, -17, 18, -19, 20, -21, 22, -23, 24, -25, 26, -27, 28, -29,
      30, -31, 32, -33, 34, -35, 36, -37, 38, -39, 40, -41, 42, -43, 44,
      -45, 46, -47, 48, -49, 50, -51, 52, -53, 54, -55, 56, -57, 58, -59,
      60, -61, 62, -63, 64, -65, 66, -67, 68, -69, 70, -71, 72, -73, 74,
      -75, 76, -77, 78, -79, 80, -81, 82, -83, 84, -85, 86, -87, 88, -89,
      90, -91, 92, -93, 94, -95, 96, -97, 98, -99, 100, -101, 102, -103,
      104, -105, 106, -107, 108, -109, 110, -111, 112, -113, 114, -115,
      116, -117, 118, -119, 120, -121, 122, -123, 124, -125, 126, -127,
    });

    assertEquals("JavaTestHelper(req_int:0, req_obj:, req_bin:"+
        "00 FF 02 FD 04 FB 06 F9 08 F7 0A F5 0C F3 0E F1 10 EF 12 ED 14 "+
        "EB 16 E9 18 E7 1A E5 1C E3 1E E1 20 DF 22 DD 24 DB 26 D9 28 D7 "+
        "2A D5 2C D3 2E D1 30 CF 32 CD 34 CB 36 C9 38 C7 3A C5 3C C3 3E "+
        "C1 40 BF 42 BD 44 BB 46 B9 48 B7 4A B5 4C B3 4E B1 50 AF 52 AD "+
        "54 AB 56 A9 58 A7 5A A5 5C A3 5E A1 60 9F 62 9D 64 9B 66 99 68 "+
        "97 6A 95 6C 93 6E 91 70 8F 72 8D 74 8B 76 89 78 87 7A 85 7C 83 "+
        "7E 81)",
        object.toString());
    object.req_bin = ByteBuffer.wrap(new byte[] {
      0, -1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13, 14, -15,
      16, -17, 18, -19, 20, -21, 22, -23, 24, -25, 26, -27, 28, -29,
      30, -31, 32, -33, 34, -35, 36, -37, 38, -39, 40, -41, 42, -43, 44,
      -45, 46, -47, 48, -49, 50, -51, 52, -53, 54, -55, 56, -57, 58, -59,
      60, -61, 62, -63, 64, -65, 66, -67, 68, -69, 70, -71, 72, -73, 74,
      -75, 76, -77, 78, -79, 80, -81, 82, -83, 84, -85, 86, -87, 88, -89,
      90, -91, 92, -93, 94, -95, 96, -97, 98, -99, 100, -101, 102, -103,
      104, -105, 106, -107, 108, -109, 110, -111, 112, -113, 114, -115,
      116, -117, 118, -119, 120, -121, 122, -123, 124, -125, 126, -127,
      0,
    });

    assertEquals("JavaTestHelper(req_int:0, req_obj:, req_bin:"+
        "00 FF 02 FD 04 FB 06 F9 08 F7 0A F5 0C F3 0E F1 10 EF 12 ED 14 "+
        "EB 16 E9 18 E7 1A E5 1C E3 1E E1 20 DF 22 DD 24 DB 26 D9 28 D7 "+
        "2A D5 2C D3 2E D1 30 CF 32 CD 34 CB 36 C9 38 C7 3A C5 3C C3 3E "+
        "C1 40 BF 42 BD 44 BB 46 B9 48 B7 4A B5 4C B3 4E B1 50 AF 52 AD "+
        "54 AB 56 A9 58 A7 5A A5 5C A3 5E A1 60 9F 62 9D 64 9B 66 99 68 "+
        "97 6A 95 6C 93 6E 91 70 8F 72 8D 74 8B 76 89 78 87 7A 85 7C 83 "+
        "7E 81...)",
        object.toString());

    object.req_bin = ByteBuffer.wrap(new byte[] {});
    object.setOpt_binIsSet(true);

    assertEquals("JavaTestHelper(req_int:0, req_obj:, req_bin:)",
        object.toString());
  }
View Full Code Here

    assertTrue(vmd.valueMetaData.isTypedef());
    assertFalse(vmd.keyMetaData.isTypedef());
  }

  public void testToString() throws Exception {
    JavaTestHelper object = new JavaTestHelper();
    object.req_int = 0;
    object.req_obj = "";

    object.req_bin = ByteBuffer.wrap(new byte[] {
      0, -1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13, 14, -15,
      16, -17, 18, -19, 20, -21, 22, -23, 24, -25, 26, -27, 28, -29,
      30, -31, 32, -33, 34, -35, 36, -37, 38, -39, 40, -41, 42, -43, 44,
      -45, 46, -47, 48, -49, 50, -51, 52, -53, 54, -55, 56, -57, 58, -59,
      60, -61, 62, -63, 64, -65, 66, -67, 68, -69, 70, -71, 72, -73, 74,
      -75, 76, -77, 78, -79, 80, -81, 82, -83, 84, -85, 86, -87, 88, -89,
      90, -91, 92, -93, 94, -95, 96, -97, 98, -99, 100, -101, 102, -103,
      104, -105, 106, -107, 108, -109, 110, -111, 112, -113, 114, -115,
      116, -117, 118, -119, 120, -121, 122, -123, 124, -125, 126, -127,
    });

    assertEquals("JavaTestHelper(req_int:0, req_obj:, req_bin:"+
        "00 FF 02 FD 04 FB 06 F9 08 F7 0A F5 0C F3 0E F1 10 EF 12 ED 14 "+
        "EB 16 E9 18 E7 1A E5 1C E3 1E E1 20 DF 22 DD 24 DB 26 D9 28 D7 "+
        "2A D5 2C D3 2E D1 30 CF 32 CD 34 CB 36 C9 38 C7 3A C5 3C C3 3E "+
        "C1 40 BF 42 BD 44 BB 46 B9 48 B7 4A B5 4C B3 4E B1 50 AF 52 AD "+
        "54 AB 56 A9 58 A7 5A A5 5C A3 5E A1 60 9F 62 9D 64 9B 66 99 68 "+
        "97 6A 95 6C 93 6E 91 70 8F 72 8D 74 8B 76 89 78 87 7A 85 7C 83 "+
        "7E 81)",
        object.toString());
    object.req_bin = ByteBuffer.wrap(new byte[] {
      0, -1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13, 14, -15,
      16, -17, 18, -19, 20, -21, 22, -23, 24, -25, 26, -27, 28, -29,
      30, -31, 32, -33, 34, -35, 36, -37, 38, -39, 40, -41, 42, -43, 44,
      -45, 46, -47, 48, -49, 50, -51, 52, -53, 54, -55, 56, -57, 58, -59,
      60, -61, 62, -63, 64, -65, 66, -67, 68, -69, 70, -71, 72, -73, 74,
      -75, 76, -77, 78, -79, 80, -81, 82, -83, 84, -85, 86, -87, 88, -89,
      90, -91, 92, -93, 94, -95, 96, -97, 98, -99, 100, -101, 102, -103,
      104, -105, 106, -107, 108, -109, 110, -111, 112, -113, 114, -115,
      116, -117, 118, -119, 120, -121, 122, -123, 124, -125, 126, -127,
      0,
    });

    assertEquals("JavaTestHelper(req_int:0, req_obj:, req_bin:"+
        "00 FF 02 FD 04 FB 06 F9 08 F7 0A F5 0C F3 0E F1 10 EF 12 ED 14 "+
        "EB 16 E9 18 E7 1A E5 1C E3 1E E1 20 DF 22 DD 24 DB 26 D9 28 D7 "+
        "2A D5 2C D3 2E D1 30 CF 32 CD 34 CB 36 C9 38 C7 3A C5 3C C3 3E "+
        "C1 40 BF 42 BD 44 BB 46 B9 48 B7 4A B5 4C B3 4E B1 50 AF 52 AD "+
        "54 AB 56 A9 58 A7 5A A5 5C A3 5E A1 60 9F 62 9D 64 9B 66 99 68 "+
        "97 6A 95 6C 93 6E 91 70 8F 72 8D 74 8B 76 89 78 87 7A 85 7C 83 "+
        "7E 81...)",
        object.toString());

    object.req_bin = ByteBuffer.wrap(new byte[] {});
    object.setOpt_binIsSet(true);

    assertEquals("JavaTestHelper(req_int:0, req_obj:, req_bin:)",
        object.toString());
  }
View Full Code Here

TOP

Related Classes of thrift.test.JavaTestHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.