Package org.teiid.query.unittest

Examples of org.teiid.query.unittest.FakeMetadataObject$Props


        helpTestVisitor("pm1.g1.e1 IN ('x')", modelID, metadata, capFinder, true, false);                 //$NON-NLS-1$
    }

    @Test public void testSetCriteria5() {
        FakeMetadataFacade metadata = FakeMetadataFactory.example1();
        FakeMetadataObject modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
        FakeMetadataObject elementID = metadata.getStore().findObject("pm1.g1.e1" , FakeMetadataObject.ELEMENT); //$NON-NLS-1$
        elementID.putProperty(FakeMetadataObject.Props.SEARCHABLE_COMPARE, Boolean.FALSE);
               
        FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
        BasicSourceCapabilities caps = new BasicSourceCapabilities();
        caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
        capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
View Full Code Here


   
    // element not searchable
    @Test public void testSubqueryCompareCriteriaSearchableFail() {
        FakeMetadataFacade metadata = FakeMetadataFactory.example1();
        Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
        FakeMetadataObject e1 = metadata.getStore().findObject("pm1.g1.e1", FakeMetadataObject.ELEMENT); //$NON-NLS-1$
        e1.putProperty(FakeMetadataObject.Props.SEARCHABLE_COMPARE, Boolean.FALSE);
               
        FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
        BasicSourceCapabilities caps = new BasicSourceCapabilities();
        caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
        capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
View Full Code Here

                                 String[] mins,
                                 String[] maxs) {
       
        Iterator iter = elementObjects.iterator();
        for(int i=0; iter.hasNext(); i++) {
            FakeMetadataObject obj = (FakeMetadataObject) iter.next();
            if(ndvs != null) {
                obj.putProperty(FakeMetadataObject.Props.DISTINCT_VALUES, new Integer(ndvs[i]));
            }
            if(nnvs != null) {
                obj.putProperty(FakeMetadataObject.Props.NULL_VALUES, new Integer(nnvs[i]));
            }
            if(mins != null) {
                obj.putProperty(FakeMetadataObject.Props.MIN_VALUE, mins[i]);
            }
            if(maxs != null) {
                obj.putProperty(FakeMetadataObject.Props.MAX_VALUE, maxs[i]);
            }
           
        }
    }
View Full Code Here

        }
    }

    public static FakeMetadataFacade example1() {
        // Create models
        FakeMetadataObject pm1 = FakeMetadataFactory.createPhysicalModel("pm1"); //$NON-NLS-1$
        FakeMetadataObject vm1 = FakeMetadataFactory.createVirtualModel("vm1"); //$NON-NLS-1$

        // Create physical groups
        FakeMetadataObject pm1g1 =
            FakeMetadataFactory.createPhysicalGroup("pm1.g1", pm1); //$NON-NLS-1$
        FakeMetadataObject pm1g2 =
            FakeMetadataFactory.createPhysicalGroup("pm1.g2", pm1); //$NON-NLS-1$
        FakeMetadataObject pm1g3 =
            FakeMetadataFactory.createPhysicalGroup("pm1.g3", pm1); //$NON-NLS-1$
        FakeMetadataObject pm1g4 =
            FakeMetadataFactory.createPhysicalGroup("pm1.g4", pm1); //$NON-NLS-1$
        FakeMetadataObject pm1g5 =
            FakeMetadataFactory.createPhysicalGroup("pm1.g5", pm1); //$NON-NLS-1$

        // Create physical elements
        List pm1g1e =
            FakeMetadataFactory.createElements(
                pm1g1,
                new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.INTEGER,
                    DataTypeManager.DefaultDataTypes.BOOLEAN,
                    DataTypeManager.DefaultDataTypes.DOUBLE });
        List pm1g2e =
            FakeMetadataFactory.createElements(
                pm1g2,
                new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.INTEGER,
                    DataTypeManager.DefaultDataTypes.BOOLEAN,
                    DataTypeManager.DefaultDataTypes.DOUBLE });
        List pm1g3e =
            FakeMetadataFactory.createElements(
                pm1g3,
                new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.INTEGER,
                    DataTypeManager.DefaultDataTypes.BOOLEAN,
                    DataTypeManager.DefaultDataTypes.DOUBLE });
        List pm1g4e =
            FakeMetadataFactory.createElements(
                pm1g4,
                new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.INTEGER,
                    DataTypeManager.DefaultDataTypes.BOOLEAN,
                    DataTypeManager.DefaultDataTypes.DOUBLE });
        List pm1g5e =
            FakeMetadataFactory.createElements(
                pm1g5,
                new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.INTEGER,
                    DataTypeManager.DefaultDataTypes.BOOLEAN,
                    DataTypeManager.DefaultDataTypes.DOUBLE });

        // Create virtual groups
        QueryNode vm1g1n1 = new QueryNode("SELECT * FROM tm1.g1"); //$NON-NLS-1$ //$NON-NLS-2$
        //selects from temp group
        FakeMetadataObject vm1g1 =
            FakeMetadataFactory.createVirtualGroup("vm1.g1", vm1, vm1g1n1); //$NON-NLS-1$

        QueryNode vm1g2n1 =
            new QueryNode("SELECT * FROM pm1.g2 where pm1.g2.e1=?"); //$NON-NLS-1$ //$NON-NLS-2$
        vm1g2n1.addBinding("vm1.g1.e1"); //$NON-NLS-1$
        FakeMetadataObject vm1g2 =
            FakeMetadataFactory.createVirtualGroup("vm1.g2", vm1, vm1g2n1); //$NON-NLS-1$

        QueryNode vm1g3n1 =
            new QueryNode("SELECT * FROM pm1.g3 where pm1.g3.e1=?"); //$NON-NLS-1$ //$NON-NLS-2$
        vm1g3n1.addBinding("vm1.g2.e1"); //$NON-NLS-1$
        FakeMetadataObject vm1g3 =
            FakeMetadataFactory.createVirtualGroup("vm1.g3", vm1, vm1g3n1); //$NON-NLS-1$

        QueryNode vm1g4n1 = new QueryNode("SELECT * FROM pm1.g4"); //$NON-NLS-1$ //$NON-NLS-2$
        FakeMetadataObject vm1g4 =
            FakeMetadataFactory.createVirtualGroup("vm1.g4", vm1, vm1g4n1); //$NON-NLS-1$

        QueryNode vm1g5n1 =
            new QueryNode(
                "SELECT * FROM pm1.g5 where pm1.g5.e1=? AND pm1.g5.e2=?"); //$NON-NLS-1$
        vm1g5n1.addBinding("vm1.g4.e1"); //$NON-NLS-1$
        vm1g5n1.addBinding("vm1.g1.e1"); //$NON-NLS-1$
        FakeMetadataObject vm1g5 =
            FakeMetadataFactory.createVirtualGroup("vm1.g5", vm1, vm1g5n1); //$NON-NLS-1$

        QueryNode tempGroup1 =
            new QueryNode("SELECT * FROM pm1.g1 where e2 < '5'"); //$NON-NLS-1$ //$NON-NLS-2$
        FakeMetadataObject tm1g1 =
            FakeMetadataFactory.createVirtualGroup("tm1.g1", vm1, tempGroup1); //$NON-NLS-1$

        // Create virtual elements
        List vm1g1e =
            FakeMetadataFactory.createElements(
                vm1g1,
                new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.INTEGER,
                    DataTypeManager.DefaultDataTypes.BOOLEAN,
                    DataTypeManager.DefaultDataTypes.DOUBLE });
        List vm1g2e =
            FakeMetadataFactory.createElements(
                vm1g2,
                new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.INTEGER,
                    DataTypeManager.DefaultDataTypes.BOOLEAN,
                    DataTypeManager.DefaultDataTypes.DOUBLE });
        List vm1g3e =
            FakeMetadataFactory.createElements(
                vm1g3,
                new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.INTEGER,
                    DataTypeManager.DefaultDataTypes.BOOLEAN,
                    DataTypeManager.DefaultDataTypes.DOUBLE });
        List vm1g4e =
            FakeMetadataFactory.createElements(
                vm1g4,
                new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.INTEGER,
                    DataTypeManager.DefaultDataTypes.BOOLEAN,
                    DataTypeManager.DefaultDataTypes.DOUBLE });
        List vm1g5e =
            FakeMetadataFactory.createElements(
                vm1g5,
                new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.INTEGER,
                    DataTypeManager.DefaultDataTypes.BOOLEAN,
                    DataTypeManager.DefaultDataTypes.DOUBLE });
        List tm1g1e =
            FakeMetadataFactory.createElements(
                tm1g1,
                new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.INTEGER,
                    DataTypeManager.DefaultDataTypes.BOOLEAN,
                    DataTypeManager.DefaultDataTypes.DOUBLE });

        // Create virtual documents
        // DOC 1
        FakeMetadataObject doc1 =
            FakeMetadataFactory.createVirtualGroup("vm1.doc1", vm1, doc1()); //$NON-NLS-1$
        List docE1 =
            FakeMetadataFactory.createElements(
                doc1,
                new String[] {
                    "a0", //$NON-NLS-1$
                    "a0.a1", //$NON-NLS-1$
                    "a0.a1.a1", //$NON-NLS-1$
                    "a0.a1.b1", //$NON-NLS-1$
                    "a0.a1.c1" }, //$NON-NLS-1$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING });

        // DOC 2
        FakeMetadataObject doc2 =
            FakeMetadataFactory.createVirtualGroup("vm1.doc2", vm1, doc2()); //$NON-NLS-1$
        List docE2 =
            FakeMetadataFactory.createElements(
                doc2,
                new String[] { "a1" }, //$NON-NLS-1$
                new String[] { DataTypeManager.DefaultDataTypes.STRING });

        // DOC 3
        FakeMetadataObject doc3 =
            FakeMetadataFactory.createVirtualGroup("vm1.doc3", vm1, doc3()); //$NON-NLS-1$
        List docE3 =
            FakeMetadataFactory.createElements(
                doc3,
                new String[] {
                    "root", //$NON-NLS-1$
                    "root.n1", //$NON-NLS-1$
                    "root.n1.m1", //$NON-NLS-1$
                    "root.n1.m1.n2", //$NON-NLS-1$
                    "root.n1.m1.n2.leaf1" }, //$NON-NLS-1$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING });

        // DOC 4
        FakeMetadataObject doc4 =
            FakeMetadataFactory.createVirtualGroup("vm1.doc4", vm1, doc4()); //$NON-NLS-1$
        List docE4 =
            FakeMetadataFactory.createElements(
                doc4,
                new String[] {
                    "root", //$NON-NLS-1$
                    "root.n4a", //$NON-NLS-1$
                    "root.n4a.n4b", //$NON-NLS-1$
                    "root.n4a.n4c", //$NON-NLS-1$
                    "root.n4a.fake", //$NON-NLS-1$
                    "root.n4a.n4c.n4d", //$NON-NLS-1$
                    "root.n4a.n4c.n4e", //$NON-NLS-1$
                    "root.n4a.n4c.n4e.n4f" }, //$NON-NLS-1$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING });

        // DOC 5
        FakeMetadataObject doc5 =
            FakeMetadataFactory.createVirtualGroup("vm1.doc5", vm1, doc5()); //$NON-NLS-1$
        List docE5 =
            FakeMetadataFactory.createElements(
                doc5,
                new String[] {
                    "root", //$NON-NLS-1$
                    "root.nodea", //$NON-NLS-1$
                    "root.nodea.nodeb", //$NON-NLS-1$
                    "root.nodea.nodec", //$NON-NLS-1$
                    "root.nodea.nodec.noded", //$NON-NLS-1$
                    "root.nodea.nodec.nodee", //$NON-NLS-1$
                    "root.nodea.nodec.nodee.nodef", //$NON-NLS-1$
                    "root.nodea.nodec.nodee.nodeg", //$NON-NLS-1$
                    "root.nodea.nodec.nodee.nodeg.nodeh", //$NON-NLS-1$
                    "root.nodea.nodec.nodee.nodeg.nodeI", //$NON-NLS-1$
                    "root.nodea.nodec.nodee.nodeg.nodeI.nodeJ" }, //$NON-NLS-1$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING });

        // DOC 6
        FakeMetadataObject doc6 =
            FakeMetadataFactory.createVirtualGroup("vm1.doc6", vm1, doc6()); //$NON-NLS-1$
        List docE6 =
            FakeMetadataFactory.createElements(
                doc6,
                new String[] { "tempGroupTest" }, //$NON-NLS-1$
                new String[] { DataTypeManager.DefaultDataTypes.STRING });

        // DOC with excluded fragment
        FakeMetadataObject docWithExcluded =
            FakeMetadataFactory.createVirtualGroup(
                "vm1.docWithExcluded", //$NON-NLS-1$
                vm1,
                docWithExcluded());
        List docWithExcludedElements =
            FakeMetadataFactory.createElements(
                docWithExcluded,
                new String[] {
                    "root", //$NON-NLS-1$
                    "root.n1", //$NON-NLS-1$
                    "root.n1.m1", //$NON-NLS-1$
                    "root.n1.m1.n2", //$NON-NLS-1$
                    "root.n1.m1.n2.leaf1" }, //$NON-NLS-1$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING });

        // DOC 2 with excluded fragment
        FakeMetadataObject doc2WithExcluded =
            FakeMetadataFactory.createVirtualGroup(
                "vm1.docWithExcluded2", //$NON-NLS-1$
                vm1,
                docWithExcluded2());
        List doc2WithExcludedElements =
            FakeMetadataFactory.createElements(
                doc2WithExcluded,
                new String[] {
                    "root", //$NON-NLS-1$
                    "root.n1", //$NON-NLS-1$
                    "root.n1.m1", //$NON-NLS-1$
                    "root.n1.m2", //$NON-NLS-1$
                    "root.n1.m3" }, //$NON-NLS-1$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING });


        // DOC with attribute
        FakeMetadataObject docWithAttribute =
            FakeMetadataFactory.createVirtualGroup(
                "vm1.docWithAttribute", //$NON-NLS-1$
                vm1,
                docTestConvertCriteriaWithAttribute());
        FakeMetadataObject docWithAttribute3 =
            FakeMetadataFactory.createVirtualGroup(
                "vm1.docWithAttribute3", //$NON-NLS-1$
                vm1,
                docTestCriteriaWithAttribute());
        List docWithAttributeElements =
            FakeMetadataFactory.createElements(
               docWithAttribute,
                new String[] {
                    "root", //$NON-NLS-1$
                    "root.myElement", //$NON-NLS-1$
                    "root.@myAttribute"}, //$NON-NLS-1$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.STRING });
        // DOC with attribute2
        FakeMetadataObject docWithAttribute2 =
            FakeMetadataFactory.createVirtualGroup(
                "vm1.docWithAttribute2", //$NON-NLS-1$
                vm1,
                docTestConvertCriteriaWithAttribute2());
        List docWithAttributeElements2 =
View Full Code Here

    }
   
    private FakeMetadataFacade exampleCase4308(){
       
        // Create models
        FakeMetadataObject pm1 = FakeMetadataFactory.createPhysicalModel("pm1"); //$NON-NLS-1$
        FakeMetadataObject vm1 = FakeMetadataFactory.createVirtualModel("vm1"); //$NON-NLS-1$

        // Create physical groups
        FakeMetadataObject pm1g1 =
            FakeMetadataFactory.createPhysicalGroup("pm1.g1", pm1); //$NON-NLS-1$

        // Create physical elements
        List pm1g1e =
            FakeMetadataFactory.createElements(
                pm1g1,
                new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.INTEGER,
                    DataTypeManager.DefaultDataTypes.BOOLEAN,
                    DataTypeManager.DefaultDataTypes.DOUBLE });


        QueryNode stagingTableNode =
            new QueryNode("SELECT * FROM pm1.g1"); //$NON-NLS-1$ //$NON-NLS-2$
        FakeMetadataObject stagingTable =
            FakeMetadataFactory.createVirtualGroup("tm1.stagingTable2", vm1, stagingTableNode); //$NON-NLS-1$
       
       
        List stagingTableElements =
            FakeMetadataFactory.createElements(
                stagingTable,
                new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                new String[] {
                    DataTypeManager.DefaultDataTypes.STRING,
                    DataTypeManager.DefaultDataTypes.INTEGER,
                    DataTypeManager.DefaultDataTypes.BOOLEAN,
                    DataTypeManager.DefaultDataTypes.DOUBLE });

        MappingDocument doc = new MappingDocument(false);
       
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$
       
        List stagingTables = new ArrayList(1);
        stagingTables.add("tm1.stagingTable2"); //$NON-NLS-1$
        root.setStagingTables(stagingTables);

       
        // Create virtual documents
        // DOC 1
        FakeMetadataObject doc1 =
            FakeMetadataFactory.createVirtualGroup(
                "vm1.doc1", //$NON-NLS-1$
                vm1,
                doc);

View Full Code Here

    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,
View Full Code Here

    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,
View Full Code Here

    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

    private void sampleDataStringTimestamps(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,
View Full Code Here

        caps.setFunctionSupport("rtrim", true); //$NON-NLS-1$
        capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
        capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$

        FakeMetadataFacade metadata = FakeMetadataFactory.example1();
        FakeMetadataObject g1 = metadata.getStore().findObject("pm1.g1", FakeMetadataObject.GROUP); //$NON-NLS-1$
        g1.putProperty(FakeMetadataObject.Props.CARDINALITY, new Integer(RuleChooseDependent.DEFAULT_INDEPENDENT_CARDINALITY + 1000));
        FakeMetadataObject g2 = metadata.getStore().findObject("pm2.g1", FakeMetadataObject.GROUP); //$NON-NLS-1$
        g2.putProperty(FakeMetadataObject.Props.CARDINALITY, new Integer(RuleChooseDependent.DEFAULT_INDEPENDENT_CARDINALITY - 1));
       
        Command command = helpParse(sql);  
        CommandContext context = createCommandContext();
        context.setMetadata(metadata);
        ProcessorPlan plan = helpGetPlan(command, metadata, capFinder,context);
View Full Code Here

TOP

Related Classes of org.teiid.query.unittest.FakeMetadataObject$Props

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.