001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */package org.apache.cxf.ws.rm;
019:
020: import java.math.BigInteger;
021: import java.util.Collection;
022:
023: import org.apache.cxf.Bus;
024: import org.apache.cxf.bus.spring.SpringBusFactory;
025: import org.apache.cxf.ws.rm.persistence.RMMessage;
026: import org.apache.cxf.ws.rm.persistence.RMStore;
027: import org.junit.Assert;
028: import org.junit.Test;
029:
030: /**
031: *
032: */
033: public class RMManagerConfigurationTest extends Assert {
034:
035: @Test
036: public void testConfiguration() {
037: SpringBusFactory factory = new SpringBusFactory();
038: Bus bus = factory
039: .createBus("org/apache/cxf/ws/rm/custom-rmmanager.xml");
040: RMManager manager = bus.getExtension(RMManager.class);
041: assertNotNull(manager);
042: assertTrue(manager.getSourcePolicy()
043: .getSequenceTerminationPolicy().isTerminateOnShutdown());
044: assertEquals(10000L, manager.getRMAssertion()
045: .getBaseRetransmissionInterval().getMilliseconds()
046: .longValue());
047: assertEquals(10000L, manager.getRMAssertion()
048: .getAcknowledgementInterval().getMilliseconds()
049: .longValue());
050: TestStore store = (TestStore) manager.getStore();
051: assertEquals("here", store.getLocation());
052:
053: }
054:
055: static class TestStore implements RMStore {
056:
057: private String location;
058:
059: public TestStore() {
060: // this(null);
061: }
062:
063: /*
064: public TestStore(String l) {
065: location = l;
066: }
067: */
068:
069: public String getLocation() {
070: return location;
071: }
072:
073: public void setLocation(String location) {
074: this .location = location;
075: }
076:
077: public void createDestinationSequence(DestinationSequence seq) {
078: // TODO Auto-generated method stub
079:
080: }
081:
082: public void createSourceSequence(SourceSequence seq) {
083: // TODO Auto-generated method stub
084:
085: }
086:
087: public Collection<DestinationSequence> getDestinationSequences(
088: String endpointIdentifier) {
089: // TODO Auto-generated method stub
090: return null;
091: }
092:
093: public Collection<RMMessage> getMessages(Identifier sid,
094: boolean outbound) {
095: // TODO Auto-generated method stub
096: return null;
097: }
098:
099: public Collection<SourceSequence> getSourceSequences(
100: String endpointIdentifier) {
101: // TODO Auto-generated method stub
102: return null;
103: }
104:
105: public void persistIncoming(DestinationSequence seq,
106: RMMessage msg) {
107: // TODO Auto-generated method stub
108:
109: }
110:
111: public void persistOutgoing(SourceSequence seq, RMMessage msg) {
112: // TODO Auto-generated method stub
113:
114: }
115:
116: public void removeDestinationSequence(Identifier seq) {
117: // TODO Auto-generated method stub
118:
119: }
120:
121: public void removeMessages(Identifier sid,
122: Collection<BigInteger> messageNrs, boolean outbound) {
123: // TODO Auto-generated method stub
124:
125: }
126:
127: public void removeSourceSequence(Identifier seq) {
128: // TODO Auto-generated method stub
129:
130: }
131:
132: }
133: }
|