PageRenderTime 59ms CodeModel.GetById 48ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/protocols/ss7/m3ua/impl/src/test/java/org/mobicents/protocols/ss7/m3ua/impl/as/ClientM3UAManagementTest.java

http://mobicents.googlecode.com/
Java | 94 lines | 46 code | 17 blank | 31 comment | 0 complexity | 9e8fe947d2d05e2c01ad840eabd569b5 MD5 | raw file
 1/*
 2 * JBoss, Home of Professional Open Source
 3 * Copyright 2011, Red Hat, Inc. and individual contributors
 4 * by the @authors tag. See the copyright.txt in the distribution for a
 5 * full listing of individual contributors.
 6 *
 7 * This is free software; you can redistribute it and/or modify it
 8 * under the terms of the GNU Lesser General Public License as
 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */
22
23package org.mobicents.protocols.ss7.m3ua.impl.as;
24
25import static org.junit.Assert.assertEquals;
26
27import java.io.IOException;
28
29import org.junit.After;
30import org.junit.AfterClass;
31import org.junit.Before;
32import org.junit.BeforeClass;
33import org.junit.Test;
34import org.mobicents.protocols.ss7.m3ua.impl.As;
35import org.mobicents.protocols.ss7.m3ua.impl.AspFactory;
36
37/**
38 * Test the serialization/de-serialization
39 * 
40 * @author amit bhayani
41 * 
42 */
43public class ClientM3UAManagementTest {
44
45	private ClientM3UAManagement clientM3UAMgmt = new ClientM3UAManagement();
46
47	/**
48	 * 
49	 */
50	public ClientM3UAManagementTest() {
51		// TODO Auto-generated constructor stub
52	}
53
54	@BeforeClass
55	public static void setUpClass() throws Exception {
56	}
57
58	@AfterClass
59	public static void tearDownClass() throws Exception {
60	}
61
62	@Before
63	public void setUp() throws Exception {
64		clientM3UAMgmt.start();
65	}
66
67	@After
68	public void tearDown() throws IOException {
69		clientM3UAMgmt.getAppServers().clear();
70		clientM3UAMgmt.getAspfactories().clear();
71		clientM3UAMgmt.getDpcVsAsName().clear();
72		clientM3UAMgmt.stop();
73	}
74
75	@Test
76	public void testSerialization() throws Exception {
77		As as = clientM3UAMgmt.createAppServer("m3ua as create rc 100 AS1".split(" "));
78		AspFactory aspFactory = clientM3UAMgmt
79				.createAspFactory("m3ua asp create ip 127.0.0.1 port 1111 remip 127.0.0.1 remport 1112 ASP1".split(" "));
80		clientM3UAMgmt.assignAspToAs("AS1", "ASP1");
81
82		clientM3UAMgmt.addRouteAsForDpc(123, "AS1");
83
84		clientM3UAMgmt.stop();
85
86		ClientM3UAManagement clientM3UAMgmt1 = new ClientM3UAManagement();
87		clientM3UAMgmt1.start();
88
89		assertEquals(1, clientM3UAMgmt1.getAppServers().size());
90		assertEquals(1, clientM3UAMgmt1.getAspfactories().size());
91		assertEquals(1, clientM3UAMgmt1.getDpcVsAsName().size());
92
93	}
94}