Package com.foundationdb.server.test.it.qp

Examples of com.foundationdb.server.test.it.qp.TestRow


    }

    private static OperatorCreator insertCreator(final RowType rowType, int startID, int count) {
        final Row[] rows = new Row[count];
        for(int i = 0; i < count; ++i) {
            rows[i] = new TestRow(rowType, startID + i, startID + i);
        }
        return new OperatorCreator() {
            @Override
            public Operator create(Schema schema) {
                RowType outType = schema.tableRowType(rowType.typeId());
View Full Code Here


                }
                expressions.add(PlanGenerator.generateDefaultExpression(col, null, typesRegistryService(), ddl().getTypesTranslator(), context));
            }
            return new ExpressionRow(rowType, context, context.createBindings(), expressions);
        } else {
            return new TestRow(rowType, fields);
        }
    }
View Full Code Here

    private static void compareTwoRows(Row expected, Row actual, int rowNumber, boolean skipInternalColumns) {
        if(!equal(expected, actual,skipInternalColumns)) {
            assertEquals("row " + rowNumber, String.valueOf(expected), String.valueOf(actual));
        }
        if(expected instanceof TestRow) {
            TestRow expectedTestRow = (TestRow) expected;
            if (expectedTestRow.persistityString() != null) {
                Object hKey = (actual != null) ? actual.hKey() : null;
                String actualHKeyString = String.valueOf(hKey);
                assertEquals(rowNumber + ": hkey", expectedTestRow.persistityString(), actualHKeyString);
            }
        }
    }
View Full Code Here

        Object[] o1Cols = { 10, 1 };
        Object[] cCols = { 2, "c2" };
        Object[] oCols = { 20, 2 };
        Object[] iCols = { 200, 20, "i200" };
        TestRow o1Row = new TestRow(oType, o1Cols);
        TestRow cRow = new TestRow(cType, cCols);
        TestRow oRow = new TestRow(oType, oCols);
        TestRow iRow = new TestRow(iType, iCols);

        // Unrelated o row, to demonstrate i ordering/adoption
        writeRow(tids.o, o1Cols);
        compareRows( new Row[] { o1Row }, adapter.newGroupCursor(cType.table().getGroup()) );
View Full Code Here

        Object[] o1Cols = { 10, 1 };
        Object[] cCols = { 2, "c2" };
        Object[] oCols = { 20, 2 };
        Object[] iCols = { 200, 20, "i200" };
        TestRow o1Row = new TestRow(oType, o1Cols);
        TestRow cRow = new TestRow(cType, cCols);
        TestRow oRow = new TestRow(oType, oCols);
        TestRow iRow = new TestRow(iType, iCols);

        writeRow(tids.o, o1Cols);
        writeRow(tids.c, cCols);
        writeRow(tids.o, oCols);
        writeRow(tids.i, iCols);
View Full Code Here

        Object[] o1Cols = { 10, 1 };
        Object[] cCols = { 2, "c2" };
        Object[] oOrig = { 1, 1 };
        Object[] oUpdate = { 20, 2 };
        Object[] iCols = { 200, 20, "i200" };
        TestRow o1Row = new TestRow(oType, o1Cols);
        TestRow cRow = new TestRow(cType, cCols);
        TestRow oOrigRow = new TestRow(oType, oOrig);
        TestRow oUpdateRow = new TestRow(oType, oUpdate);
        TestRow iRow = new TestRow(iType, iCols);

        writeRow(tids.o, o1Cols);
        writeRow(tids.c, cCols);
        writeRow(tids.o, oOrig);
        writeRow(tids.i, iCols);
View Full Code Here

          Arrays.asList(Arrays.asList(1L, 2L, 2L, 202L, "sid"), Arrays.asList(2L))
        );
        assertEquals(raw, treeTuples(t1Type.table().getGroup()));

        Row[] expected = {
            new TestRow(t1Type, r1),
            new TestRow(t2Type, r101),
            new TestRow(t2Type, r102),
            new TestRow(t1Type, r2),
            new TestRow(t2Type, r201),
            new TestRow(t2Type, r202)
        };
        compareRows(expected, adapter.newGroupCursor(t1Type.table().getGroup()));
        txnService().commitTransaction(session());
    }
View Full Code Here

        Object[] r2 = { 2L, "Barney" };
        writeRow(t1, r1);
        writeRow(t1, r2);

        Row[] expected = {
            new TestRow(t1Type, r1),
            new TestRow(t1Type, r2)
        };
        compareRows(expected, adapter.newGroupCursor(t1Type.table().getGroup()));

        txnService().commitTransaction(session());
    }
View Full Code Here

        writeRow(child, r1a);
        writeRow(child, r1b);
        writeRow(parent, r2);

        Row[] expected = {
            new TestRow(parentType, r1),
            new TestRow(childType, r1a),
            new TestRow(childType, r1b),
            new TestRow(parentType, r2)
        };
        compareRows(expected, adapter.newGroupCursor(parentType.table().getGroup()));

        txnService().commitTransaction(session());
    }
View Full Code Here

    protected ITBase(String suffix) {
        super(suffix);
    }

    protected static Row testRow(RowType type, Object... fields) {
        return new TestRow(type, fields);
    }
View Full Code Here

TOP

Related Classes of com.foundationdb.server.test.it.qp.TestRow

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.