Package com.facebook.presto.spi.block

Examples of com.facebook.presto.spi.block.LazySliceArrayBlock


    @Test
    public void testRelease()
    {
        TestLazySliceArrayBlockLoader loader = new TestLazySliceArrayBlockLoader(null);
        LazySliceArrayBlock block = new LazySliceArrayBlock(10, loader);

        // release the block
        block.release();

        // verify release was called
        assertTrue(loader.released);

        // verify methods accessing the data throw IllegalStateException
        try {
            block.isNull(0);
            fail("Expected IllegalStateException");
        }
        catch (IllegalStateException expected) {
        }

        try {
            block.getLength(0);
            fail("Expected IllegalStateException");
        }
        catch (IllegalStateException expected) {
        }

        try {
            block.getByte(0, 0);
            fail("Expected IllegalStateException");
        }
        catch (IllegalStateException expected) {
        }

        try {
            block.getInt(0, 0);
            fail("Expected IllegalStateException");
        }
        catch (IllegalStateException expected) {
        }

        try {
            block.getLong(0, 0);
            fail("Expected IllegalStateException");
        }
        catch (IllegalStateException expected) {
        }

        try {
            block.getDouble(0, 0);
            fail("Expected IllegalStateException");
        }
        catch (IllegalStateException expected) {
        }

        try {
            block.getSlice(0, 0, 1);
            fail("Expected IllegalStateException");
        }
        catch (IllegalStateException expected) {
        }
    }
View Full Code Here


        }
    }

    private static void assertVariableWithValues(Slice[] expectedValues)
    {
        LazySliceArrayBlock block = new LazySliceArrayBlock(expectedValues.length, new TestLazySliceArrayBlockLoader(expectedValues));
        assertBlock(block, expectedValues);
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.spi.block.LazySliceArrayBlock

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.