Package com.mobixess.jodb.tests.testobjects

Examples of com.mobixess.jodb.tests.testobjects.Pilot


        testFile.delete();
        JODBSessionContainer sessionContainer = getContainerForFile(testFile);
        Random random = new Random(19287);
        for (int i = 0; i < 1000; i++) {
            int next = random.nextInt(1000);
            Pilot pilot = new Pilot(next, "Name"+i);
            sessionContainer.set(pilot);
        }
       
        sessionContainer.commit();
       
        if(reopen){
            sessionContainer.close();
            sessionContainer = getContainerForFile(testFile);
        }
       
        Predicate<Pilot> predicate= new Predicate<Pilot>() {
            public boolean match(Pilot pilot) {
                return pilot.getPoints() > 100 && pilot.getPoints() < 500 && pilot.getName().startsWith("Nam");
            }
        };
       
        if(_checkOptimization && !sessionContainer.isOptimizedQuery(predicate, null)){
            throw new RuntimeException();
        }
       
        ObjectSet<Pilot> pilots = sessionContainer.query(predicate);
       
        if(pilots.size() == 0){
            throw new RuntimeException();
        }
       
        while (pilots.hasNext()) {
            if(pilots.next().getPoints()<=100){
                throw new RuntimeException();
            }
        }
        if(reopen){
            sessionContainer.close();
            sessionContainer = getContainerForFile(testFile);
        }
       
        predicate= new Predicate<Pilot>() {
            public boolean match(Pilot pilot) {
                return pilot.getPoints() > 100 && pilot.getPoints() < 500 && pilot._name.startsWith("Nam");
            }
        };
       
        if(_checkOptimization && !sessionContainer.isOptimizedQuery(predicate, null)){
            throw new RuntimeException();
View Full Code Here

TOP

Related Classes of com.mobixess.jodb.tests.testobjects.Pilot

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.