Package org.teiid.query.processor

Examples of org.teiid.query.processor.FakeDataManager


   
    /** arg to rowlimit function isn't in the scope of any mapping class */
    @Test public void testCase2951MaxRowsFails() throws Exception {
       
        FakeMetadataFacade metadata = exampleMetadataCached();
        FakeDataManager dataMgr = exampleDataManagerNested(metadata);
       
        helpTestProcess("SELECT * FROM xmltest.doc8 WHERE rowlimit(catalogs) = 2", null, metadata, dataMgr, QueryPlannerException.class);         //$NON-NLS-1$ //$NON-NLS-2$
    }    
View Full Code Here


    /** two conflicting row limits on the same mapping class */
    @Test public void testCase2951MaxRowsFails2() throws Exception {
       
        FakeMetadataFacade metadata = exampleMetadataCached();
        FakeDataManager dataMgr = exampleDataManagerNested(metadata);
       
        helpTestProcess("SELECT * FROM xmltest.doc8 WHERE rowlimit(supplier) = 2 AND rowlimit(supplierID) = 3", null, metadata, dataMgr, QueryPlannerException.class);         //$NON-NLS-1$ //$NON-NLS-2$
    }
View Full Code Here

   
    /** arg to rowlimitexception function isn't in the scope of any mapping class */
    @Test public void testDefect19173RowLimitExceptionFails() throws Exception {
       
        FakeMetadataFacade metadata = exampleMetadataCached();
        FakeDataManager dataMgr = exampleDataManagerNested(metadata);
       
        helpTestProcess("SELECT * FROM xmltest.doc8 WHERE rowlimitexception(catalogs) = 2", null, metadata, dataMgr, QueryPlannerException.class);         //$NON-NLS-1$ //$NON-NLS-2$
    }    
View Full Code Here

    /** two conflicting rowlimitexceptions on the same mapping class */
    @Test public void testDefect19173RowLimitExceptionFails2() throws Exception {
       
        FakeMetadataFacade metadata = exampleMetadataCached();
        FakeDataManager dataMgr = exampleDataManagerNested(metadata);
       
        helpTestProcess("SELECT * FROM xmltest.doc8 WHERE rowlimitexception(supplier) = 2 AND rowlimitexception(supplierID) = 3", null, metadata, dataMgr, QueryPlannerException.class);         //$NON-NLS-1$ //$NON-NLS-2$
    }   
View Full Code Here

   
    /** two conflicting rowlimit and rowlimitexceptions on the same mapping class fails planning */
    @Test public void testDefect19173RowLimitAndRowLimitExceptionMixFails2() throws Exception {
       
        FakeMetadataFacade metadata = exampleMetadataCached();
        FakeDataManager dataMgr = exampleDataManagerNested(metadata);
       
        helpTestProcess("SELECT * FROM xmltest.doc8 WHERE rowlimit(supplier) = 2 AND rowlimitexception(supplierID) = 3", null, metadata, dataMgr, QueryPlannerException.class);         //$NON-NLS-1$ //$NON-NLS-2$
    }   
View Full Code Here

    /** try rowlimit criteria written the reverse way */
    @Test public void testCase2951MaxRows5() throws Exception {
       
        FakeMetadataFacade metadata = exampleMetadataCached();
        FakeDataManager dataMgr = exampleDataManagerNested(metadata);
        String expectedDoc =
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" //$NON-NLS-1$
            "<Catalogs>\r\n" + //$NON-NLS-1$
            "    <Catalog>\r\n" //$NON-NLS-1$
            "        <Items>\r\n" //$NON-NLS-1$
View Full Code Here

    }
   
   
    @Test public void testNormalizationCollapse() throws Exception {
        FakeMetadataFacade metadata = exampleMetadataCached();
        FakeDataManager dataMgr = exampleDataManagerNormalization(metadata);
        String expectedDoc =
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" //$NON-NLS-1$
            "<Catalogs xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n" + //$NON-NLS-1$
            "    <Catalog>\r\n" //$NON-NLS-1$
            "        <Items>\r\n" //$NON-NLS-1$
View Full Code Here

        helpTestProcess("SELECT * FROM xmltest.normDoc1", expectedDoc, metadata, dataMgr);         //$NON-NLS-1$
    }
   
    @Test public void testNormalizationReplace() throws Exception {
        FakeMetadataFacade metadata = exampleMetadataCached();
        FakeDataManager dataMgr = exampleDataManagerNormalization(metadata);
        String expectedDoc =
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" //$NON-NLS-1$
            "<Catalogs xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n" + //$NON-NLS-1$
            "    <Catalog>\r\n" //$NON-NLS-1$
            "        <Items>\r\n" //$NON-NLS-1$
View Full Code Here

        helpTestProcess("SELECT * FROM xmltest.normDoc2", expectedDoc, metadata, dataMgr);         //$NON-NLS-1$
    }
    @Test public void testNormalizationPreserve() throws Exception {
        FakeMetadataFacade metadata = exampleMetadataCached();
        FakeDataManager dataMgr = exampleDataManagerNormalization2(metadata);
        String expectedDoc =
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" //$NON-NLS-1$
            "<Catalogs xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n" + //$NON-NLS-1$
            "    <Catalog>\r\n" //$NON-NLS-1$
            "        <Items>\r\n" //$NON-NLS-1$
View Full Code Here

    /**
     * Deluxe example
     */
    private FakeDataManager exampleDataManagerNormalization(FakeMetadataFacade metadata) {
        FakeDataManager dataMgr = new FakeDataManager();
   
        try {
            // Group stock.items
            FakeMetadataObject groupID = (FakeMetadataObject) metadata.getGroupID("stock.items"); //$NON-NLS-1$
            List elementIDs = metadata.getElementIDsInGroupID(groupID);
            List elementSymbols = createElements(elementIDs);

            dataMgr.registerTuples(
                groupID,
                elementSymbols,
               
                new List[] {
                    Arrays.asList( new Object[] { "001", null, new Integer(5), "okay" } ),         //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

TOP

Related Classes of org.teiid.query.processor.FakeDataManager

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.