Package org.teiid.query.unittest

Examples of org.teiid.query.unittest.FakeMetadataFacade


                        Arrays.asList(new Object[] { new Long(100), "Miles", "Davis", new Long(15001), new Long(134), new Integer(1), new BigDecimal("10.00"), "US" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                        Arrays.asList(new Object[] { new Long(100), "Miles", "Davis", new Long(15001), new Long(201), new Integer(1), new BigDecimal("10.00"), "US" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                };    

        // Construct data manager with data
        FakeMetadataFacade metadata = exampleVirtualDepJoin();       
        FakeDataManager dataManager = new FakeDataManager();
        sampleDataVirtualDepJoin(dataManager, metadata);
        
        // Plan query
        CommandContext context = TestProcessor.createCommandContext();
View Full Code Here


                        Arrays.asList(new Object[] { new Long(100), "Miles", "Davis", new Long(540), new Long(1002), new Integer(1), new BigDecimal("7.20") }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                        Arrays.asList(new Object[] { new Long(100), "Miles", "Davis", new Long(540), new Long(1003), new Integer(2), new BigDecimal("1000.00") }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                };    

        // Construct data manager with data
        FakeMetadataFacade metadata = exampleVirtualDepJoin();       
        FakeDataManager dataManager = new FakeDataManager();
        sampleDataVirtualDepJoin(dataManager, metadata);
        
        // Plan query
        CommandContext context = TestProcessor.createCommandContext();
View Full Code Here

        List[] expected = new List[] { 
                        Arrays.asList(new Object[] { "Miles", "Davis", new BigDecimal("1007.20") }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                };    

        // Construct data manager with data
        FakeMetadataFacade metadata = exampleVirtualDepJoin();       
        FakeDataManager dataManager = new FakeDataManager();
        sampleDataVirtualDepJoin(dataManager, metadata);
        
        // Plan query
        CommandContext context = TestProcessor.createCommandContext();
View Full Code Here

        expected.add(Arrays.asList(new Object[] { new Long(300), "CloneB", "Davis", new Long(620), new Long(1006), new Integer(1), new BigDecimal("10000.00") })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        expected.add(Arrays.asList(new Object[] { new Long(300), "CloneB", "Davis", new Long(620), new Long(1007), new Integer(2), new BigDecimal("0.75") })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        expected.add(Arrays.asList(new Object[] { new Long(300), "CloneB", "Davis", new Long(630), new Long(1008), new Integer(2), new BigDecimal("62.00") })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

        // Construct data manager with data
        FakeMetadataFacade metadata = exampleVirtualDepJoin();       
        FakeDataManager dataManager = new FakeDataManager();
        sampleDataVirtualDepJoin(dataManager, metadata);
        overrideVirtualDepJoinData(dataManager, metadata, unique);
        
        // Plan query
View Full Code Here

                        Arrays.asList(new Object[] { new Long(100), "Miles", "Davis", new Long(540), new Long(1002), new Integer(1), new BigDecimal("7.20") }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                        Arrays.asList(new Object[] { new Long(100), "Miles", "Davis", new Long(540), new Long(1003), new Integer(2), new BigDecimal("1000.00") }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                };    

        // Construct data manager with data
        FakeMetadataFacade metadata = exampleVirtualDepJoin();       
        FakeDataManager dataManager = new FakeDataManager();
        sampleDataVirtualDepJoin(dataManager, metadata);
        
        // Plan query
        Command command = TestProcessor.helpParse(sql);  
View Full Code Here

        List[] expected = new List[] { 
                        Arrays.asList(new Object[] { "Miles", "Davis", new BigDecimal("1007.20") }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                };    

        // Construct data manager with data
        FakeMetadataFacade metadata = exampleVirtualDepJoin();       
        FakeDataManager dataManager = new FakeDataManager();
        sampleDataVirtualDepJoin(dataManager, metadata);
        
        // Plan query
        CommandContext context = TestProcessor.createCommandContext();
View Full Code Here

                        Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
                        Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
                };    

        // Construct data manager with data
        FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();       
        FakeDataManager dataManager = new FakeDataManager();
        TestProcessor.sampleData1(dataManager);
        
        // Plan query
        ProcessorPlan plan = TestProcessor.helpGetPlan(sql, metadata);
View Full Code Here

      throw new RuntimeException(e);
    }
    }                 

    private void sampleData2a(FakeDataManager dataMgr) {
        FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
   
        try {
            // Group pm1.g1
            FakeMetadataObject groupID = (FakeMetadataObject) metadata.getGroupID("pm1.g1"); //$NON-NLS-1$
            List elementIDs = metadata.getElementIDsInGroupID(groupID);
            List elementSymbols = FakeDataStore.createElements(elementIDs);
       
            dataMgr.registerTuples(
                groupID,
                elementSymbols,
               
                new List[] {
                    Arrays.asList(new Object[] { "a",   new Integer(0),     Boolean.FALSE,  new Double(2.0) }), //$NON-NLS-1$
                    Arrays.asList(new Object[] { "b",   new Integer(1),     Boolean.TRUE,   null }), //$NON-NLS-1$
                    Arrays.asList(new Object[] { "c",   new Integer(2),     Boolean.FALSE,  new Double(0.0) }), //$NON-NLS-1$
                    } );      
               
            // Group pm2.g1
            groupID = (FakeMetadataObject) metadata.getGroupID("pm2.g1"); //$NON-NLS-1$
            elementIDs = metadata.getElementIDsInGroupID(groupID);
            elementSymbols = FakeDataStore.createElements(elementIDs);
       
            dataMgr.registerTuples(
                groupID,
                elementSymbols,
               
                new List[] {
                    Arrays.asList(new Object[] { "b",   new Integer(0),     Boolean.FALSE,  new Double(2.0) }), //$NON-NLS-1$
                    Arrays.asList(new Object[] { "b",   new Integer(7),     Boolean.FALSE,  new Double(2.0) }), //$NON-NLS-1$
                    Arrays.asList(new Object[] { "d",   new Integer(3),     Boolean.TRUE,   new Double(7.0) }), //$NON-NLS-1$
                    Arrays.asList(new Object[] { "e",   new Integer(1),     Boolean.TRUE,   null }), //$NON-NLS-1$
                    } );     

            // Group pm4.g1
            groupID = (FakeMetadataObject) metadata.getGroupID("pm4.g1"); //$NON-NLS-1$
            elementIDs = metadata.getElementIDsInGroupID(groupID);
            elementSymbols = FakeDataStore.createElements(elementIDs);
       
            dataMgr.registerTuples(
                groupID,
                elementSymbols,
View Full Code Here

          throw new RuntimeException(e);
        }
    }   
   
    public static void sampleData2b(FakeDataManager dataMgr) {
        FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
   
        try {
            // Group pm1.g1
            FakeMetadataObject groupID = (FakeMetadataObject) metadata.getGroupID("pm1.g1"); //$NON-NLS-1$
            List elementIDs = metadata.getElementIDsInGroupID(groupID);
            List elementSymbols = FakeDataStore.createElements(elementIDs);
       
            dataMgr.registerTuples(
                groupID,
                elementSymbols,
               
                new List[] {
                    Arrays.asList(new Object[] { "aa ",   new Integer(0),     Boolean.FALSE,  new Double(2.0) }), //$NON-NLS-1$
                    Arrays.asList(new Object[] { "bb   ",   new Integer(1),     Boolean.TRUE,   null }), //$NON-NLS-1$
                    Arrays.asList(new Object[] { "cc  ",   new Integer(2),     Boolean.FALSE,  new Double(0.0) }), //$NON-NLS-1$
                    } );      
               
            // Group pm2.g1
            groupID = (FakeMetadataObject) metadata.getGroupID("pm2.g1"); //$NON-NLS-1$
            elementIDs = metadata.getElementIDsInGroupID(groupID);
            elementSymbols = FakeDataStore.createElements(elementIDs);
       
            dataMgr.registerTuples(
                groupID,
                elementSymbols,
               
                new List[] {
                    Arrays.asList(new Object[] { "b",   new Integer(0),     Boolean.FALSE,  new Double(2.0) }), //$NON-NLS-1$
                    Arrays.asList(new Object[] { "d",   new Integer(3),     Boolean.TRUE,   new Double(7.0) }), //$NON-NLS-1$
                    Arrays.asList(new Object[] { "e",   new Integer(1),     Boolean.TRUE,   null }), //$NON-NLS-1$
                    } );     

            // Group pm4.g1
            groupID = (FakeMetadataObject) metadata.getGroupID("pm4.g1"); //$NON-NLS-1$
            elementIDs = metadata.getElementIDsInGroupID(groupID);
            elementSymbols = FakeDataStore.createElements(elementIDs);
       
            dataMgr.registerTuples(
                groupID,
                elementSymbols,
View Full Code Here

          throw new RuntimeException(e);
        }
    }   
   
    private void sampleData3(FakeDataManager dataMgr) {
      FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
   
        try {
            // Group pm1.g1
            FakeMetadataObject groupID = (FakeMetadataObject) metadata.getGroupID("pm1.g1"); //$NON-NLS-1$
            List elementSymbols = new ArrayList(1);
            ElementSymbol count = new ElementSymbol("Count"); //$NON-NLS-1$
            count.setType(Integer.class);
            elementSymbols.add(count);
       
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.