Package com.mobixess.jodb.core

Examples of com.mobixess.jodb.core.IPersistentObjectStatistics


        }
        String stringFromDB = (String) classes.get(0);
        if(!stringFromDB.equals(testString)){
            throw new RuntimeException();
        }
        IPersistentObjectStatistics statistics = sessionContainer.getPersistenceStatistics(stringFromDB);
        if(statistics.getTotalRecords()!=1){
            throw new RuntimeException();
        }
       
        sessionContainer.set(stringFromDB);
       
        sessionContainer.commit();
       
        classes = sessionContainer.getAllObjects();
        if(classes.size()!=1){
            throw new RuntimeException();
        }
        stringFromDB = (String) classes.get(0);
        if(!stringFromDB.equals(testString)){
            throw new RuntimeException();
        }
        statistics = sessionContainer.getPersistenceStatistics(stringFromDB);
        if(statistics.getTotalRecords()!=1){
            throw new RuntimeException();
        }
        sessionContainer.close();
    }
View Full Code Here


            DynamicTestClass dynamicTestClass = new DynamicTestClass(className,i);
            Object obj = dynamicTestClass.load(sessionContainer);
            classLoaderForShortLengthObject = dynamicTestClass._classLoader;
            sessionContainer.set(obj);
            sessionContainer.commit();
            IPersistentObjectStatistics objectStatistics = sessionContainer.getPersistenceStatistics(obj);
            dynamicTestClass.delete();
            long size = objectStatistics.getBodySize();
            if(size >= 0xFF){
                break;
            }
        }
        sessionContainer.close();
       
        testFile = new File(testFileDir,SimpleAddTest.class.getSimpleName()+(_testCounter++)+".jdb");
       
        testFile.delete();
       
        sessionContainer = getContainerForFile(testFile);
       
        DynamicTestClass byteLengthDynamicTestClass = new DynamicTestClass(className,i-1);
        Object obj = byteLengthDynamicTestClass.load(sessionContainer);
        sessionContainer.set(obj);
        sessionContainer.close();
       
        sessionContainer = getContainerForFile(testFile);
        sessionContainer.setClassLoader(classLoaderForShortLengthObject);
       
        List list = sessionContainer.getAllObjects();
        obj = list.get(0);
        sessionContainer.set(obj);
        sessionContainer.close();
       
        sessionContainer = getContainerForFile(testFile);
        sessionContainer.setClassLoader(classLoaderForShortLengthObject);
        list = sessionContainer.getAllObjects();
        obj = list.get(0);
        IPersistentObjectStatistics objectStatistics = sessionContainer.getPersistenceStatistics(obj);
        if(objectStatistics.getTotalRecords() != 1){
            throw new RuntimeException();
        }
        modify(obj);
        sessionContainer.set(obj);
        sessionContainer.close();
       
        sessionContainer = getContainerForFile(testFile);
        sessionContainer.setClassLoader(classLoaderForShortLengthObject);
        list = sessionContainer.getAllObjects();
        obj = list.get(0);
        objectStatistics = sessionContainer.getPersistenceStatistics(obj);
        if(objectStatistics.getTotalRecords() != 2){
            throw new RuntimeException();
        }
        sessionContainer.close();
       
        sessionContainer = getContainerForFile(testFile);
        sessionContainer.setClassLoader(byteLengthDynamicTestClass._classLoader);
        list = sessionContainer.getAllObjects();
        obj = list.get(0);
        modify(obj);
        sessionContainer.set(obj);
        sessionContainer.close();
       
        sessionContainer = getContainerForFile(testFile);
        sessionContainer.setClassLoader(classLoaderForShortLengthObject);
        list = sessionContainer.getAllObjects();
        obj = list.get(0);
        objectStatistics = sessionContainer.getPersistenceStatistics(obj);
        if(objectStatistics.getTotalRecords() != 1){
            throw new RuntimeException(""+objectStatistics.getTotalRecords());
        }
        sessionContainer.close();
        byteLengthDynamicTestClass.delete();
        sessionContainer.close();
    }
View Full Code Here

TOP

Related Classes of com.mobixess.jodb.core.IPersistentObjectStatistics

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.