Package eu.stratosphere.test.recordJobs.util

Examples of eu.stratosphere.test.recordJobs.util.Tuple.addAttribute()


    Assert.assertTrue(t.getNumberOfColumns() == 1);
    Assert.assertTrue(t.getStringValueAt(0).equals("a"));
    Assert.assertTrue(t.getBytes().length == 256);
   
    t.compact();
    t.addAttribute(123345+"");
    Assert.assertTrue(t.getNumberOfColumns() == 2);
    Assert.assertTrue(t.getLongValueAt(1) == 123345);
    Assert.assertTrue(t.getBytes().length == 9);
   
    t.addAttribute("adfasdfg");
View Full Code Here


    t.addAttribute(123345+"");
    Assert.assertTrue(t.getNumberOfColumns() == 2);
    Assert.assertTrue(t.getLongValueAt(1) == 123345);
    Assert.assertTrue(t.getBytes().length == 9);
   
    t.addAttribute("adfasdfg");
    Assert.assertTrue(t.getNumberOfColumns() == 3);
    byte[] ret = t.getByteArrayValueAt(2);
    Assert.assertTrue(ret.length == "adfasdfg".getBytes().length);
    for(int i=0;i<ret.length;i++) {
      Assert.assertTrue(ret[i] == "adfasdfg".getBytes()[i]);
View Full Code Here

  public void testSerialization() {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream dos = new DataOutputStream(baos);
   
    Tuple t = new Tuple();
    t.addAttribute("Hello world!");
    try {
      t.write(dos);
    } catch (IOException e1) {
      e1.printStackTrace();
    }
View Full Code Here

      t.write(dos);
    } catch (IOException e1) {
      e1.printStackTrace();
    }
   
    t.addAttribute("2ndAttribute");
    try {
      t.write(dos);
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here

 
  @Test
  public void testToString() {
    Tuple t = new Tuple();

    t.addAttribute("Hello world!");
    Assert.assertTrue(t.toString().equals("Hello world!|"));
    t.addAttribute("2ndValue");
    Assert.assertTrue(t.toString().equals("Hello world!|2ndValue|"));
   
    byte[] ba = "attr1|attr2|3|4|attr5|thisdoesnotbelongtothetuple".getBytes();
View Full Code Here

  public void testToString() {
    Tuple t = new Tuple();

    t.addAttribute("Hello world!");
    Assert.assertTrue(t.toString().equals("Hello world!|"));
    t.addAttribute("2ndValue");
    Assert.assertTrue(t.toString().equals("Hello world!|2ndValue|"));
   
    byte[] ba = "attr1|attr2|3|4|attr5|thisdoesnotbelongtothetuple".getBytes();
    int[] of2 = {0,6,12,14,16,22};
    t = new Tuple(ba, of2, 5);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.