Package org.apache.ace.repository

Examples of org.apache.ace.repository.Repository


        return range;
    }

    @Override
    protected boolean doCommit(ServiceReference ref, long version, InputStream data) throws IllegalArgumentException, IOException {
        Repository r = (Repository) m_context.getService(ref);
        boolean result = r.commit(data, version);
        m_context.ungetService(ref);
        return result;
    }
View Full Code Here


        return result;
    }

    @Override
    protected InputStream doCheckout(ServiceReference ref, long version) throws IllegalArgumentException, IOException {
        Repository r = (Repository) m_context.getService(ref);
        InputStream result = r.checkout(version);
        m_context.ungetService(ref);
        return result;
    }
View Full Code Here

     * we make the cached repository do a checkout, and check whether all data arrives at the
     * right places: in getLocal, and in the backup repository.
     */
    @Test( groups = { TestUtils.UNIT } )
    public void testInitialCheckout() throws IllegalArgumentException, IOException {
        Repository m_repository = new MockRepository();
        byte[] testContent = new byte[] {'i', 'n', 'i', 't', 'i', 'a', 'l'};
        m_repository.commit(new ByteArrayInputStream(testContent), 0);
        BackupRepository m_backupRepository = new MockBackupRepository();

        CachedRepository m_cachedRepository = new CachedRepositoryImpl(null, m_repository, m_backupRepository, 0);

        InputStream input = m_cachedRepository.checkout(1);
View Full Code Here

     * After each commit, we should be able to renew the cached repository,
     * and checkout the data we put in before.
     */
    @Test( groups = { TestUtils.UNIT } )
    public void testCommit() throws IllegalArgumentException, IOException {
        Repository m_repository = new MockRepository();
        BackupRepository m_backupRepository = new MockBackupRepository();

        CachedRepository m_cachedRepository = new CachedRepositoryImpl(null, m_repository, m_backupRepository, 0);
        byte[] testContent = new byte[] {'i', 'n', 'i', 't', 'i', 'a', 'l'};

View Full Code Here

     * @throws IOException
     * @throws IllegalArgumentException
     */
    @Test( groups = { TestUtils.UNIT } )
    public void testRevert() throws IllegalArgumentException, IOException {
        Repository m_repository = new MockRepository();
        BackupRepository m_backupRepository = new MockBackupRepository();

        CachedRepository m_cachedRepository = new CachedRepositoryImpl(null, m_repository, m_backupRepository, 0);
        byte[] testContent = new byte[] {'i', 'n', 'i', 't', 'i', 'a', 'l'};

View Full Code Here

     * @return The newly created repository set.
     * @throws IOException
     */
    @SuppressWarnings("unchecked")
    public RepositorySet loadRepositorySet(User user, RepositorySetDescriptor rsd, ObjectRepositoryImpl[] repos) throws IOException {
        Repository repo = new RemoteRepository(rsd.m_location, rsd.m_customer, rsd.m_name);
        Preferences prefs = m_preferences.getUserPreferences(user.getName());
        Preferences repoPrefs = getRepositoryPrefs(prefs, rsd.m_location, rsd.m_customer, rsd.m_name);
        return new RepositorySet(m_changeNotifier, m_log, user, repoPrefs, repos, getCachedRepositoryFromPreferences(user, repo, repoPrefs), rsd.m_name, rsd.m_writeAccess);
    }
View Full Code Here

TOP

Related Classes of org.apache.ace.repository.Repository

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.