aboutsummaryrefslogtreecommitdiffstats
path: root/dummy-persistence/src/test/java/com/yahoo/persistence/dummy/DummyPersistenceTest.java
blob: edd1dc12d8b860b2658d20326bcb87f4ac1169c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.persistence.dummy;

import com.yahoo.document.DocumentTypeManager;
import com.yahoo.persistence.PersistenceRpcConfig;
import com.yahoo.persistence.rpc.PersistenceProviderHandler;
import com.yahoo.persistence.spi.PersistenceProvider;
import com.yahoo.persistence.spi.conformance.ConformanceTest;

public class DummyPersistenceTest extends ConformanceTest {

    class DummyPersistenceFactory implements PersistenceProviderFactory {

        @Override
        public PersistenceProvider createProvider(DocumentTypeManager manager) {
            return new DummyPersistenceProvider();
        }

        @Override
        public boolean supportsActiveState() {
            return true;
        }
    }

    public void testConstruct() {
        DummyPersistenceProviderHandler provider = new DummyPersistenceProviderHandler(
                new PersistenceProviderHandler(new PersistenceRpcConfig(new PersistenceRpcConfig.Builder())), null);
    }

    public void testConformance() throws Exception {
        doConformanceTest(new DummyPersistenceFactory());
    }
}