eu.stratosphere.core.testing

Class TestPlan

    • Constructor Detail

      • TestPlan

        public TestPlan(Collection<? extends eu.stratosphere.api.common.operators.Operator> contracts)
        Initializes TestPlan for the given contracts. Sinks and Sources are automatically added in case the contracts are not already fully connected.
      • TestPlan

        public TestPlan(eu.stratosphere.api.common.operators.Operator... contracts)
        Initializes TestPlan for the given contracts. Sinks and Sources are automatically added in case the contracts are not already fully connected.
    • Method Detail

      • getActualOutput

        public TestRecords getActualOutput(Class<? extends eu.stratosphere.types.Value>[] schema)
        Returns the first actual output TestRecords with the given schema of the TestPlan.
        Returns:
        the first actual output TestRecords of the TestPlan
      • getExpectedOutput

        public TestRecords getExpectedOutput(Class<? extends eu.stratosphere.types.Value> values,
                                    Class<?>... additionalFields)
        Returns the expected output TestRecords with the given schema of the TestPlan associated with the given sink. This is the recommended method to set expected output records for more complex TestPlans.
        Returns:
        the expected output TestRecords of the TestPlan associated with the given sink
      • getExpectedOutput

        public TestRecords getExpectedOutput(eu.stratosphere.api.common.operators.GenericDataSink sink,
                                    Class<? extends eu.stratosphere.types.Value>[] schema)
        Returns the expected output TestRecords with the given schema of the TestPlan associated with the given sink. This is the recommended method to set expected output records for more complex TestPlans.
        Parameters:
        sink - the sink of which the associated expected output TestRecords should be returned
        Returns:
        the expected output TestRecords of the TestPlan associated with the given sink
      • getExpectedOutput

        public TestRecords getExpectedOutput(int sink,
                                    Class<? extends eu.stratosphere.types.Value>[] schema)
        Returns the expected output TestRecords with the given schema of the TestPlan associated with the given sink. This is the recommended method to set expected output records for more complex TestPlans.
        Parameters:
        sink - the sink of which the associated expected output TestRecords should be returned
        Returns:
        the expected output TestRecords of the TestPlan associated with the given sink
      • getSchema

        public Class<? extends eu.stratosphere.types.Value>[] getSchema()
        Returns the schema.
        Returns:
        the schema
      • run

        public void run()
        Description copied from class: GenericTestPlan
        Compiles the plan to an Plan and executes it. If expected values have been specified, the actual outputs values are compared to the expected values.
        Overrides:
        run in class GenericTestPlan<eu.stratosphere.types.Record,TestRecords>
      • setSchema

        public void setSchema(Class<? extends eu.stratosphere.types.Value> firstField,
                     Class<?>... additionalFields)
        Sets the default schema of all input and outputs.
      • setSchema

        public void setSchema(Class<? extends eu.stratosphere.types.Value>[] schema)
        Sets the default schema of all input and outputs.
        Parameters:
        schema - the schema to set
      • withSchema

        public TestPlan withSchema(Class<? extends eu.stratosphere.types.Value> firstField,
                          Class<?>... additionalFields)
        Sets the default schema of all input and outputs.
      • withSchema

        public TestPlan withSchema(Class<? extends eu.stratosphere.types.Value>[] schema)
        Sets the default schema of all input and outputs.
        Parameters:
        schema - the schema to set

Copyright © 2014. All rights reserved.