awips2/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/WfoBandwidthManagerIntTest.java
Dustin Johnson 79e77cdf45 Issue #2038 Fix deleting of multiple subscription types
Update test Spring configurations

Change-Id: I63a6d12b03768223a86c1a309bc438758bb61f2e

Former-commit-id: 63ccc2c133 [formerly 21b8f03b1f] [formerly d2d50e7d8b] [formerly 63ccc2c133 [formerly 21b8f03b1f] [formerly d2d50e7d8b] [formerly ecf3f2e300 [formerly d2d50e7d8b [formerly a862a4d1b9b34b3f93e54480b9fc482a234db918]]]]
Former-commit-id: ecf3f2e300
Former-commit-id: efd95f253e [formerly d467832855] [formerly 1540347e93b929ac41c7a779cb0a5461b2ed43ed [formerly 151df64a6e]]
Former-commit-id: 28364827cdbe6dc84528a852dec840509418fd01 [formerly 94c4247617]
Former-commit-id: 1047ef53b3
2013-05-29 15:54:06 -05:00

107 lines
3.6 KiB
Java

/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.datadelivery.bandwidth;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertThat;
import java.util.List;
import org.junit.Test;
import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest;
import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest.RequestType;
import com.raytheon.uf.common.datadelivery.registry.Network;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.edex.datadelivery.bandwidth.dao.SubscriptionRetrieval;
import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalStatus;
/**
* Test a WFO {@link BandwidthManager}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 19, 2013 1543 djohnson Initial creation
*
* </pre>
*
* @author djohnson
* @version 1.0
*/
public class WfoBandwidthManagerIntTest extends
AbstractWfoBandwidthManagerIntTest {
@Test
public void testSchedulesSbnSubscriptionForRetrieval() {
Subscription subscription = createSubscriptionThatFillsAThirdOfABucket();
subscription.setRoute(Network.SBN);
bandwidthManager.schedule(subscription);
final List<SubscriptionRetrieval> subRetrievals = bandwidthDao
.getSubscriptionRetrievals(subscription.getProvider(),
subscription.getDataSetName());
assertThat(subRetrievals, is(not(empty())));
for (SubscriptionRetrieval subRetrieval : subRetrievals) {
assertThat(subRetrieval.getStatus(), is(RetrievalStatus.SCHEDULED));
}
}
@Test
public void testSchedulesOpsnetSubscriptionForRetrieval() {
Subscription subscription = createSubscriptionThatFillsAThirdOfABucket();
bandwidthManager.schedule(subscription);
final List<SubscriptionRetrieval> subRetrievals = bandwidthDao
.getSubscriptionRetrievals(subscription.getProvider(),
subscription.getDataSetName());
assertThat(subRetrievals, is(not(empty())));
for (SubscriptionRetrieval subRetrieval : subRetrievals) {
assertThat(subRetrieval.getStatus(), is(RetrievalStatus.SCHEDULED));
}
}
@Test
public void testReinitializeUsesCorrectSpringFiles() throws Exception {
final IBandwidthRequest request = new IBandwidthRequest();
request.setRequestType(RequestType.REINITIALIZE);
bandwidthManager.handleRequest(request);
verifyRetrievalPlanExistsForRoute(Network.OPSNET);
}
/**
* {@inheritDoc}
*/
@Override
protected Network getRouteToUseForSubscription() {
return Network.OPSNET;
}
}