01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.apache.cxf.transport.jms;
19:
20: import java.util.Properties;
21:
22: import javax.naming.Context;
23:
24: import org.junit.Assert;
25: import org.junit.Test;
26:
27: public class JMSUtilsTest extends Assert {
28:
29: // This is just a place holder for now it will be chaning in next task
30: // when the new JMS address policies and configurations are introdced.
31: @Test
32: public void testpopulateIncomingContextNonNull() throws Exception {
33: AddressType addrType = new AddressType();
34:
35: JMSNamingPropertyType prop = new JMSNamingPropertyType();
36: prop.setName(Context.APPLET);
37: prop.setValue("testValue");
38: addrType.getJMSNamingProperty().add(prop);
39:
40: prop.setName(Context.BATCHSIZE);
41: prop.setValue("12");
42: addrType.getJMSNamingProperty().add(prop);
43:
44: Properties env = new Properties();
45: assertTrue(env.size() <= 0);
46: JMSUtils.populateContextEnvironment(addrType, env);
47: assertTrue("Environment should not be empty", env.size() > 0);
48: assertTrue(
49: "Environemnt should contain NamingBatchSize property",
50: env.get(Context.BATCHSIZE) != null);
51: }
52:
53: }
|