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

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


    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


    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

    for (int i = 0; i < NUM_PAIRS_SHORT / 2; 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

    for (int i = 0; i < NUM_PAIRS_INMEM; 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));
    }
   
    // re-read the data
    inView = outView.flip();
    generator.reset();
   
    // read and re-generate all records and compare them
    for (int i = 0; i < NUM_PAIRS_INMEM; 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(outView.close());
View Full Code Here

      for (int i = 0; i < NUM_PAIRS_INMEM + 1; 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));
      }
      Assert.fail("Read too much, expected EOFException.");
    }
    catch (EOFException eofex) {
      // expected
    }
   
    // re-read the data
    inView = outView.flip();
    generator.reset();
   
    // read and re-generate all records and compare them
    for (int i = 0; i < NUM_PAIRS_INMEM; 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(outView.close());
View Full Code Here

    for (int i = 0; i < NUM_PAIRS_EXTERNAL; 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));
    }
   
    // re-read the data
    inView = outView.flip();
    generator.reset();
   
    // read and re-generate all records and compare them
    for (int i = 0; i < NUM_PAIRS_EXTERNAL; 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(outView.close());
View Full Code Here

      for (int i = 0; i < NUM_PAIRS_EXTERNAL + 1; 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));
      }
      Assert.fail("Read too much, expected EOFException.");
    }
    catch (EOFException eofex) {
      // expected
    }
   
    // re-read the data
    inView = outView.flip();
    generator.reset();
   
    // read and re-generate all records and compare them
    for (int i = 0; i < NUM_PAIRS_EXTERNAL; 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(outView.close());
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.