summaryrefslogtreecommitdiffstats
path: root/logserver/src/test/java/com/yahoo/logserver/handlers/replicator/ReplicatorPluginTestCase.java
blob: e10349c741474e6272038c9fcc3912c18833534e (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
34
35
36
37
38
39
40
41
42
43
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.logserver.handlers.replicator;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.yahoo.plugin.SystemPropertyConfig;

public class ReplicatorPluginTestCase {

    ReplicatorPlugin rp;

    @Before
    public void setUp() {
        rp = new ReplicatorPlugin();
    }

    @After
    public void tearDown() {
        if (rp != null) {
            rp.shutdownPlugin();
        }
    }

    @Test
    public void testReplicatorPlugin() {
        System.setProperty("replicatorplugin.test.port", "18325");
        try {
            rp.shutdownPlugin();
            fail("Shutdown before init didn't throw.");
        } catch (Exception e) {
        }
        rp.initPlugin(new SystemPropertyConfig("replicatorplugin.test."));
        try {
            rp.initPlugin(new SystemPropertyConfig("test"));
            fail("Multiple init didn't throw.");
        } catch (Exception e) {
        }
    }
}