// ========================================================================
// Copyright 2007-2008 NEXCOM Systems
// ------------------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at 
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ========================================================================

package org.cipango.dar;

import javax.servlet.sip.ar.SipApplicationRoutingRegion;

import junit.framework.TestCase;

public class DARConfigurationTest extends TestCase
{
	public void testConfig() throws Exception
	{
		DARConfiguration config = new DARConfiguration(getClass().getResource("/org/cipango/dar/dar.properties"));
		DefaultApplicationRouter dar = new DefaultApplicationRouter();
		
		config.configure(dar);
		
		RouterInfo[] infos = dar.getRouterInfos().get("REGISTER");
		assertNull(infos);
		
		infos = dar.getRouterInfos().get("INVITE");
		assertNotNull(infos);
		assertEquals(2, infos.length);
		
		assertEquals("OriginatingCallWaiting", infos[0].getName());
		assertEquals("CallForwarding", infos[1].getName());
		
		assertEquals("DAR:From", infos[0].getIdentity());
		assertEquals("DAR:To", infos[1].getIdentity());
	
		infos = dar.getRouterInfos().get("MESSAGE");
		assertNotNull(infos);
		assertEquals(1, infos.length);
		assertEquals("IM", infos[0].getName());
		assertEquals(SipApplicationRoutingRegion.TERMINATING_REGION, infos[0].getRegion());
	}
}

@@ -93,10 +93,10 @@
 7-20
-08
+11
  NEX
@@ -830,16 +830,168 @@
 ngo.dar;
+%0Aimport static junit.framework.Assert.assertEquals;%0Aimport static junit.framework.Assert.assertNotNull;%0Aimport static junit.framework.Assert.assertNull;
 %0A%0Aimport
@@ -1053,32 +1053,22 @@
 ort 
+org.
 junit.
-framework.TestCase
+Test
 ;%0A%0Ap
@@ -1103,27 +1103,17 @@
 Test
- extends TestCase%0A%7B
+%0A%7B%0A%09@Test
 %0A%09pu

Use JUnit 4