public class TestRecords extends GenericTestRecords<eu.stratosphere.types.Record>
TestPlan. The class is
especially important when setting the expected values in the TestPlan.GenericTestRecords.load(Class, Configuration) and GenericTestRecords.load(Class, String, Configuration) the
location, format, and configuration of the data can be specified. The file is lazily loaded and thus can be
comparable large.
add(Record...), add(Value...), and
add(Iterable). Please note that the actual amount of records is quite for a test case as the TestPlan
already involves a certain degree of overhead.GenericTestRecords.hashCode() or to compare two instances with
GenericTestRecords.equals(Object) can become quite long. Currently, the comparison result is order-dependent as TestRecords are
interpreted as a list.| Constructor and Description |
|---|
TestRecords(Class<? extends eu.stratosphere.types.Value>[] schema)
Initializes TestRecords with the given schema.
|
TestRecords(Class<? extends eu.stratosphere.types.Value> firstEntry,
Class<?>... remainingEntries)
Initializes TestRecords with the given schema.
|
TestRecords(TypeConfig<eu.stratosphere.types.Record> typeConfig)
Initializes TestRecords with the given type config.
|
| Modifier and Type | Method and Description |
|---|---|
TestRecords |
add(GenericTestRecords<eu.stratosphere.types.Record> records)
Adds several records at once.
|
TestRecords |
add(Iterable<? extends eu.stratosphere.types.Record> records)
Adds several records at once.
|
TestRecords |
add(eu.stratosphere.types.Record... records)
Adds several records at once.
|
TestRecords |
add(eu.stratosphere.types.Value... values)
Adds input or expected values to this
TestRecords. |
static TypeConfig<eu.stratosphere.types.Record> |
getRecordConfig(Class<? extends eu.stratosphere.types.Value>[] schema)
Creates the type config specific for Stratosphere
Records with the given schema. |
static TypeConfig<eu.stratosphere.types.Record> |
getRecordConfig(Class<? extends eu.stratosphere.types.Value> firstEntry,
Class<?>... remainingEntries)
Creates the type config specific for Stratosphere
Records with the given schema. |
static Class<? extends eu.stratosphere.types.Value>[] |
getSchema(TypeConfig<eu.stratosphere.types.Record> config)
Returns the schema from the given config.
|
void |
inferTypeConfig() |
void |
setAllowedDoubleDelta(double delta)
Sets the double delta that is allowed so that
DoubleValues are treated as equal. |
TestRecords |
withAllowedDoubleDelta(double delta)
Sets the double delta that is allowed so that
DoubleValues are treated as equal. |
assertEquals, close, equals, getRecords, getTypeConfig, hashCode, isAdhoc, isInitialized, iterator, iterator, load, load, saveToFile, setEmpty, setTypeConfig, toString, unsortedIteratorpublic TestRecords(Class<? extends eu.stratosphere.types.Value> firstEntry, Class<?>... remainingEntries)
public TestRecords(Class<? extends eu.stratosphere.types.Value>[] schema)
public TestRecords(TypeConfig<eu.stratosphere.types.Record> typeConfig)
public TestRecords add(GenericTestRecords<eu.stratosphere.types.Record> records)
GenericTestRecordsadd in class GenericTestRecords<eu.stratosphere.types.Record>records - the records to addpublic TestRecords add(Iterable<? extends eu.stratosphere.types.Record> records)
GenericTestRecordsadd in class GenericTestRecords<eu.stratosphere.types.Record>records - the records to addpublic TestRecords add(eu.stratosphere.types.Record... records)
GenericTestRecordsadd in class GenericTestRecords<eu.stratosphere.types.Record>records - the records to addpublic TestRecords add(eu.stratosphere.types.Value... values)
TestRecords.public void inferTypeConfig()
public void setAllowedDoubleDelta(double delta)
DoubleValues are treated as equal.public TestRecords withAllowedDoubleDelta(double delta)
DoubleValues are treated as equal.public static final TypeConfig<eu.stratosphere.types.Record> getRecordConfig(Class<? extends eu.stratosphere.types.Value> firstEntry, Class<?>... remainingEntries)
Records with the given schema.public static final TypeConfig<eu.stratosphere.types.Record> getRecordConfig(Class<? extends eu.stratosphere.types.Value>[] schema)
Records with the given schema.public static final Class<? extends eu.stratosphere.types.Value>[] getSchema(TypeConfig<eu.stratosphere.types.Record> config)
Copyright © 2014. All rights reserved.