Commit 5689a998 authored by afreyssin's avatar afreyssin

Minor changes.

parent 1f2234e5
......@@ -35,78 +35,76 @@ import org.objectweb.joram.client.jms.admin.User;
*
*/
public class TestDmq6 extends TestCase {
public static void main(String[] args) {
new TestDmq6().run();
}
public static void main(String[] args) {
new TestDmq6().run();
}
public void run() {
try {
boolean defaultCreate = false, dmq = false, dmq1 = false;
System.out.println("server start");
startAgentServer((short)0);
Thread.sleep(5000);
AdminModule.connect("localhost", 2560,"root", "root", 60);
System.out.println("admin ok");
// check
List liste = AdminModule.getDestinations();
for(int i = 0;i < liste.size(); i++){
Destination dest = (Destination)liste.get(i);
if(dest.getType().equals("queue")){
assertTrue( dest.isFreelyWriteable() );
assertTrue( dest.isFreelyReadable() );
assertEquals(2,((Queue)dest).getThreshold());
}else if(dest.getType().equals("topic")){
assertTrue( dest.isFreelyWriteable() );
assertTrue( dest.isFreelyReadable() );
}
if(dest.getAdminName().equals("defaultdmq")){
List listeI = dest.getReaders();
assertEquals("dmq",((User)listeI.get(0)).getName());
assertEquals(dest,AdminModule.getDefaultDMQ());
assertEquals(10,AdminModule.getDefaultThreshold());
defaultCreate = true;
} else if (dest.getAdminName().equals("dmq")){
List listeI = dest.getReaders();
assertEquals("dmq",((User)listeI.get(0)).getName());
dmq = true;
} else if (dest.getAdminName().equals("dmq1")){
List listeI = dest.getReaders();
assertEquals("dmq",((User)listeI.get(0)).getName());
dmq1 = true;
}
}
assertTrue(defaultCreate);
assertTrue(dmq);
assertTrue(dmq1);
liste = AdminModule.getUsers();
for(int i = 0;i < liste.size();i++){
User user = (User)liste.get(i);
if(user.getName().equals("anonymous")){
assertEquals(2,user.getThreshold());
}
}
AdminModule.disconnect();
} catch (Throwable exc) {
exc.printStackTrace();
error(exc);
} finally {
System.out.println("Server stop ");
stopAgentServer((short)0);
endTest();
}
public void run() {
try {
boolean defaultCreate = false, dmq = false, dmq1 = false;
System.out.println("server start");
startAgentServer((short)0);
Thread.sleep(5000);
AdminModule.connect("localhost", 2560,"root", "root", 60);
System.out.println("admin ok");
// check
List liste = AdminModule.getDestinations();
for(int i = 0;i < liste.size(); i++){
Destination dest = (Destination)liste.get(i);
if(dest.getType().equals("queue")){
assertTrue( dest.isFreelyWriteable() );
assertTrue( dest.isFreelyReadable() );
assertEquals(2,((Queue)dest).getThreshold());
}else if(dest.getType().equals("topic")){
assertTrue( dest.isFreelyWriteable() );
assertTrue( dest.isFreelyReadable() );
}
if(dest.getAdminName().equals("defaultdmq")){
List listeI = dest.getReaders();
assertEquals("dmq",((User)listeI.get(0)).getName());
assertEquals(dest,AdminModule.getDefaultDMQ());
assertEquals(10,AdminModule.getDefaultThreshold());
defaultCreate = true;
} else if (dest.getAdminName().equals("dmq")){
List listeI = dest.getReaders();
assertEquals("dmq",((User)listeI.get(0)).getName());
dmq = true;
} else if (dest.getAdminName().equals("dmq1")){
List listeI = dest.getReaders();
assertEquals("dmq",((User)listeI.get(0)).getName());
dmq1 = true;
}
}
assertTrue(defaultCreate);
assertTrue(dmq);
assertTrue(dmq1);
liste = AdminModule.getUsers();
for(int i = 0;i < liste.size();i++){
User user = (User)liste.get(i);
if(user.getName().equals("anonymous")){
assertEquals(2,user.getThreshold());
}
}
AdminModule.disconnect();
} catch (Throwable exc) {
exc.printStackTrace();
error(exc);
} finally {
System.out.println("Server stop ");
stopAgentServer((short)0);
endTest();
}
}
}
......@@ -2,78 +2,56 @@
<JoramAdmin>
<AdminModule>
<connect host="localhost"
port="2560"
name="root"
password="root"/>
<connect host="localhost" port="2560" name="root" password="root"/>
</AdminModule>
<InitialContext>
<property name="java.naming.factory.initial" value="fr.dyade.aaa.jndi2.client.NamingContextFactory"/>
<property name="java.naming.factory.host" value="localhost"/>
<property name="java.naming.factory.port" value="16400"/>
</InitialContext>
<ConnectionFactory className="org.objectweb.joram.client.jms.tcp.TcpConnectionFactory">
<tcp host="localhost"
port="2560"/>
<tcp host="localhost" port="2560"/>
<jndi name="cf"/>
</ConnectionFactory>
<User name="dmq"
password="dmq"
serverId="0"/>
<User name="dmq" password="dmq" serverId="0"/>
<DMQueue name="defaultdmq"
serverId="0">
<DMQueue name="defaultdmq" serverId="0">
<reader user="dmq"/>
<writer user="dmq"/>
<jndi name="dmq"/>
<jndi name="defaultdmq"/>
</DMQueue>
<DMQueue name="dmq"
serverId="0">
<DMQueue name="dmq" serverId="0">
<reader user="dmq"/>
<writer user="dmq"/>
<jndi name="dmq"/>
</DMQueue>
<DMQueue name="dmq1"
serverId="0">
<DMQueue name="dmq1" serverId="0">
<reader user="dmq"/>
<writer user="dmq"/>
<jndi name="dmq1"/>
</DMQueue>
<Server serverId="0" dmq="defaultdmq" threshold="10"/>
<User name="anonymous"
password="anonymous"
serverId="0"
dmq="dmq1"
threshold="2"/>
<User name="anonymous" password="anonymous" serverId="0" dmq="dmq1" threshold="2"/>
<Queue name="queue"
dmq="dmq"
threshold="2">
<Queue name="queue" dmq="dmq" threshold="2">
<freeReader/>
<freeWriter/>
<jndi name="queue"/>
</Queue>
<Topic name="topic"
dmq="dmq1">
<Topic name="topic" dmq="dmq1">
<freeReader/>
<freeWriter/>
<jndi name="topic"/>
</Topic>
<InitialContext>
<property name="java.naming.factory.initial" value="fr.dyade.aaa.jndi2.client.NamingContextFactory"/>
<property name="java.naming.factory.host" value="localhost"/>
<property name="java.naming.factory.port" value="16400"/>
</InitialContext>
</JoramAdmin>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment