Search in sources :

Example 21 with FakeDataManager

use of org.teiid.query.processor.FakeDataManager in project teiid by teiid.

the class TestProcedureProcessor method testReturnParamWithNoResultSetVirtual.

@Test
public void testReturnParamWithNoResultSetVirtual() throws Exception {
    // $NON-NLS-1$
    String sql = "EXEC TEIIDSP8(51)";
    TransformationMetadata metadata = RealMetadataFactory.exampleBQTCached();
    ProcessorPlan plan = getProcedurePlan(sql, metadata);
    // Set up data
    FakeDataManager dataMgr = new FakeDataManager();
    // Create expected results
    // $NON-NLS-1$
    List[] expected = new List[] { Arrays.asList(51) };
    helpTestProcess(plan, expected, dataMgr, metadata);
}
Also used : TransformationMetadata(org.teiid.query.metadata.TransformationMetadata) FakeDataManager(org.teiid.query.processor.FakeDataManager) List(java.util.List) ArrayList(java.util.ArrayList) ProcessorPlan(org.teiid.query.processor.ProcessorPlan) Test(org.junit.Test)

Example 22 with FakeDataManager

use of org.teiid.query.processor.FakeDataManager in project teiid by teiid.

the class TestProcedureProcessor method testVirtualProcedure2.

@Test
public void testVirtualProcedure2() throws Exception {
    // $NON-NLS-1$
    String userUpdateStr = "EXEC pm1.vsp3()";
    QueryMetadataInterface metadata = RealMetadataFactory.example1Cached();
    FakeDataManager dataMgr = exampleDataManager(metadata);
    ProcessorPlan plan = getProcedurePlan(userUpdateStr, metadata);
    // Create expected results
    List[] expected = new List[] { // $NON-NLS-1$
    Arrays.asList(new Object[] { "Third" }) };
    helpTestProcess(plan, expected, dataMgr, metadata);
}
Also used : FakeDataManager(org.teiid.query.processor.FakeDataManager) List(java.util.List) ArrayList(java.util.ArrayList) QueryMetadataInterface(org.teiid.query.metadata.QueryMetadataInterface) ProcessorPlan(org.teiid.query.processor.ProcessorPlan) Test(org.junit.Test)

Example 23 with FakeDataManager

use of org.teiid.query.processor.FakeDataManager in project teiid by teiid.

the class TestProcedureProcessor method testJoinProcAndPhysicalModel.

@Test
public void testJoinProcAndPhysicalModel() throws Exception {
    // $NON-NLS-1$
    String userUpdateStr = "select a.e1 from (EXEC pm1.vsp46()) as a, pm1.g1 where a.e1=pm1.g1.e1";
    QueryMetadataInterface metadata = RealMetadataFactory.example1Cached();
    ProcessorPlan plan = getProcedurePlan(userUpdateStr, metadata);
    // Set up data
    FakeDataManager dataMgr = exampleDataManager(metadata);
    // Create expected results
    List[] expected = new List[] { // $NON-NLS-1$
    Arrays.asList(new Object[] { "First" }), // $NON-NLS-1$
    Arrays.asList(new Object[] { "Second" }), // $NON-NLS-1$
    Arrays.asList(new Object[] { "Third" }) };
    helpTestProcess(plan, expected, dataMgr, metadata);
}
Also used : FakeDataManager(org.teiid.query.processor.FakeDataManager) List(java.util.List) ArrayList(java.util.ArrayList) QueryMetadataInterface(org.teiid.query.metadata.QueryMetadataInterface) ProcessorPlan(org.teiid.query.processor.ProcessorPlan) Test(org.junit.Test)

Example 24 with FakeDataManager

use of org.teiid.query.processor.FakeDataManager in project teiid by teiid.

the class TestProcedureProcessor method testCase3521.

@Test
public void testCase3521() throws Exception {
    // $NON-NLS-1$
    String userUpdateStr = "EXEC pm1.vsp1()";
    QueryMetadataInterface metadata = RealMetadataFactory.example1Cached();
    FakeDataManager dataMgr = exampleDataManager(metadata);
    ProcessorPlan plan = getProcedurePlan(userUpdateStr, metadata);
    // Create expected results
    List[] expected = new List[] { // $NON-NLS-1$
    Arrays.asList(new Object[] { "Second" }) // Arrays.asList(new Object[] { "Third"}),   //$NON-NLS-1$
    };
    helpTestProcess(plan, expected, dataMgr, metadata);
}
Also used : FakeDataManager(org.teiid.query.processor.FakeDataManager) List(java.util.List) ArrayList(java.util.ArrayList) QueryMetadataInterface(org.teiid.query.metadata.QueryMetadataInterface) ProcessorPlan(org.teiid.query.processor.ProcessorPlan) Test(org.junit.Test)

Example 25 with FakeDataManager

use of org.teiid.query.processor.FakeDataManager in project teiid by teiid.

the class TestProcedureProcessor method testVirtualProcedureWithCreateAndSelectInto.

@Test
public void testVirtualProcedureWithCreateAndSelectInto() throws Exception {
    // $NON-NLS-1$
    String userUpdateStr = "EXEC pm1.vsp62()";
    QueryMetadataInterface metadata = RealMetadataFactory.example1Cached();
    FakeDataManager dataMgr = exampleDataManager(metadata);
    ProcessorPlan plan = getProcedurePlan(userUpdateStr, metadata);
    // Create expected results
    List[] expected = new List[] { // $NON-NLS-1$
    Arrays.asList(new Object[] { "First" }), // $NON-NLS-1$
    Arrays.asList(new Object[] { "Second" }), // $NON-NLS-1$
    Arrays.asList(new Object[] { "Third" }) };
    helpTestProcess(plan, expected, dataMgr, metadata);
}
Also used : FakeDataManager(org.teiid.query.processor.FakeDataManager) List(java.util.List) ArrayList(java.util.ArrayList) QueryMetadataInterface(org.teiid.query.metadata.QueryMetadataInterface) ProcessorPlan(org.teiid.query.processor.ProcessorPlan) Test(org.junit.Test)

Aggregations

FakeDataManager (org.teiid.query.processor.FakeDataManager)112 Test (org.junit.Test)103 ProcessorPlan (org.teiid.query.processor.ProcessorPlan)86 ArrayList (java.util.ArrayList)81 List (java.util.List)81 QueryMetadataInterface (org.teiid.query.metadata.QueryMetadataInterface)48 TransformationMetadata (org.teiid.query.metadata.TransformationMetadata)35 CommandContext (org.teiid.query.util.CommandContext)8 BasicSourceCapabilities (org.teiid.query.optimizer.capabilities.BasicSourceCapabilities)7 FunctionDescriptor (org.teiid.query.function.FunctionDescriptor)6 FakeCapabilitiesFinder (org.teiid.query.optimizer.capabilities.FakeCapabilitiesFinder)6 HashMap (java.util.HashMap)5 Map (java.util.Map)5 BufferManager (org.teiid.common.buffer.BufferManager)4 DefaultCapabilitiesFinder (org.teiid.query.optimizer.capabilities.DefaultCapabilitiesFinder)3 Constant (org.teiid.query.sql.symbol.Constant)3 ElementSymbol (org.teiid.query.sql.symbol.ElementSymbol)3 Function (org.teiid.query.sql.symbol.Function)3 Evaluator (org.teiid.query.eval.Evaluator)2 TempMetadataStore (org.teiid.query.metadata.TempMetadataStore)2