01: /******************************************************************************
02: * Copyright (C) Lars Ivar Almli. All rights reserved. *
03: * ---------------------------------------------------------------------------*
04: * This file is part of MActor. *
05: * *
06: * MActor is free software; you can redistribute it and/or modify *
07: * it under the terms of the GNU General Public License as published by *
08: * the Free Software Foundation; either version 2 of the License, or *
09: * (at your option) any later version. *
10: * *
11: * MActor is distributed in the hope that it will be useful, *
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14: * GNU General Public License for more details. *
15: * *
16: * You should have received a copy of the GNU General Public License *
17: * along with MActor; if not, write to the Free Software *
18: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
19: ******************************************************************************/package org.mactor.tests;
20:
21: import java.util.LinkedList;
22: import java.util.List;
23: import org.junit.Test;
24: import org.mactor.extensions.xml.XPathTemplateMessageBuilder;
25: import org.mactor.framework.TestContextImpl;
26:
27: public class XPathTemplateMessageBuilderTest {
28: @Test
29: public void testNoNs() throws Exception {
30: TestContextImpl context = new TestContextImpl(null, null);
31: XPathTemplateMessageBuilder b = new XPathTemplateMessageBuilder();
32: List<String> params = new LinkedList<String>();
33: params.add("//MessageId==4");
34: b.buildMessage(context,
35: "tests/mactor_sample_test/templates/order_status.xml",
36: params);
37: }
38:
39: @Test
40: public void testDefNs() throws Exception {
41: TestContextImpl context = new TestContextImpl(null, null);
42: XPathTemplateMessageBuilder b = new XPathTemplateMessageBuilder();
43: List<String> params = new LinkedList<String>();
44: params.add("//def:MessageId==4");
45: b
46: .buildMessage(
47: context,
48: "tests/mactor_sample_test/templates/order_status_def_ns.xml",
49: params);
50: }
51:
52: @Test
53: public void testNs() throws Exception {
54: TestContextImpl context = new TestContextImpl(null, null);
55: XPathTemplateMessageBuilder b = new XPathTemplateMessageBuilder();
56: List<String> params = new LinkedList<String>();
57: params.add("//a:MessageId==4");
58: b
59: .buildMessage(
60: context,
61: "tests/mactor_sample_test/templates/order_status_ns.xml",
62: params);
63: }
64: }
|