Package org.teiid.query.unittest

Examples of org.teiid.query.unittest.FakeMetadataFacade


       
        List[] expected = new List[] { 
            Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
        };       
       
        FakeMetadataFacade metadata = new FakeMetadataFacade(store);
       
        // Construct data manager with data
        // Plan query
        ProcessorPlan plan = TestProcedureProcessor.getProcedurePlan(sql, metadata);       
        // Run query
View Full Code Here


          Arrays.asList(1, 1, 3, 3, 8),
          Arrays.asList(1, 1, 6, 6, 8),
          Arrays.asList(1, 1, 6, 6, 11),
        };
       
        FakeMetadataFacade metadata = new FakeMetadataFacade(store);
       
        // Construct data manager with data
        // Plan query
        ProcessorPlan plan = TestProcedureProcessor.getProcedurePlan(sql, metadata);       
        // Run query
View Full Code Here

        super(name);
    }
   
    public void helpTestSupportsSelfJoin(boolean supportsSelfJoin, boolean supportsGroupAlias, boolean expectedValue) throws QueryMetadataException, TeiidComponentException {
        // Set up metadata
        FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
        FakeMetadataObject modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$

        // Set up capabilities
        FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
        BasicSourceCapabilities sourceCaps = new BasicSourceCapabilities();
        sourceCaps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, supportsSelfJoin);
View Full Code Here

        helpTestSupportsSelfJoin(true, true, true);
    }

    public void testSupportsSelfJoin4() throws Exception {       
        // Set up metadata
        FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
        FakeMetadataObject modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
       
        // Test capabilities util
        boolean actual = CapabilitiesUtil.supportsSelfJoins(modelID, metadata, new DefaultCapabilitiesFinder());
        assertEquals("Got wrong answer for supports", false, actual); //$NON-NLS-1$
    }
View Full Code Here

    }

   
    public void helpTestSupportsOuterJoin(boolean capsSupportsOuterJoin, boolean capsSupportsFullOuterJoin, JoinType joinType, boolean expectedValue) throws QueryMetadataException, TeiidComponentException {
        // Set up metadata
        FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
        FakeMetadataObject modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
       
        // Set up capabilities
        FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
        BasicSourceCapabilities sourceCaps = new BasicSourceCapabilities();
        sourceCaps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, capsSupportsOuterJoin);
View Full Code Here

        helpTestSupportsOuterJoin(true, true, JoinType.JOIN_FULL_OUTER, true);
    }

    public void helpTestSupportsAggregates(boolean capsSupportsAggregates, boolean supportsFunctionInGroupBy, List groupCols) throws QueryMetadataException, TeiidComponentException {
        // Set up metadata
        FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
        FakeMetadataObject modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
       
        // Set up capabilities
        FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
        BasicSourceCapabilities sourceCaps = new BasicSourceCapabilities();
        sourceCaps.setCapabilitySupport(Capability.QUERY_AGGREGATES, capsSupportsAggregates);
View Full Code Here

        helpTestSupportsAggregates(false, false, cols);
    }

    public void helpTestSupportsAggregateFunction(SourceCapabilities caps, AggregateSymbol aggregate, boolean expectedValue) throws QueryMetadataException, TeiidComponentException {
        // Set up metadata
        FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
        FakeMetadataObject modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
       
        // Set up capabilities
        FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
        finder.addCapabilities("pm1", caps); //$NON-NLS-1$
View Full Code Here

        helpTestSupportsAggregateFunction(caps, aggregate, true);
    }   

    public void helpTestSupportsScalar(SourceCapabilities caps, Function function, boolean expectedValue) throws QueryMetadataException, TeiidComponentException, QueryResolverException {
        // Set up metadata
        FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
        FakeMetadataObject modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
       
        // Set up capabilities
        FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
        finder.addCapabilities("pm1", caps); //$NON-NLS-1$
        ResolverVisitor.resolveLanguageObject(function, metadata);
View Full Code Here

        helpTestSupportsScalar(caps, func, true);       
    }   

    public void testSupportsDistinct1() throws Exception {       
        // Set up metadata
        FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
        FakeMetadataObject modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$

        // Set up capabilities
        FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
        BasicSourceCapabilities sourceCaps = new BasicSourceCapabilities();
        sourceCaps.setCapabilitySupport(Capability.QUERY_SELECT_DISTINCT, true);
View Full Code Here

        assertTrue(CapabilitiesUtil.supportsSelectDistinct(modelID, metadata, finder));
    }   

    public void testSupportsDistinct2() throws Exception {       
        // Set up metadata
        FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
        FakeMetadataObject modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$

        // Set up capabilities
        FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
        BasicSourceCapabilities sourceCaps = new BasicSourceCapabilities();
        sourceCaps.setCapabilitySupport(Capability.QUERY_SELECT_DISTINCT, false);
View Full Code Here

TOP

Related Classes of org.teiid.query.unittest.FakeMetadataFacade

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.