Package eu.stratosphere.pact.runtime.test.util.TestData

Examples of eu.stratosphere.pact.runtime.test.util.TestData.Value


      readTarget = sorter.getRecord(readTarget, i++);
     
      Key rk = readTarget.getField(0, Key.class);
      Key gk = record.getField(0, Key.class);
     
      Value rv = readTarget.getField(1, Value.class);
      Value gv = record.getField(1, Value.class);
     
      Assert.assertEquals("The re-read key is wrong", gk, rk);
      Assert.assertEquals("The re-read value is wrong", gv, rv);
    }
   
View Full Code Here


      generator.next(record);
     
      Key rk = readTarget.getField(0, Key.class);
      Key gk = record.getField(0, Key.class);
     
      Value rv = readTarget.getField(1, Value.class);
      Value gv = record.getField(1, Value.class);
     
      Assert.assertEquals("The re-read key is wrong", gk, rk);
      Assert.assertEquals("The re-read value is wrong", gv, rv);
    }
   
View Full Code Here

      readTarget = sorter.getRecord(readTarget, i++);
     
      Key rk = readTarget.getField(0, Key.class);
      Key gk = record.getField(0, Key.class);
     
      Value rv = readTarget.getField(1, Value.class);
      Value gv = record.getField(1, Value.class);
     
      Assert.assertEquals("The re-read key is wrong", gk, rk);
      Assert.assertEquals("The re-read value is wrong", gv, rv);
    }
   
View Full Code Here

      readTarget = sorter.getRecord(readTarget, i--);
     
      Key rk = readTarget.getField(0, Key.class);
      Key gk = record.getField(0, Key.class);
     
      Value rv = readTarget.getField(1, Value.class);
      Value gv = record.getField(1, Value.class);
     
      Assert.assertEquals("The re-read key is wrong", gk, rk);
      Assert.assertEquals("The re-read value is wrong", gv, rv);
    }
   
View Full Code Here

    qs.sort(sorter);
   
    MutableObjectIterator<Record> iter = sorter.getIterator();
    Record readTarget = new Record();
   
    Value current = new Value();
    Value last = new Value();
   
    iter.next(readTarget);
    readTarget.getFieldInto(1, last);
   
    while ((readTarget = iter.next(readTarget)) != null) {
      readTarget.getFieldInto(1, current);
     
      final int cmp = last.compareTo(current);
      if (cmp > 0) {
        Assert.fail("Next value is not larger or equal to previous value.");
      }
     
      Value tmp = current;
      current = last;
      last = tmp;
    }
   
    // release the memory occupied by the buffers
View Full Code Here

    qs.sort(sorter);
   
    MutableObjectIterator<Record> iter = sorter.getIterator();
    Record readTarget = new Record();
   
    Value current = new Value();
    Value last = new Value();
   
    iter.next(readTarget);
    readTarget.getFieldInto(1, last);
   
    while ((readTarget = iter.next(readTarget)) != null) {
      readTarget.getFieldInto(1, current);
     
      final int cmp = last.compareTo(current);
      if (cmp > 0) {
        Assert.fail("Next value is not larger or equal to previous value.");
      }
     
      Value tmp = current;
      current = last;
      last = tmp;
    }
   
    // release the memory occupied by the buffers
View Full Code Here

  private MutableObjectIterator<Record> newIterator(final int[] keys, final String[] values)
  {
    return new MutableObjectIterator<Record>()
    {
      private Key key = new Key();
      private Value value = new Value();
     
      private int current = 0;

      @Override
      public Record next(Record reuse)
      {
        if (current < keys.length) {
          key.setKey(keys[current]);
          value.setValue(values[current]);
          current++;
          reuse.setField(0, key);
          reuse.setField(1, value);
          return reuse;
        }
View Full Code Here

    for (int i = 0; i < NUM_PAIRS_SHORT; i++) {
      generator.next(rec);
      readRec.read(inView);
     
      Key k1 = rec.getField(0, Key.class);
      Value v1 = rec.getField(1, Value.class);
     
      Key k2 = readRec.getField(0, Key.class);
      Value v2 = readRec.getField(1, Value.class);
     
      Assert.assertTrue("The re-generated and the read record do not match.", k1.equals(k2) && v1.equals(v2));
    }
   
    this.memoryManager.release(inView.close());
View Full Code Here

    final Record readRec = new Record();
    for (int i = 0; i < NUM_PAIRS_LONG; i++) {
      generator.next(rec);
      readRec.read(inView);
      final Key k1 = rec.getField(0, Key.class);
      final Value v1 = rec.getField(1, Value.class);
      final Key k2 = readRec.getField(0, Key.class);
      final Value v2 = readRec.getField(1, Value.class);
      Assert.assertTrue("The re-generated and the read record do not match.", k1.equals(k2) && v1.equals(v2));
    }
   
    this.memoryManager.release(inView.close());
    reader.deleteChannel();
View Full Code Here

      final Record readRec = new Record();
      for (int i = 0; i < NUM_PAIRS_SHORT + 1; i++) {
        generator.next(rec);
        readRec.read(inView);
        final Key k1 = rec.getField(0, Key.class);
        final Value v1 = rec.getField(1, Value.class);
        final Key k2 = readRec.getField(0, Key.class);
        final Value v2 = readRec.getField(1, Value.class);
        Assert.assertTrue("The re-generated and the read record do not match.", k1.equals(k2) && v1.equals(v2));
      }
      Assert.fail("Expected an EOFException which did not occur.");
    }
    catch (EOFException eofex) {
View Full Code Here

TOP

Related Classes of eu.stratosphere.pact.runtime.test.util.TestData.Value

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.