Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 2f82e91d0972793a178a797d0632e3216cf54b2a (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*******************************************************************************
 * Copyright (c) 2010, 2018 IBM Corporation.
 * 
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *    IBM Corporation - initial API and implementation
 *******************************************************************************/

package org.eclipse.linuxtools.systemtap.graphing.core.tests.structures;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.eclipse.linuxtools.systemtap.structures.UpdateManager;
import org.eclipse.linuxtools.systemtap.structures.listeners.IUpdateListener;
import org.junit.Before;
import org.junit.Test;

public class UpdateManagerTest {
    @Before
    public void setUp() {
        manager = new UpdateManager(5);
    }
    @Test
    public void testStop() {
        assertTrue(manager.isRunning());
        manager.stop();
        assertFalse(manager.isRunning());
    }
    @Test
    public void testAddUpdateListener() {
        manager.addUpdateListener(listener);
    }
    @Test
    public void testRemoveUpdateListener() {
        manager.addUpdateListener(listener);
        manager.removeUpdateListener(listener);
    }
    @Test
    public void testIsRunning() {
        assertTrue(manager.isRunning());
        manager.stop();
        assertFalse(manager.isRunning());
    }
    @Test
    public void testDispose() {
        manager.dispose();
        assertFalse(manager.isRunning());
    }

    private UpdateManager manager;
    private IUpdateListener listener = () -> {
	    //Do nothing;
	};
}

Back to the top