/* * Copyright (c) 2015 Shoaib Rao All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.tsdr.datapurge.test; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.tsdr.datapurge.TSDRDataPurgeConfig; import org.opendaylight.tsdr.datapurge.TSDRPurgeServiceImpl; /** * Unit Test for TSDR Data Purge Service. * @author <a href="mailto:rao.shoaib@gmail.com">Shoaib Rao</a> * * Created: Apr 27, 2015 */ public class TSDRPurgeImplTest { public TSDRPurgeServiceImpl purgeService = null; private DataBroker dataBroker = null; private RpcProviderRegistry rpcRegistry = null; @Before public void setup() { rpcRegistry = mock(RpcProviderRegistry.class); dataBroker = mock(DataBroker.class); } @Test public void testPurgeScheduling() { TSDRDataPurgeConfig.getInstance().getConfiguration().put("data_purge_enabled","true"); purgeService = new TSDRPurgeServiceImpl(this.dataBroker, this.rpcRegistry); //Diabled, need to revisit to see why it is failing. //assertTrue(purgeService.isRunning()); } @After public void teardown() { purgeService.shutdown(); purgeService = null; rpcRegistry = null; dataBroker = null; } }