Package org.modeshape.jcr.value.binary

Examples of org.modeshape.jcr.value.binary.FileSystemBinaryStore


        // restart
        startRunStop(new RepositoryOperation() {
            @Override
            public Void call() throws Exception {
                changeLastUpgradeId(repository, Upgrades.ModeShape_4_0_0_Beta3.INSTANCE.getId() - 1);
                FileSystemBinaryStore binaryStore = (FileSystemBinaryStore)repository.runningState().binaryStore();
                assertFalse("No used binaries expected", binaryStore.getAllBinaryKeys().iterator().hasNext());
                assertFalse("The binary should not be found", binaryStore.hasBinary(binaryKey));
                File mainStorageDirectory = binaryStore.getDirectory();
                File[] files = mainStorageDirectory.listFiles();
                assertEquals("Just the trash directory was expected", 1, files.length);
                File trash = files[0];
                assertTrue(trash.isDirectory());
                return null;
            }
        }, config);

        // run the repo a second time, which should run the upgrade
        startRunStop(new RepositoryOperation() {
            @Override
            public Void call() throws Exception {
                FileSystemBinaryStore binaryStore = (FileSystemBinaryStore)repository.runningState().binaryStore();
                assertFalse("No used binaries expected", binaryStore.getAllBinaryKeys().iterator().hasNext());
                assertTrue("The binary should be found", binaryStore.hasBinary(binaryKey));
                return null;
            }
        }, config);
    }
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.value.binary.FileSystemBinaryStore

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.