Revision: 15692
Author: brainslog
Date: Thu Dec  9 10:49:50 2010
Log: Testsuite for Diameter Stack Lifecycle

Fixes Issue 2199
http://code.google.com/p/mobicents/source/detail?r=15692

Added:
/trunk/servers/diameter/testsuite/tests/src/test/java/org/mobicents/diameter/stack/TestStackLifecycle.java
 /trunk/servers/diameter/testsuite/tests/src/test/resources/configurations
/trunk/servers/diameter/testsuite/tests/src/test/resources/configurations/jdiameter-client-one.xml /trunk/servers/diameter/testsuite/tests/src/test/resources/configurations/jdiameter-client-two.xml /trunk/servers/diameter/testsuite/tests/src/test/resources/configurations/jdiameter-server-one.xml /trunk/servers/diameter/testsuite/tests/src/test/resources/configurations/jdiameter-server-two.xml

=======================================
--- /dev/null
+++ /trunk/servers/diameter/testsuite/tests/src/test/java/org/mobicents/diameter/stack/TestStackLifecycle.java Thu Dec 9 10:49:50 2010
@@ -0,0 +1,467 @@
+package org.mobicents.diameter.stack;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+import java.util.concurrent.TimeUnit;
+
+import junit.framework.Assert;
+
+import org.jdiameter.api.*;
+import org.jdiameter.client.api.StackState;
+import org.jdiameter.server.impl.StackImpl;
+import org.junit.Test;
+
+public class TestStackLifecycle {
+
+  // Stack Lifecycle
+  // +------+           +------------+            +---------+
+  // | Idle | = init => | Configured | = start => | Started |
+  // +------+           +------------+            +---------+
+  //   /\ /\                  ||                    ||   /\
+  //   || ||                  ||                   stop  ||
+  //   || ++==== destroy =====++                    ||   ||
+  //   ||                +---------+ <==============++   ||
+  //   ++== destroy ==== | Stopped |                     ||
+  //                     +---------+ === start ==========++
+
+  @Test
+  public void testStartWithoutInit() {
+    StackImpl stack = new StackImpl();
+
+    try {
+      stack.start();
+
+ fail("Should have failed calling start() when stack is in state IDLE");
+    }
+    catch (IllegalDiameterStateException idse) {
+      // We are OK. This is what was expected.
+    }
+    catch (Exception e) {
+ fail("Expected different exception (IllegalDiameterStateException), got " + e.getClass().getName());
+    }
+    finally {
+      shutdownStack(stack);
+    }
+  }
+
+  @Test
+  public void testDoubleInit() {
+    StackImpl stack = new StackImpl();
+
+    try {
+      InputStream is;
+      String configFile = "jdiameter-server-one.xml";
+
+ is = TestStackLifecycle.class.getClassLoader().getResourceAsStream("configurations/" + configFile); + Assert.assertNotNull("InputStream for configuration file should not be null", is);
+
+      Configuration config;
+      config = new org.jdiameter.server.impl.helpers.XMLConfiguration(is);
+      stack.init(config);
+
+      // We should fail here, it's already initialized
+      stack.init(config);
+
+ fail("Should have failed calling init() when stack is in state CONFIGURED");
+    }
+    catch (IllegalDiameterStateException idse) {
+      // We are OK. This is what was expected.
+    }
+    catch (Exception e) {
+ fail("Expected different exception (IllegalDiameterStateException), got " + e.getClass().getName());
+    }
+    finally {
+      shutdownStack(stack);
+    }
+  }
+
+  @Test
+  public void testInitDestroyInit() {
+    StackImpl stack = new StackImpl();
+
+    try {
+      InputStream is;
+      String configFile = "jdiameter-server-one.xml";
+
+ is = TestStackLifecycle.class.getClassLoader().getResourceAsStream("configurations/" + configFile); + Assert.assertNotNull("InputStream for configuration file should not be null", is);
+
+      Configuration config;
+      config = new org.jdiameter.server.impl.helpers.XMLConfiguration(is);
+      stack.init(config);
+
+      stack.destroy();
+
+      stack.init(config);
+    }
+    catch (Exception e) {
+      e.printStackTrace();
+ fail("Should have been successful switching states IDLE -> CONFIGURED -> IDLE -> CONFIGURED. Failed with: " + e.getMessage());
+    }
+    finally {
+      shutdownStack(stack);
+    }
+  }
+
+  @Test
+  public void testStopWithoutInit() {
+    StackImpl stack = new StackImpl();
+
+    try {
+      stack.stop();
+    }
+    catch (Exception e) {
+      e.printStackTrace();
+ fail("Should have been successful calling stop() with stack in IDLE state. Failed with: " + e.getMessage());
+    }
+    finally {
+      shutdownStack(stack);
+    }
+  }
+
+  @Test
+  public void testDestroyWithoutInit() {
+    StackImpl stack = new StackImpl();
+
+    try {
+      stack.destroy();
+    }
+    catch (Exception e) {
+      e.printStackTrace();
+ fail("Should have been successful calling destroy() with stack in IDLE state. Failed with: " + e.getMessage());
+    }
+    finally {
+      shutdownStack(stack);
+    }
+  }
+
+  @Test
+  public void testStopWithoutStart() {
+    StackImpl stack = new StackImpl();
+
+    try {
+      InputStream is;
+      String configFile = "jdiameter-server-one.xml";
+
+ is = TestStackLifecycle.class.getClassLoader().getResourceAsStream("configurations/" + configFile); + Assert.assertNotNull("InputStream for configuration file should not be null", is);
+
+      Configuration config;
+      config = new org.jdiameter.server.impl.helpers.XMLConfiguration(is);
+      stack.init(config);
+
+      stack.stop();
+    }
+    catch (Exception e) {
+      e.printStackTrace();
+ fail("Should have been successful calling stop() with stack in CONFIGURED state. Failed with: " + e.getMessage());
+    }
+    finally {
+      shutdownStack(stack);
+    }
+  }
+
+  @Test
+  public void testDestroyWithoutStop() {
+    StackImpl stack = new StackImpl();
+
+    try {
+      InputStream is;
+      String configFile = "jdiameter-server-one.xml";
+
+ is = TestStackLifecycle.class.getClassLoader().getResourceAsStream("configurations/" + configFile); + Assert.assertNotNull("InputStream for configuration file should not be null", is);
+
+      Configuration config;
+      config = new org.jdiameter.server.impl.helpers.XMLConfiguration(is);
+      stack.init(config);
+
+      stack.start();
+
+      stack.destroy();
+    }
+    catch (Exception e) {
+      e.printStackTrace();
+ fail("Should have been successful calling destroy() with stack in STARTED state. Failed with: " + e.getMessage());
+    }
+    finally {
+      shutdownStack(stack);
+    }
+  }
+
+  @Test
+  public void testInitAfterStart() {
+    StackImpl stack = new StackImpl();
+
+    try {
+      InputStream is;
+      String configFile = "jdiameter-server-one.xml";
+
+ is = TestStackLifecycle.class.getClassLoader().getResourceAsStream("configurations/" + configFile); + Assert.assertNotNull("InputStream for configuration file should not be null", is);
+
+      Configuration config;
+      config = new org.jdiameter.server.impl.helpers.XMLConfiguration(is);
+      stack.init(config);
+
+      stack.start();
+
+      stack.init(config);
+
+ fail("Should have failed calling init() with stack in STARTED state.");
+    }
+    catch (IllegalDiameterStateException idse) {
+      // We are OK. This is what was expected.
+    }
+    catch (Exception e) {
+      e.printStackTrace();
+ fail("Expected different exception (IllegalDiameterStateException), got " + e.getClass().getName());
+    }
+    finally {
+      shutdownStack(stack);
+    }
+  }
+
+  @Test
+  public void testDoubleStart() {
+    StackImpl stack = new StackImpl();
+
+    try {
+      InputStream is;
+      String configFile = "jdiameter-server-one.xml";
+
+ is = TestStackLifecycle.class.getClassLoader().getResourceAsStream("configurations/" + configFile); + Assert.assertNotNull("InputStream for configuration file should not be null", is);
+
+      Configuration config;
+      config = new org.jdiameter.server.impl.helpers.XMLConfiguration(is);
+      stack.init(config);
+
+      stack.start();
+
+      // We should fail here, it's already started
+      stack.start();
+
+ fail("Should have failed calling start() when stack is in STARTED state.");
+    }
+    catch (IllegalDiameterStateException idse) {
+      // We are OK. This is what was expected.
+    }
+    catch (Exception e) {
+ fail("Expected different exception (IllegalDiameterStateException), got " + e.getClass().getName());
+    }
+    finally {
+      shutdownStack(stack);
+    }
+  }
+
+  @Test
+  public void testInitWhenStopped() {
+    StackImpl stack = new StackImpl();
+
+    try {
+      InputStream is;
+      String configFile = "jdiameter-server-one.xml";
+
+ is = TestStackLifecycle.class.getClassLoader().getResourceAsStream("configurations/" + configFile); + Assert.assertNotNull("InputStream for configuration file should not be null", is);
+
+      Configuration config;
+      config = new org.jdiameter.server.impl.helpers.XMLConfiguration(is);
+      stack.init(config);
+
+      stack.start();
+
+      stack.stop();
+
+      // We should fail here, it's already configured, just stopped
+      stack.init(config);
+
+ fail("Should have failed calling init() when stack is in STOPPED state.");
+    }
+    catch (IllegalDiameterStateException idse) {
+      // We are OK. This is what was expected.
+    }
+    catch (Exception e) {
+ fail("Expected different exception (IllegalDiameterStateException), got " + e.getClass().getName());
+    }
+    finally {
+      shutdownStack(stack);
+    }
+  }
+
+  @Test
+  public void testDoubleStop() {
+    StackImpl stack = new StackImpl();
+
+    try {
+      InputStream is;
+      String configFile = "jdiameter-server-one.xml";
+
+ is = TestStackLifecycle.class.getClassLoader().getResourceAsStream("configurations/" + configFile); + Assert.assertNotNull("InputStream for configuration file should not be null", is);
+
+      Configuration config;
+      config = new org.jdiameter.server.impl.helpers.XMLConfiguration(is);
+      stack.init(config);
+
+      stack.start();
+
+      stack.stop();
+
+      // We should fail here, it's already configured, just stopped
+      stack.stop();
+    }
+    catch (Exception e) {
+ fail("Should have been successful calling stop() with stack in STOPPED state. Failed with: " + e.getMessage());
+    }
+    finally {
+      shutdownStack(stack);
+    }
+  }
+
+  @Test
+  public void testStartStopStart() {
+    StackImpl stack = new StackImpl();
+
+    try {
+      InputStream is;
+      String configFile = "jdiameter-server-one.xml";
+
+ is = TestStackLifecycle.class.getClassLoader().getResourceAsStream("configurations/" + configFile); + Assert.assertNotNull("InputStream for configuration file should not be null", is);
+
+      Configuration config;
+      config = new org.jdiameter.server.impl.helpers.XMLConfiguration(is);
+      stack.init(config);
+
+      Network network = stack.unwrap(Network.class);
+      network.addNetworkReqListener(new NetworkReqListener() {
+
+        public Answer processRequest(Request request) {
+          //this wont be called.
+          return null;
+        }
+      }, ApplicationId.createByAuthAppId(193, 19302));
+
+      stack.start();
+ //System.err.println(" ///////////////////////////////////////////////////////////////////// ");
+      //System.err.println(" // 1. stack.start() called.");
+ //System.err.println(" ///////////////////////////////////////////////////////////////////// ");
+
+      /** can connect to the stack here **/
+      boolean canConnect = tryToConnect();
+ Assert.assertTrue("Should be able to connect to server after 1st 'start'.", canConnect);
+
+      stack.stop();
+ //System.err.println(" ///////////////////////////////////////////////////////////////////// ");
+      //System.err.println(" // 2. stack.stop() called.");
+ //System.err.println(" ///////////////////////////////////////////////////////////////////// ");
+
+      /** cannot connect to the stack here **/
+      canConnect = tryToConnect();
+ Assert.assertFalse("Should NOT be able to connect to server after 'stop'.", canConnect);
+
+      stack.start();
+ //System.err.println(" ///////////////////////////////////////////////////////////////////// ");
+      //System.err.println(" // 3. stack.start() called.");
+ //System.err.println(" ///////////////////////////////////////////////////////////////////// ");
+
+      /** should be able to connect to the stack here again **/
+      canConnect = tryToConnect();
+ Assert.assertTrue("Should be able to connect to server after 2nd 'start'.", canConnect);
+
+      stack.stop();
+
+      stack.destroy();
+    }
+    catch (Exception e) {
+      e.printStackTrace();
+      fail("Failure while performing test: " + e.getMessage());
+    }
+    finally {
+      shutdownStack(stack);
+    }
+  }
+
+  /**
+   * Creates a client which tries to connect to stack under test.
+   *
+   * @return
+   */
+  private boolean tryToConnect() {
+    org.jdiameter.server.impl.StackImpl clientStack = null;
+    try {
+      clientStack = new org.jdiameter.server.impl.StackImpl();
+      InputStream is;
+      String configFile = "jdiameter-client-one.xml";
+ is = TestStackLifecycle.class.getClassLoader().getResourceAsStream("configurations/" + configFile);
+      Configuration config;
+      config = new org.jdiameter.server.impl.helpers.XMLConfiguration(is);
+      clientStack.init(config);
+
+      Network network = clientStack.unwrap(Network.class);
+      network.addNetworkReqListener(new NetworkReqListener() {
+
+        public Answer processRequest(Request request) {
+          // this wont be called.
+          return null;
+        }
+      }, ApplicationId.createByAuthAppId(193, 19302));
+
+      clientStack.start(Mode.ALL_PEERS, 5000, TimeUnit.MILLISECONDS);
+    }
+    catch (Exception e) {
+      return false;
+    }
+    finally {
+      shutdownStack(clientStack);
+    }
+
+    return true;
+  }
+
+  private void shutdownStack(StackImpl stack) {
+    if(stack != null) {
+      StackState curState = stack.getState();
+      if (curState == StackState.IDLE) {
+        // We are good. let's return
+        stack = null;
+        return;
+      }
+      else if (curState == StackState.CONFIGURED) {
+        // It's configured, just destroy it
+        try {
+          stack.destroy();
+        }
+        finally {
+          stack = null;
+        }
+      }
+      else if (curState == StackState.STARTED) {
+        // It's started, stop and destroy it
+        try {
+          stack.stop();
+        }
+        finally {
+          try {
+            stack.destroy();
+          }
+          finally {
+            stack = null;
+          }
+        }
+      }
+      else if (curState == StackState.STOPPED) {
+        // It's stopped, just destroy it
+        try {
+          stack.destroy();
+        }
+        finally {
+          stack = null;
+        }
+      }
+    }
+  }
+}
=======================================
--- /dev/null
+++ /trunk/servers/diameter/testsuite/tests/src/test/resources/configurations/jdiameter-client-one.xml Thu Dec 9 10:49:50 2010
@@ -0,0 +1,127 @@
+<?xml version="1.0"?>
+<Configuration xmlns="http://www.jdiameter.org/jdiameter-server";>
+
+  <LocalPeer>
+    <URI value="aaa://127.0.0.1:13868" />
+    <IPAddresses>
+      <IPAddress value="127.0.0.1" />
+    </IPAddresses>
+    <Realm value="mobicents.org" />
+    <VendorID value="193" />
+    <ProductName value="jDiameter" />
+    <FirmwareRevision value="1" />
+    <OverloadMonitor>
+      <Entry index="1" lowThreshold="0.5" highThreshold="0.6">
+        <ApplicationID>
+          <VendorId value="193" />
+          <AuthApplId value="0" />
+          <AcctApplId value="19302" />
+        </ApplicationID>
+      </Entry>
+    </OverloadMonitor>
+  </LocalPeer>
+
+  <Parameters>
+    <AcceptUndefinedPeer value="true" />
+    <DuplicateProtection value="true" />
+    <DuplicateTimer value="240000" />
+    <UseUriAsFqdn value="false" />
+    <QueueSize value="10000" />
+    <MessageTimeOut value="60000" />
+    <StopTimeOut value="10000" />
+    <CeaTimeOut value="10000" />
+    <IacTimeOut value="30000" />
+    <DwaTimeOut value="10000" />
+    <DpaTimeOut value="5000" />
+    <RecTimeOut value="10000" />
+
+    <!-- Statistics Logger Configuration -->
+    <StatisticLogger pause="30000" delay="30000" />
+
+    <Concurrent>
+      <Entity name="ThreadGroup" size="64"/> // Common Thread Pool
+      <Entity name="ProcessingMessageTimer" size="1"/>
+      <Entity name="DuplicationMessageTimer" size="1"/>
+      <Entity name="RedirectMessageTimer" size="1"/>
+      <Entity name="PeerOverloadTimer" size="1"/>
+      <Entity name="ConnectionTimer" size="1"/>
+      <Entity name="StatisticTimer" size="1"/>
+    </Concurrent>
+    <Dictionary enabled="false" sendLevel="MESSAGE" receiveLevel="OFF" />
+    <!-- To enable clustering uncomment the following lines
+ <SessionDatasource value="org.mobicents.diameter.impl.ha.data.ReplicatedDataSource"/> + <TimerFacility value="org.mobicents.diameter.impl.ha.timer.ReplicatedTimerFacilityImpl"/>
+    -->
+    </Parameters>
+
+  <Network>
+    <Peers>
+ <Peer name="aaa://127.0.0.1:3868" attempt_connect="true" rating="1" />
+    </Peers>
+
+    <Realms>
+ <Realm name="test.mobicents.org" peers="127.0.0.1" local_action="LOCAL" dynamic="false" exp_time="1">
+        <ApplicationID>
+          <VendorId value="193" />
+          <AuthApplId value="0" />
+          <AcctApplId value="19302" />
+        </ApplicationID>
+      </Realm>
+    </Realms>
+  </Network>
+
+  <Extensions />
+
+</Configuration>
+
+
+<!--
+<Configuration xmlns="http://www.jdiameter.org/jdiameter-client";>
+
+  <LocalPeer>
+    <URI value="aaa://127.0.0.1:13868" />
+    <Realm value="mobicents.org" />
+    <VendorID value="193" />
+    <ProductName value="jDiameter" />
+    <FirmwareRevision value="1" />
+  </LocalPeer>
+
+  <Parameters>
+    <UseUriAsFqdn value="true" />
+    <QueueSize value="10000" />
+    <MessageTimeOut value="60000" />
+    <StopTimeOut value="10000" />
+    <CeaTimeOut value="10000" />
+    <IacTimeOut value="30000" />
+    <DwaTimeOut value="10000" />
+    <DpaTimeOut value="5000" />
+    <RecTimeOut value="10000" />
+
+    <StatisticLogger pause="30000" delay="30000" />
+
+    <Concurrent>
+      <Entity name="ThreadGroup" size="64"/> // Common Thread Pool
+      <Entity name="ProcessingMessageTimer" size="1"/>
+      <Entity name="DuplicationMessageTimer" size="1"/>
+      <Entity name="RedirectMessageTimer" size="1"/>
+      <Entity name="PeerOverloadTimer" size="1"/>
+      <Entity name="ConnectionTimer" size="1"/>
+      <Entity name="StatisticTimer" size="1"/>
+    </Concurrent>
+    <Dictionary enabled="false" sendLevel="MESSAGE" receiveLevel="OFF" />
+    </Parameters>
+
+  <Network>
+    <Peers>
+      <Peer name="aaa://127.0.0.1:3868" rating="1" />
+    </Peers>
+
+    <Realms>
+      <Realm name="test.mobicents.org" peers="127.0.0.1" />
+    </Realms>
+  </Network>
+
+  <Extensions />
+
+</Configuration>
+ -->
=======================================
--- /dev/null
+++ /trunk/servers/diameter/testsuite/tests/src/test/resources/configurations/jdiameter-client-two.xml Thu Dec 9 10:49:50 2010
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<Configuration xmlns="http://www.jdiameter.org/jdiameter-client";>
+
+  <LocalPeer>
+    <URI value="aaa://127.0.0.2:3868" />
+    <IPAddresses>
+      <IPAddress value="127.0.0.2" />
+    </IPAddresses>
+    <Realm value="mobicents.org" />
+    <VendorID value="193" />
+    <ProductName value="jDiameter" />
+    <FirmwareRevision value="1" />
+    <OverloadMonitor>
+      <Entry index="1" lowThreshold="0.5" highThreshold="0.6">
+        <ApplicationID>
+          <VendorId value="193" />
+          <AuthApplId value="0" />
+          <AcctApplId value="19302" />
+        </ApplicationID>
+      </Entry>
+    </OverloadMonitor>
+  </LocalPeer>
+
+  <Parameters>
+    <AcceptUndefinedPeer value="true" />
+    <DuplicateProtection value="true" />
+    <DuplicateTimer value="240000" />
+    <UseUriAsFqdn value="false" />
+    <QueueSize value="10000" />
+    <MessageTimeOut value="60000" />
+    <StopTimeOut value="10000" />
+    <CeaTimeOut value="10000" />
+    <IacTimeOut value="30000" />
+    <DwaTimeOut value="10000" />
+    <DpaTimeOut value="5000" />
+    <RecTimeOut value="10000" />
+
+    <!-- Statistics Logger Configuration -->
+    <StatisticLogger pause="30000" delay="30000" />
+
+    <Concurrent>
+      <Entity name="ThreadGroup" size="64"/> // Common Thread Pool
+      <Entity name="ProcessingMessageTimer" size="1"/>
+      <Entity name="DuplicationMessageTimer" size="1"/>
+      <Entity name="RedirectMessageTimer" size="1"/>
+      <Entity name="PeerOverloadTimer" size="1"/>
+      <Entity name="ConnectionTimer" size="1"/>
+      <Entity name="StatisticTimer" size="1"/>
+    </Concurrent>
+    <Dictionary enabled="false" sendLevel="MESSAGE" receiveLevel="OFF" />
+    <!-- To enable clustering uncomment the following lines
+ <SessionDatasource value="org.mobicents.diameter.impl.ha.data.ReplicatedDataSource"/> + <TimerFacility value="org.mobicents.diameter.impl.ha.timer.ReplicatedTimerFacilityImpl"/>
+    -->
+    </Parameters>
+
+  <Network>
+    <Peers>
+ <Peer name="aaa://127.0.0.2:13868" attempt_connect="false" rating="1" />
+    </Peers>
+
+    <Realms>
+ <Realm name="test.mobicents.org" peers="127.0.0.2" local_action="LOCAL" dynamic="false" exp_time="1">
+        <ApplicationID>
+          <VendorId value="193" />
+          <AuthApplId value="0" />
+          <AcctApplId value="19302" />
+        </ApplicationID>
+      </Realm>
+    </Realms>
+  </Network>
+
+  <Extensions />
+
+</Configuration>
=======================================
--- /dev/null
+++ /trunk/servers/diameter/testsuite/tests/src/test/resources/configurations/jdiameter-server-one.xml Thu Dec 9 10:49:50 2010
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<Configuration xmlns="http://www.jdiameter.org/jdiameter-server";>
+
+  <LocalPeer>
+    <URI value="aaa://127.0.0.1:3868" />
+    <IPAddresses>
+      <IPAddress value="127.0.0.1" />
+    </IPAddresses>
+    <Realm value="mobicents.org" />
+    <VendorID value="193" />
+    <ProductName value="jDiameter" />
+    <FirmwareRevision value="1" />
+    <OverloadMonitor>
+      <Entry index="1" lowThreshold="0.5" highThreshold="0.6">
+        <ApplicationID>
+          <VendorId value="193" />
+          <AuthApplId value="0" />
+          <AcctApplId value="19302" />
+        </ApplicationID>
+      </Entry>
+    </OverloadMonitor>
+  </LocalPeer>
+
+  <Parameters>
+    <AcceptUndefinedPeer value="true" />
+    <DuplicateProtection value="true" />
+    <DuplicateTimer value="240000" />
+    <UseUriAsFqdn value="false" />
+    <QueueSize value="10000" />
+    <MessageTimeOut value="60000" />
+    <StopTimeOut value="10000" />
+    <CeaTimeOut value="10000" />
+    <IacTimeOut value="30000" />
+    <DwaTimeOut value="10000" />
+    <DpaTimeOut value="5000" />
+    <RecTimeOut value="10000" />
+
+    <!-- Statistics Logger Configuration -->
+    <StatisticLogger pause="30000" delay="30000" />
+
+    <Concurrent>
+      <Entity name="ThreadGroup" size="64"/> // Common Thread Pool
+      <Entity name="ProcessingMessageTimer" size="1"/>
+      <Entity name="DuplicationMessageTimer" size="1"/>
+      <Entity name="RedirectMessageTimer" size="1"/>
+      <Entity name="PeerOverloadTimer" size="1"/>
+      <Entity name="ConnectionTimer" size="1"/>
+      <Entity name="StatisticTimer" size="1"/>
+    </Concurrent>
+    <Dictionary enabled="false" sendLevel="MESSAGE" receiveLevel="OFF" />
+    <!-- To enable clustering uncomment the following lines
+ <SessionDatasource value="org.mobicents.diameter.impl.ha.data.ReplicatedDataSource"/> + <TimerFacility value="org.mobicents.diameter.impl.ha.timer.ReplicatedTimerFacilityImpl"/>
+    -->
+    </Parameters>
+
+  <Network>
+    <Peers>
+ <Peer name="aaa://127.0.0.1:13868" attempt_connect="false" rating="1" />
+    </Peers>
+
+    <Realms>
+ <Realm name="test.mobicents.org" peers="127.0.0.1" local_action="LOCAL" dynamic="false" exp_time="1">
+        <ApplicationID>
+          <VendorId value="193" />
+          <AuthApplId value="0" />
+          <AcctApplId value="19302" />
+        </ApplicationID>
+      </Realm>
+    </Realms>
+  </Network>
+
+  <Extensions />
+
+</Configuration>
=======================================
--- /dev/null
+++ /trunk/servers/diameter/testsuite/tests/src/test/resources/configurations/jdiameter-server-two.xml Thu Dec 9 10:49:50 2010
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<Configuration xmlns="http://www.jdiameter.org/jdiameter-server";>
+
+  <LocalPeer>
+    <URI value="aaa://127.0.0.2:3868" />
+    <IPAddresses>
+      <IPAddress value="127.0.0.2" />
+    </IPAddresses>
+    <Realm value="mobicents.org" />
+    <VendorID value="193" />
+    <ProductName value="jDiameter" />
+    <FirmwareRevision value="1" />
+    <OverloadMonitor>
+      <Entry index="1" lowThreshold="0.5" highThreshold="0.6">
+        <ApplicationID>
+          <VendorId value="193" />
+          <AuthApplId value="0" />
+          <AcctApplId value="19302" />
+        </ApplicationID>
+      </Entry>
+    </OverloadMonitor>
+  </LocalPeer>
+
+  <Parameters>
+    <AcceptUndefinedPeer value="true" />
+    <DuplicateProtection value="true" />
+    <DuplicateTimer value="240000" />
+    <UseUriAsFqdn value="false" />
+    <QueueSize value="10000" />
+    <MessageTimeOut value="60000" />
+    <StopTimeOut value="10000" />
+    <CeaTimeOut value="10000" />
+    <IacTimeOut value="30000" />
+    <DwaTimeOut value="10000" />
+    <DpaTimeOut value="5000" />
+    <RecTimeOut value="10000" />
+
+    <!-- Statistics Logger Configuration -->
+    <StatisticLogger pause="30000" delay="30000" />
+
+    <Concurrent>
+      <Entity name="ThreadGroup" size="64"/> // Common Thread Pool
+      <Entity name="ProcessingMessageTimer" size="1"/>
+      <Entity name="DuplicationMessageTimer" size="1"/>
+      <Entity name="RedirectMessageTimer" size="1"/>
+      <Entity name="PeerOverloadTimer" size="1"/>
+      <Entity name="ConnectionTimer" size="1"/>
+      <Entity name="StatisticTimer" size="1"/>
+    </Concurrent>
+    <Dictionary enabled="false" sendLevel="MESSAGE" receiveLevel="OFF" />
+    <!-- To enable clustering uncomment the following lines
+ <SessionDatasource value="org.mobicents.diameter.impl.ha.data.ReplicatedDataSource"/> + <TimerFacility value="org.mobicents.diameter.impl.ha.timer.ReplicatedTimerFacilityImpl"/>
+    -->
+    </Parameters>
+
+  <Network>
+    <Peers>
+ <Peer name="aaa://127.0.0.2:13868" attempt_connect="false" rating="1" />
+    </Peers>
+
+    <Realms>
+ <Realm name="test.mobicents.org" peers="127.0.0.2" local_action="LOCAL" dynamic="false" exp_time="1">
+        <ApplicationID>
+          <VendorId value="193" />
+          <AuthApplId value="0" />
+          <AcctApplId value="19302" />
+        </ApplicationID>
+      </Realm>
+    </Realms>
+  </Network>
+
+  <Extensions />
+
+</Configuration>

Reply via email to