From 64d96ded5dadeb6aac3b61128850de08d94c729b Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Wed, 22 Nov 2006 11:41:33 +0000
Subject: [PATCH] move ProtocolWindowTest to synchronization because it needs the whole synchronization code to be working.

---
 opends/tests/unit-tests-testng/src/server/org/opends/server/synchronization/StressTest.java |  111 +++++++++++++++++++++++++++++--------------------------
 1 files changed, 59 insertions(+), 52 deletions(-)

diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/synchronization/StressTest.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/synchronization/StressTest.java
index 69dd07f..dae2748 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/synchronization/StressTest.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/synchronization/StressTest.java
@@ -75,16 +75,11 @@
  * Test the contructors, encoders and decoders of the synchronization AckMsg,
  * ModifyMsg, ModifyDnMsg, AddMsg and Delete Msg
  */
-public class StressTest extends MonitorProvider
+public class StressTest extends SynchronizationTestCase
 {
   private static final String SYNCHRONIZATION_STRESS_TEST =
     "Synchronization Stress Test";
 
-  public StressTest()
-  {
-    super("synchronization Stress Test");
-  }
-
   /**
    * The internal connection used for operation
    */
@@ -156,7 +151,8 @@
     cleanEntries();
 
     ChangelogBroker broker = openChangelogSession(baseDn, (short) 18);
-    DirectoryServer.registerMonitorProvider(this);
+    Monitor monitor = new Monitor("stress test monitor");
+    DirectoryServer.registerMonitorProvider(monitor);
 
     try {
       /*
@@ -186,7 +182,7 @@
           tmp.getOperationalAttributes());
       addOp.run();
       entryList.add(personEntry);
-      assertNotNull(DirectoryServer.getEntry(personEntry.getDN()),
+      assertTrue(DirectoryServer.entryExists(personEntry.getDN()),
         "The Add Entry operation failed");
 
       // Check if the client has received the msg
@@ -457,50 +453,6 @@
     entryList.add(synchroServerEntry);
   }
 
-  @Override
-  public List<Attribute> getMonitorData()
-  {
-    Attribute attr;
-    if (reader == null)
-      attr = new Attribute("received-messages", "not yet started");
-    else
-      attr = new Attribute("received-messages",
-                           String.valueOf(reader.getCurrentCount()));
-    List<Attribute>  list = new LinkedList<Attribute>();
-    list.add(attr);
-    attr = new Attribute("base-dn", "ou=People,dc=example,dc=com");
-    list.add(attr);
-    return list;
-  }
-
-  @Override
-  public String getMonitorInstanceName()
-  {
-    return SYNCHRONIZATION_STRESS_TEST;
-  }
-
-  @Override
-  public long getUpdateInterval()
-  {
-    // we don't wont to do polling on this monitor
-    return 0;
-  }
-
-  @Override
-  public void initializeMonitorProvider(ConfigEntry configEntry)
-  throws ConfigException, InitializationException
-  {
-    // nothing to do
-
-  }
-
-  @Override
-  public void updateMonitorData()
-  {
-    // nothing to do
-
-  }
-
   private class BrokerWriter extends Thread
   {
     int count;
@@ -605,4 +557,59 @@
       return count;
     }
   }
+  
+  private class Monitor extends MonitorProvider
+  {
+    protected Monitor(String threadName)
+    {
+      super(threadName);
+    }
+
+    @Override
+    public List<Attribute> getMonitorData()
+    {
+      Attribute attr;
+      if (reader == null)
+        attr = new Attribute("received-messages", "not yet started");
+      else
+        attr = new Attribute("received-messages",
+                             String.valueOf(reader.getCurrentCount()));
+      List<Attribute>  list = new LinkedList<Attribute>();
+      list.add(attr);
+      attr = new Attribute("base-dn", "ou=People,dc=example,dc=com");
+      list.add(attr);
+      return list;
+    }
+
+    @Override
+    public String getMonitorInstanceName()
+    {
+      return SYNCHRONIZATION_STRESS_TEST;
+    }
+
+    @Override
+    public void updateMonitorData()
+    {
+      // nothing to do
+    
+    }
+
+    @Override
+    public void initializeMonitorProvider(ConfigEntry configEntry)
+    throws ConfigException, InitializationException
+    {
+      // nothing to do
+    
+    }
+
+    @Override
+    public long getUpdateInterval()
+    {
+      // we don't wont to do polling on this monitor
+      return 0;
+    }
+
+    
+    
+  }
 }

--
Gitblit v1.10.0