This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: DefaultStyledDocument tests


2006-02-06  Lillian Angel  <langel@redhat.com>

        *
gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure1.java:
        Removed strict checks.
        *
gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure3.java:
        Likewise.
        *
gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure4.java:
        Likewise.
        *
gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure5.java:
        Likewise.
        *
gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure6.java:
        Likewise.
        *
gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure7.java:
        Likewise.
        *
gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure8.java:
        Likewise.
        *
gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument1.java:
        Likewise.
        *
gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument4.java:
        Likewise.
        *
gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument5.java:
        Likewise.
        *
gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument6.java:
        Likewise.

Index: gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure1.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure1.java,v
retrieving revision 1.2
diff -u -r1.2 ElementStructure1.java
--- gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure1.java	23 Jan 2006 18:31:58 -0000	1.2
+++ gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure1.java	6 Feb 2006 15:10:04 -0000
@@ -40,7 +40,6 @@
 	 */
   public void test(TestHarness harness)
   {
-    h2 = harness;
     ElementStructure1 doc = new ElementStructure1();
     Element root = doc.getDefaultRootElement();
     try
@@ -95,172 +94,4 @@
         harness.debug(ex);
       }
   }
-  
-  static TestHarness h2;
-  static int numInserts = 0;
-  static int numLeaves = 0;
-  static int numBranches = 0;
-
-  public ElementStructure1()
-  {
-    // We override the constructor so we can explicitly set the type of the
-    // buffer to be our ElementBuffer2, allowing us to test some internals.
-    super();
-    buffer = new ElementBuffer2(createDefaultRoot());
-  }
-
-  // Overriding this method allows us to check that the right number
-  // of newLines was encountered and that the event has the proper
-  // offset and length.
-  protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr)
-  {
-    int l = ev.getLength();
-    int o = ev.getOffset();
-    if (numInserts == 0)
-      {
-        h2.check(o == 0);
-        h2.check(l == 19);
-      }
-    else if (numInserts == 1)
-    {
-      h2.check(o == 6);
-      h2.check(l == 6);
-    } 
-    else if (numInserts == 2)
-      {
-        h2.check(o == 0);
-        h2.check(l == 5);
-      }
-    else if (numInserts == 3)
-      {
-        h2.check(o == 30);
-        h2.check(l == 3);
-      }
-    else
-      h2.fail ("too many calls to DefaultStyledDocument.insertUpdate");
-    super.insertUpdate(ev, attr);
-  }
-  
-  // Overriding this method allows us to check that the proper LeafElements
-  // are being created.
-  protected Element createLeafElement(Element parent, 
-                                      AttributeSet a, int p0, int p1)
-  {
-    numLeaves ++;
-    // In this test if we create a new LeafElement the test should fail.
-    h2.fail("no new leaf elements should be created");
-    return super.createLeafElement(parent, a, p0, p1);
-  }
-  
-  // Overriding this method allows us to check that the proper BranchElements
-  // are being created.
-  protected Element createBranchElement(Element parent,
-                                        AttributeSet a)
-  {
-    numBranches ++;
-    // In this test if we create a new BranchElement the test should fail.
-    h2.fail("no new branch elements should be created");
-    return super.createBranchElement(parent, a);
-  }
-  
-  // Prints some spaces.
-  public static void pad(int pad)
-  {
-    for (int i = 0; i < pad; i++)
-      System.out.print(" ");
-  }
-
-  // Displays the Element hierarchy starting with <code>start</code>.
-  // This is just debugging code.
-  public static void printElements (Element start, int pad)
-  {
-    pad(pad);
-    if (pad == 0)
-      System.out.println ("ROOT ELEMENT ("+start.getStartOffset()+", "
-                          + start.getEndOffset()+")");
-    else if (start instanceof AbstractDocument.BranchElement)
-      System.out.println ("BranchElement ("+start.getStartOffset()+", "
-                          + start.getEndOffset()+")");
-    else
-      {
-        try
-          {
-            System.out.println ("LeafElement ("+start.getStartOffset()+", "
-                                + start.getEndOffset()+"): "
-                                + start.getAttributes().getAttributeCount() + 
-                                ": "
-                                + start.getDocument().
-                                getText(start.getStartOffset(), 
-                                        start.getEndOffset() - 
-                                        start.getStartOffset()));
-          }
-        catch (BadLocationException ble)
-          {
-          }
-      }
-    for (int i = 0; i < start.getElementCount(); i ++)
-      printElements (start.getElement(i), pad+3);
-  }
-
-  
-  // A class to be the buffer of the styled document.
-  // This allows us to check that some values are correct internally within
-  // the ElementBuffer.
-  public class ElementBuffer2 extends ElementBuffer
-  {
-    public ElementBuffer2(Element root)
-    {
-      super(root);
-    }
-    
-    // This method allows us to check that the ElementSpecs generated by 
-    // DefaultStyledDocument.insertUpdate are correct.
-    protected void insertUpdate(ElementSpec[] data)
-    {
-      numInserts ++;
-      if (numInserts == 1)
-        {
-          h2.checkPoint("ElementBuffer insertUpdate: first insertion");
-          h2.check (data.length == 1);
-          h2.check (data[0].getType() == ElementSpec.ContentType);
-          h2.check 
-            (data[0].getDirection() == ElementSpec.JoinPreviousDirection);
-          h2.check (data[0].getOffset() == 0);
-          h2.check (data[0].getLength() == 19);
-        }
-      else if (numInserts == 2)
-        {
-          h2.checkPoint("ElementBuffer insertUpdate: second insertion");
-          h2.check (data.length == 1);
-          h2.check (data[0].getType() == ElementSpec.ContentType);
-          h2.check 
-            (data[0].getDirection() == ElementSpec.JoinPreviousDirection);
-          h2.check (data[0].getOffset() == 0);
-          h2.check (data[0].getLength() == 6);
-        }
-      else if (numInserts == 3)
-        {
-          h2.checkPoint("ElementBuffer insertUpdate: third insertion");
-          h2.check (data.length == 1);
-          h2.check (data[0].getType() == ElementSpec.ContentType);
-          h2.check 
-            (data[0].getDirection() == ElementSpec.JoinPreviousDirection);
-          h2.check (data[0].getOffset() == 0);
-          h2.check (data[0].getLength() == 5);
-        }
-      else if (numInserts == 4)
-        {
-          h2.checkPoint("ElementBuffer insertUpdate: fourth insertion");
-          h2.check (data.length == 1);
-          h2.check (data[0].getType() == ElementSpec.ContentType);
-          h2.check 
-            (data[0].getDirection() == ElementSpec.JoinPreviousDirection);
-          h2.check (data[0].getOffset() == 0);
-          h2.check (data[0].getLength() == 3);
-        }
-      else
-        h2.fail("too many ElementSpecs created");
-      super.insertUpdate(data);
-    }
-  }
 }
Index: gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure3.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure3.java,v
retrieving revision 1.4
diff -u -r1.4 ElementStructure3.java
--- gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure3.java	23 Jan 2006 18:31:58 -0000	1.4
+++ gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure3.java	6 Feb 2006 15:10:04 -0000
@@ -104,122 +104,6 @@
     super.insertUpdate(ev, attr);
   }
 
-  // Overriding this method allows us to check that the proper LeafElements
-  // are being created.
-  protected Element createLeafElement(Element parent, 
-                                      AttributeSet a, int p0, int p1)
-  {
-    // In this test 3 LeafElements should be created.
-    numLeaves++;
-    if (numLeaves== 1)
-      {
-        h2.checkPoint ("create first leaf element");
-        h2.check (p0 == 0);
-        h2.check (p1 == 70);
-        try
-        {
-          h2.check (parent.getStartOffset() == 0);
-          h2.check (parent.getEndOffset() == 135);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("parent Element should have children, but has none.");
-          h2.fail ("parent Element should have children, but has none.");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 2)
-      {
-        h2.checkPoint ("create second leaf element");
-        h2.check (p0 == 134);
-        h2.check (p1 == 135);
-        h2.check (parent.getElementCount() == 0);
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 3)
-      {
-        h2.checkPoint ("create third leaf element");
-        h2.check (p0 == 70);
-        h2.check (p1 == 135);
-        try
-        {
-          h2.check (parent.getStartOffset() == 134);
-          h2.check (parent.getEndOffset() == 135);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else
-      h2.fail ("too many leaf elements created");
-    return super.createLeafElement(parent, a, p0, p1);
-  }
-  
-  // Overriding this method allows us to check that the proper BranchElements
-  // are being created.
-  protected Element createBranchElement(Element parent,
-                                        AttributeSet a)
-  {
-    // In this test we create 1 new BranchElement.    
-    numBranches ++;
-    if (numBranches == 1)
-      {
-        h2.checkPoint("create branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 135);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else
-      h2.fail ("too many branch elements created");
-    return super.createBranchElement(parent, a);
-  }
-  
-  // Prints some spaces.
-  public static void pad(int pad)
-  {
-    for (int i = 0; i < pad; i++)
-      System.out.print(" ");
-  }
-
-  // Displays the Element hierarchy starting with <code>start</code>.
-  // This is just debugging code.
-  public static void printElements (Element start, int pad)
-  {
-    pad(pad);
-    if (pad == 0)
-      System.out.println ("ROOT ELEMENT ("+start.getStartOffset()+", "
-                          + start.getEndOffset()+")");
-    else if (start instanceof AbstractDocument.BranchElement)
-      System.out.println ("BranchElement ("+start.getStartOffset()+", "
-                          + start.getEndOffset()+")");
-    else
-      {
-        try
-          {
-            System.out.println ("LeafElement ("+start.getStartOffset()+", "
-                                + start.getEndOffset()+"): "
-                                + start.getAttributes().getAttributeCount() 
-                                + ": "
-                                + start.getDocument().
-                                getText(start.getStartOffset(), 
-                                        start.getEndOffset() - 
-                                        start.getStartOffset()));
-          }
-        catch (BadLocationException ble)
-          {
-          }
-      }
-    for (int i = 0; i < start.getElementCount(); i ++)
-      printElements (start.getElement(i), pad+3);
-  }
-
   
   // A class to be the buffer of the styled document.
   // This allows us to check that some values are correct internally within
Index: gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure4.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure4.java,v
retrieving revision 1.3
diff -u -r1.3 ElementStructure4.java
--- gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure4.java	23 Jan 2006 18:31:58 -0000	1.3
+++ gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure4.java	6 Feb 2006 15:10:04 -0000
@@ -139,139 +139,6 @@
     super.insertUpdate(ev, attr);
   }
 
-  // Overriding this method allows us to check that the proper LeafElements
-  // are being created.
-  protected Element createLeafElement(Element parent, AttributeSet a, int p0,
-                                      int p1)
-  {
-    // In this test we create 4 new LeafElements.
-    numLeaves++;
-    if (numLeaves == 1)
-      {
-        h2.checkPoint("create first leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 21);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 22);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("parent Element should have children, but has none.");
-            h2.fail("parent Element should have children, but has none.");
-          }
-        h2.check(a.getAttributeCount() == 1);
-      }
-    else if (numLeaves == 2)
-      {
-        h2.checkPoint("create second leaf element");
-        h2.check(p0 == 21);
-        h2.check(p1 == 22);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 3)
-      {
-        h2.checkPoint("create third leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 1);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 22);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("branch element should have children, but has none");
-            h2.fail("branch element should have children, but has none");
-          }
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 4)
-      {
-        h2.checkPoint("create fourth leaf element");
-        h2.check(p0 == 1);
-        h2.check(p1 == 22);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 22);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("branch element should have children, but has none");
-            h2.fail("branch element should have children, but has none");
-          }
-        h2.check(a.getAttributeCount() == 1);        
-      }
-    else
-      h2.fail ("too many leaf elements created");
-    return super.createLeafElement(parent, a, p0, p1);
-  }
-
-  // Overriding this method allows us to check that the proper BranchElements
-  // are being created.
-  protected Element createBranchElement(Element parent, AttributeSet a)
-  {
-    // In this test we create 1 new BranchElement.    
-    numBranches ++;
-    if (numBranches == 1)
-      {
-        h2.checkPoint("create branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 22);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else 
-      h2.fail("too many branch elements created");
-    return super.createBranchElement(parent, a);
-  }
-
-  // Prints some spaces.
-  public static void pad(int pad)
-  {
-    for (int i = 0; i < pad; i++)
-      System.out.print(" ");
-  }
-
-  // Displays the Element hierarchy starting with <code>start</code>.
-  // This is just debugging code.
-  public static void printElements(Element start, int pad)
-  {
-    pad(pad);
-    if (pad == 0)
-      System.out.println("ROOT ELEMENT (" + start.getStartOffset() + ", "
-                         + start.getEndOffset() + ")");
-    else if (start instanceof AbstractDocument.BranchElement)
-      System.out.println("BranchElement (" + start.getStartOffset() + ", "
-                         + start.getEndOffset() + ")");
-    else
-      {
-        try
-          {
-            System.out.println("LeafElement ("+ start.getStartOffset()
-                               + ", " + start.getEndOffset() + "): "
-                               + start.getAttributes().getAttributeCount()
-                               + ": " + start.getDocument().
-                               getText(start.getStartOffset(),
-                                       start.getEndOffset()
-                                       - start.getStartOffset()));
-          }
-        catch (BadLocationException ble)
-          {
-          }
-      }
-    for (int i = 0; i < start.getElementCount(); i++)
-      printElements(start.getElement(i), pad + 3);
-  }
-
   // A class to be the buffer of the styled document.
   // This allows us to check that some values are correct internally within
   // the ElementBuffer.
Index: gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure5.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure5.java,v
retrieving revision 1.2
diff -u -r1.2 ElementStructure5.java
--- gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure5.java	23 Jan 2006 18:31:58 -0000	1.2
+++ gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure5.java	6 Feb 2006 15:10:04 -0000
@@ -24,9 +24,7 @@
 import gnu.testlet.TestHarness;
 import gnu.testlet.Testlet;
 
-import javax.swing.text.AbstractDocument;
 import javax.swing.text.AttributeSet;
-import javax.swing.text.BadLocationException;
 import javax.swing.text.DefaultStyledDocument;
 import javax.swing.text.Element;
 
@@ -129,136 +127,6 @@
     super.insertUpdate(ev, attr);
   }
 
-  // Overriding this method allows us to check that the proper LeafElements
-  // are being created.
-  protected Element createLeafElement(Element parent, AttributeSet a, int p0,
-                                      int p1)
-  {
-    numLeaves++;
-    if (numLeaves == 1)
-      {
-        h2.checkPoint("create first leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 21);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 22);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("parent Element should have children, but has none.");
-            h2.fail("parent Element should have children, but has none.");
-          }        
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 2)
-      {
-        h2.checkPoint("create second leaf element");
-        h2.check(p0 == 21);
-        h2.check(p1 == 22);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 3)
-      {
-        h2.checkPoint("create third leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 21);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 43);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("branch element should have children, but has none");
-            h2.fail("branch element should have children, but has none");
-          }
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 4)
-      {
-        h2.checkPoint("create fourth leaf element");
-        h2.check(p0 == 21);
-        h2.check(p1 == 43);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else
-      h2.fail ("too many leaf elements created");
-    return super.createLeafElement(parent, a, p0, p1);
-  }
-
-  // Overriding this method allows us to check that the proper BranchElements
-  // are being created.
-  protected Element createBranchElement(Element parent, AttributeSet a)
-  {    
-    numBranches ++;
-    if (numBranches == 1)
-      {
-        h2.checkPoint("create first branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 22);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numBranches == 2)
-      {
-        h2.checkPoint("create second branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 44);
-        h2.check(a.getAttributeCount() == 0); 
-      }
-    else
-      h2.fail ("too many branch elements created");
-    return super.createBranchElement(parent, a);
-  }
-
-  // Prints some spaces.
-  public static void pad(int pad)
-  {
-    for (int i = 0; i < pad; i++)
-      System.out.print(" ");
-  }
-
-  // Displays the Element hierarchy starting with <code>start</code>.
-  // This is just debugging code.
-  public static void printElements(Element start, int pad)
-  {
-    pad(pad);
-    if (pad == 0)
-      System.out.println("ROOT ELEMENT (" + start.getStartOffset() + ", "
-                         + start.getEndOffset() + ")");
-    else if (start instanceof AbstractDocument.BranchElement)
-      System.out.println("BranchElement (" + start.getStartOffset() + ", "
-                         + start.getEndOffset() + ")");
-    else
-      {
-        try
-          {
-            System.out.println("LeafElement ("
-                               + start.getStartOffset()
-                               + ", "
-                               + start.getEndOffset()
-                               + "): "
-                               + start.getAttributes().getAttributeCount()
-                               + ": "
-                               + start.getDocument().
-                               getText(start.getStartOffset(),
-                                       start.getEndOffset()
-                                       - start.getStartOffset()));
-          }
-        catch (BadLocationException ble)
-          {
-          }
-      }
-    for (int i = 0; i < start.getElementCount(); i++)
-      printElements(start.getElement(i), pad + 3);
-  }
 
   // A class to be the buffer of the styled document.
   // This allows us to check that some values are correct internally within
Index: gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure6.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure6.java,v
retrieving revision 1.2
diff -u -r1.2 ElementStructure6.java
--- gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure6.java	23 Jan 2006 18:31:58 -0000	1.2
+++ gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure6.java	6 Feb 2006 15:10:04 -0000
@@ -93,105 +93,7 @@
     h2.check(docEvent.getChange(getDefaultRootElement()) != null);
 
   }
-
-  // Overriding this method allows us to check that the proper LeafElements
-  // are being created.
-  protected Element createLeafElement(Element parent, AttributeSet a, int p0,
-                                      int p1)
-  {
-    numLeaves++;
-    if (numLeaves == 1)
-      {
-        h2.checkPoint("create first leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 21);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 22);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("parent Element should have children, but has none.");
-            h2.fail("parent Element should have children, but has none.");
-          }        
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 2)
-      {
-        h2.checkPoint("create second leaf element");
-        h2.check(p0 == 21);
-        h2.check(p1 == 22);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else
-      h2.fail ("too many leaf elements created");
-    return super.createLeafElement(parent, a, p0, p1);
-  }
-
-  // Overriding this method allows us to check that the proper BranchElements
-  // are being created.
-  protected Element createBranchElement(Element parent, AttributeSet a)
-  {    
-    numBranches ++;
-    if (numBranches == 1)
-      {
-        h2.checkPoint("create first branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 22);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else
-      h2.fail ("too many branch elements created");
-    return super.createBranchElement(parent, a);
-  }
-
-  // Prints some spaces.
-  public static void pad(int pad)
-  {
-    for (int i = 0; i < pad; i++)
-      System.out.print(" ");
-  }
-
-  // Displays the Element hierarchy starting with <code>start</code>.
-  // This is just debugging code.
-  public static void printElements(Element start, int pad)
-  {
-    pad(pad);
-    if (pad == 0)
-      System.out.println("ROOT ELEMENT (" + start.getStartOffset() + ", "
-                         + start.getEndOffset() + ")");
-    else if (start instanceof AbstractDocument.BranchElement)
-      System.out.println("BranchElement (" + start.getStartOffset() + ", "
-                         + start.getEndOffset() + ")");
-    else
-      {
-        try
-          {
-            System.out.println("LeafElement ("
-                               + start.getStartOffset()
-                               + ", "
-                               + start.getEndOffset()
-                               + "): "
-                               + start.getAttributes().getAttributeCount()
-                               + ": "
-                               + start.getDocument().
-                               getText(
-                                       start.getStartOffset(),
-                                       start.getEndOffset()
-                                       - start.getStartOffset()));
-          }
-        catch (BadLocationException ble)
-          {
-          }
-      }
-    for (int i = 0; i < start.getElementCount(); i++)
-      printElements(start.getElement(i), pad + 3);
-  }
-
+  
   // A class to be the buffer of the styled document.
   // This allows us to check that some values are correct internally within
   // the ElementBuffer.
Index: gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure7.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure7.java,v
retrieving revision 1.4
diff -u -r1.4 ElementStructure7.java
--- gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure7.java	23 Jan 2006 21:59:30 -0000	1.4
+++ gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure7.java	6 Feb 2006 15:10:04 -0000
@@ -65,14 +65,10 @@
   
   static TestHarness h2;
   
-  static DefaultDocumentEvent2 docEvent = null;
+  static DefaultDocumentEvent docEvent = null;
 
   static int numInserts = 0;
 
-  static int numLeaves = 0;
-
-  static int numBranches = 0;  
-
   // We override the constructor so we can explicitly set the type of the
   // buffer to be our ElementBuffer2, allowing us to test some internals.
   public ElementStructure7()
@@ -106,176 +102,6 @@
     super.insertUpdate (ev, attr);
   }
 
-  // Overriding this method allows us to check that the proper LeafElements
-  // are being created.
-  protected Element createLeafElement(Element parent, AttributeSet a, int p0,
-                                      int p1)
-  {
-    numLeaves++;
-    if (numLeaves == 1)
-      {
-        h2.checkPoint("create first leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 10);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 20);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("parent Element should have children, but has none.");
-            h2.fail("parent Element should have children, but has none.");
-          }        
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 2)
-      {
-        h2.checkPoint("create second leaf element");
-        h2.check(p0 == 19);
-        h2.check(p1 == 20);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 3)
-      {
-        h2.checkPoint("create third leaf element");
-        h2.check(p0 == 10);
-        h2.check(p1 == 20);
-        try
-        {
-          h2.check(parent.getStartOffset() == 19);
-          h2.check(parent.getEndOffset() == 20);
-        }
-      catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail("parent Element should have children, but has none.");
-          h2.fail("parent Element should have children, but has none.");
-        }
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 4)
-      {
-        h2.checkPoint("create fourth leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 6);
-        try
-        {
-          h2.check(parent.getStartOffset() == 0);
-          h2.check(parent.getEndOffset() == 12);
-        }
-      catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail("parent Element should have children, but has none.");
-          h2.fail("parent Element should have children, but has none.");
-        }
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 5)
-      {
-        h2.checkPoint("create fifth leaf element");
-        h2.check(p0 == 7);
-        h2.check(p1 == 12);
-        h2.check (parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 6)
-      {
-        h2.checkPoint("create sixth leaf element");
-        h2.check(p0 == 6);
-        h2.check(p1 == 12);
-        try
-        {
-          h2.check(parent.getStartOffset() == 7);
-          h2.check(parent.getEndOffset() == 12);
-        }
-      catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail("parent Element should have children, but has none.");
-          h2.fail("parent Element should have children, but has none.");
-        }
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else
-      h2.fail ("too many leaf elements created");
-    return super.createLeafElement(parent, a, p0, p1);
-  }
-
-  // Overriding this method allows us to check that the proper BranchElements
-  // are being created.
-  protected Element createBranchElement(Element parent, AttributeSet a)
-  {    
-    numBranches ++;
-    if (numBranches == 1)
-      {
-        h2.checkPoint("create first branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 20);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numBranches == 2)
-      {
-        h2.checkPoint("create second branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 22);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else
-      h2.fail ("too many branch elements created");
-    return super.createBranchElement(parent, a);
-  }
-
-  // Prints some spaces.
-  public static void pad(int pad)
-  {
-    for (int i = 0; i < pad; i++)
-      System.out.print(" ");
-  }
-
-  // Displays the Element hierarchy starting with <code>start</code>.
-  // This is just debugging code.
-  public static void printElements(Element start, int pad)
-  {
-    pad(pad);
-    if (pad == 0)
-      System.out.println("ROOT ELEMENT (" + start.getStartOffset() + ", "
-                         + start.getEndOffset() + ")");
-    else if (start instanceof AbstractDocument.BranchElement)
-      System.out.println("BranchElement (" + start.getStartOffset() + ", "
-                         + start.getEndOffset() + ")");
-    else
-      {
-        try
-          {
-            System.out.println("LeafElement ("
-                               + start.getStartOffset()
-                               + ", "
-                               + start.getEndOffset()
-                               + "): "
-                               + start.getAttributes().getAttributeCount()
-                               + ": "
-                               + start.getDocument().
-                               getText(
-                                       start.getStartOffset(),
-                                       start.getEndOffset()
-                                       - start.getStartOffset()));
-          }
-        catch (BadLocationException ble)
-          {
-          }
-      }
-    for (int i = 0; i < start.getElementCount(); i++)
-      printElements(start.getElement(i), pad + 3);
-  }
-
   // A class to be the buffer of the styled document.
   // This allows us to check that some values are correct internally within
   // the ElementBuffer.
@@ -354,10 +180,9 @@
     public void insert(int offset, int length, ElementSpec[] data,
                        DefaultDocumentEvent ev)
     {
-      docEvent = new DefaultDocumentEvent2(ev.getOffset(), ev.getLength(),
+      docEvent = new DefaultDocumentEvent(ev.getOffset(), ev.getLength(),
                                            ev.getType());
       super.insert(offset, length, data, docEvent);
-      Vector edits = docEvent.getEdits();
       h2.check(data.length == 4);
       h2.check(data[0].getType() == ElementSpec.ContentType);
       h2.check(data[0].getDirection() == ElementSpec.JoinPreviousDirection);
@@ -367,30 +192,6 @@
       h2.check(data[2].getDirection() == ElementSpec.JoinFractureDirection);
       h2.check(data[3].getType() == ElementSpec.ContentType);
       h2.check(data[3].getDirection() == ElementSpec.JoinNextDirection);
-      h2.check(edits.size(), 3);
-      Object zero = edits.get(0);
-      h2.check(zero instanceof AbstractDocument.ElementEdit);
-      h2.check(((AbstractDocument.ElementEdit) zero).canUndo());
-      Object one = edits.get(1);
-      h2.check(one instanceof AbstractDocument.ElementEdit);
-      h2.check(((AbstractDocument.ElementEdit) one).canUndo());
-      Object two = edits.get(2);
-      h2.check(two instanceof AbstractDocument.ElementEdit);
-      h2.check(((AbstractDocument.ElementEdit) two).canUndo());
-    }
-  }
-  public class DefaultDocumentEvent2 extends DefaultDocumentEvent
-  {
-
-    public DefaultDocumentEvent2(int offset, int length,
-                                 DocumentEvent.EventType type)
-    {
-      super(offset, length, type);
-    }
-
-    public Vector getEdits()
-    {
-      return edits;
     }
   }
 }
Index: gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure8.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure8.java,v
retrieving revision 1.9
diff -u -r1.9 ElementStructure8.java
--- gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure8.java	23 Jan 2006 21:59:30 -0000	1.9
+++ gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementStructure8.java	6 Feb 2006 15:10:04 -0000
@@ -236,7 +236,7 @@
       }
     catch (Exception t)
       {
-        // t.printStackTrace();
+         t.printStackTrace();
         harness.debug(t);
       }
     catch (AssertionError e)
@@ -250,10 +250,6 @@
 
   static int numInserts = 0;
 
-  static int numLeaves = 0;
-
-  static int numBranches = 0;
-
   // We override the constructor so we can explicitly set the type of the
   // buffer to be our ElementBuffer2, allowing us to test some internals.
   public ElementStructure8()
@@ -342,505 +338,6 @@
     super.insertUpdate(ev, attr);
   }
 
-  // Overriding this method allows us to check that the proper LeafElements
-  // are being created.
-  protected Element createLeafElement(Element parent, AttributeSet a, int p0,
-                                      int p1)
-  {
-    numLeaves++;
-    if (numLeaves == 1)
-      {
-        h2.checkPoint("create first leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 21);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 22);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("parent Element should have children, but has none.");
-            h2.fail("parent Element should have children, but has none.");
-          }        
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 2)
-      {
-        h2.checkPoint("create second leaf element");
-        h2.check(p0 == 21);
-        h2.check(p1 == 22);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 3)
-      {
-        h2.checkPoint("create third leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 21);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 65);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("branch element should have children, but has none");
-            h2.fail("branch element should have children, but has none");
-          }
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 4)
-      {
-        h2.checkPoint("create fourth leaf element");
-        h2.check(p0 == 21);
-        h2.check(p1 == 43);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 5)
-      {
-        h2.checkPoint("create fifth leaf element");
-        h2.check(p0 == 43);
-        h2.check(p1 == 65);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 6)
-      {
-        h2.checkPoint("create sixth leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 21);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 22);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("branch element should have children, but has none");
-            h2.fail("branch element should have children, but has none");
-          }
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 7)
-      {
-        h2.checkPoint("create seventh leaf element");
-        h2.check(p0 == 21);
-        h2.check(p1 == 22);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 8)
-      {
-        h2.checkPoint("create eighth leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 21);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 44);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("branch element should have children, but has none");
-            h2.fail("branch element should have children, but has none");
-          }
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 9)
-      {
-        h2.checkPoint("create ninth leaf element");
-        h2.check(p0 == 21);
-        h2.check(p1 == 43);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 10)
-      {
-        h2.checkPoint("create tenth leaf element");
-        h2.check(p0 == 43);
-        h2.check(p1 == 44);
-        try
-          {
-            h2.check(parent.getStartOffset() == 44);
-            h2.check(parent.getEndOffset() == 45);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("branch element should have children, but has none");
-            h2.fail("branch element should have children, but has none");
-          }
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 11)
-      {
-        h2.checkPoint("create eleventh leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 18);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 42);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("branch element should have children, but has none");
-            h2.fail("branch element should have children, but has none");
-          }
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 12)
-      {
-        h2.checkPoint("create twelfth leaf element");
-        h2.check(p0 == 27);
-        h2.check(p1 == 42);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 13)
-      {
-        h2.checkPoint("create thirteenth leaf element");
-        h2.check(p0 == 18);
-        h2.check(p1 == 42);
-        try
-          {
-            h2.check(parent.getStartOffset() == 27);
-            h2.check(parent.getEndOffset() == 42);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("branch element should have children, but has none");
-            h2.fail("branch element should have children, but has none");
-          }
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 14)
-      {
-        h2.checkPoint("create fourteenth leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 21);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 22);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("branch element should have children, but has none");
-            h2.fail("branch element should have children, but has none");
-          }
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 15)
-      {
-        h2.checkPoint("create fifteenth leaf element");
-        h2.check(p0 == 21);
-        h2.check(p1 == 22);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 16)
-      {
-        h2.checkPoint("create sixteenth leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 21);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 67);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("branch element should have children, but has none");
-            h2.fail("branch element should have children, but has none");
-          }
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 17)
-      {
-        h2.checkPoint("create seventeeth leaf element");
-        h2.check(p0 == 21);
-        h2.check(p1 == 22);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 18)
-      {
-        h2.checkPoint("create eighteenth leaf element");
-        h2.check(p0 == 22);
-        h2.check(p1 == 45);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 19)
-      {
-        h2.checkPoint("create nineteenth leaf element");
-        h2.check(p0 == 45);
-        h2.check(p1 == 67);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 20)
-      {
-        h2.checkPoint("create twentieth leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 1);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 47);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("branch element should have children, but has none");
-            h2.fail("branch element should have children, but has none");
-          }
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 21)
-      {
-        h2.checkPoint("create twenty-first leaf element");
-        h2.check(p0 == 1);
-        h2.check(p1 == 24);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 22)
-      {
-        h2.checkPoint("create twenty-second leaf element");
-        h2.check(p0 == 24);
-        h2.check(p1 == 46);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 23)
-      {
-        h2.checkPoint("create twenty-third leaf element");
-        h2.check(p0 == 46);
-        h2.check(p1 == 47);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 24)
-      {
-        h2.checkPoint("create twenty-fourth leaf element");
-        h2.check(p0 == 0);
-        h2.check(p1 == 20);
-        try
-          {
-            h2.check(parent.getStartOffset() == 0);
-            h2.check(parent.getEndOffset() == 41);
-          }
-        catch (Exception e)
-          {
-            // I put 2 fails here so that the total number of tests will remain
-            // the same whether we pass or fail these tests.
-            h2.fail("branch element should have children, but has none");
-            h2.fail("branch element should have children, but has none");
-          }
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 25)
-      {
-        h2.checkPoint("create twenty-fifth leaf element");
-        h2.check(p0 == 20);
-        h2.check(p1 == 21);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 26)
-      {
-        h2.checkPoint("create twenty-sixth leaf element");
-        h2.check(p0 == 21);
-        h2.check(p1 == 41);
-        h2.check(parent.getElementCount() == 0);
-        h2.check(a.getAttributeCount() == 0);
-      }
-
-    else      
-      h2.fail ("too many leaf elements created");
-    return super.createLeafElement(parent, a, p0, p1);
-  }
-
-  // Overriding this method allows us to check that the proper BranchElements
-  // are being created.
-  protected Element createBranchElement(Element parent, AttributeSet a)
-  {    
-    numBranches ++;
-    if (numBranches == 1)
-      {
-        h2.checkPoint("create first branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 22);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numBranches == 2)
-      {
-        h2.checkPoint("create second branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 66);
-        h2.check(a.getAttributeCount() == 0); 
-      }
-    else if (numBranches == 3)
-      {
-        h2.checkPoint("create third branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 66);
-        h2.check(a.getAttributeCount() == 0); 
-      }
-    else if (numBranches == 4)
-      {
-        h2.checkPoint("create fourth branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 22);
-        h2.check(a.getAttributeCount() == 0); 
-      }
-    else if (numBranches == 5)
-      {
-        h2.checkPoint("create fifth branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 45);
-        h2.check(a.getAttributeCount() == 0); 
-      }
-    else if (numBranches == 6)
-      {
-        h2.checkPoint("create sixth branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 42);
-        h2.check(a.getAttributeCount() == 0); 
-      }
-    else if (numBranches == 7)
-      {
-        h2.checkPoint("create seventh branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 22);
-        h2.check(a.getAttributeCount() == 0); 
-      }
-    else if (numBranches == 8)
-      {
-        h2.checkPoint("create eighth branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 68);
-        h2.check(a.getAttributeCount() == 0); 
-      }
-    else if (numBranches == 9)
-      {
-        h2.checkPoint("create ninth branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 68);
-        h2.check(a.getAttributeCount() == 0); 
-      }
-    else if (numBranches == 10)
-      {
-        h2.checkPoint("create tenth branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 68);
-        h2.check(a.getAttributeCount() == 0); 
-      }
-    else if (numBranches == 11)
-      {
-        h2.checkPoint("create eleventh branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 47);
-        h2.check(a.getAttributeCount() == 0); 
-      }
-    else if (numBranches == 12)
-      {
-        h2.checkPoint("create twelfth branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 47);
-        h2.check(a.getAttributeCount() == 0); 
-      }
-    else if (numBranches == 13)
-      {
-        h2.checkPoint("create thirteenth branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 47);
-        h2.check(a.getAttributeCount() == 0); 
-      }
-    else if (numBranches == 14)
-      {
-        h2.checkPoint("create fourteenth branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 41);
-        h2.check(a.getAttributeCount() == 0); 
-      }
-    else if (numBranches == 15)
-      {
-        h2.checkPoint("create fifteenth branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 41);
-        h2.check(a.getAttributeCount() == 0); 
-      }
-    else
-      h2.fail ("too many branch elements created");
-    return super.createBranchElement(parent, a);
-  }
-
-  // Prints some spaces.
-  public static void pad(int pad)
-  {
-    for (int i = 0; i < pad; i++)
-      System.out.print(" ");
-  }
-
-  // Displays the Element hierarchy starting with <code>start</code>.
-  // This is just debugging code.
-  public static void printElements(Element start, int pad)
-  {
-    pad(pad);
-    if (pad == 0)
-      System.out.println("ROOT ELEMENT (" + start.getStartOffset() + ", "
-                         + start.getEndOffset() + ")");
-    else if (start instanceof AbstractDocument.BranchElement)
-      System.out.println("BranchElement (" + start.getStartOffset() + ", "
-                         + start.getEndOffset() + ")");
-    else
-      {
-        try
-          {
-            System.out.println("LeafElement ("
-                               + start.getStartOffset()
-                               + ", "
-                               + start.getEndOffset()
-                               + "): "
-                               + start.getAttributes().getAttributeCount()
-                               + ": "
-                               + start.getDocument().
-                               getText(
-                                       start.getStartOffset(),
-                                       start.getEndOffset()
-                                       - start.getStartOffset()));
-          }
-        catch (BadLocationException ble)
-          {
-          }
-      }
-    for (int i = 0; i < start.getElementCount(); i++)
-      printElements(start.getElement(i), pad + 3);
-  }
-
   // A class to be the buffer of the styled document.
   // This allows us to check that some values are correct internally within
   // the ElementBuffer.
Index: gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument1.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument1.java,v
retrieving revision 1.2
diff -u -r1.2 StyledDocument1.java
--- gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument1.java	23 Jan 2006 18:31:58 -0000	1.2
+++ gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument1.java	6 Feb 2006 15:10:04 -0000
@@ -94,159 +94,6 @@
 
     super.insertUpdate(ev, attr);
   }
-
-  // Overriding this method allows us to check that the proper LeafElements
-  // are being created.
-  protected Element createLeafElement(Element parent, 
-                                      AttributeSet a, int p0, int p1)
-  {
-    numLeaves++;
-    if (numLeaves== 1)
-      {
-        h2.checkPoint ("create first leaf element");
-        h2.check (p0 == 0);
-        h2.check (p1 == 10);
-        try
-        {
-          h2.check (parent.getStartOffset() == 0);
-          h2.check (parent.getEndOffset() == 20);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("parent Element should have children, but has none.");
-          h2.fail ("parent Element should have children, but has none.");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 2)
-      {
-        h2.checkPoint ("create second leaf element");
-        h2.check (p0 == 19);
-        h2.check (p1 == 20);
-        h2.check (parent.getElementCount() == 0);
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 3)
-      {
-        h2.checkPoint ("create third leaf element");
-        h2.check (p0 == 10);
-        h2.check (p1 == 20);
-        try
-        {
-          h2.check (parent.getStartOffset() == 19);
-          h2.check (parent.getEndOffset() == 20);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 4)
-      {
-        h2.checkPoint ("create fourth leaf element");
-        h2.check (p0 == 0);
-        h2.check (p1 == 10);
-        try
-        {
-          h2.check (parent.getStartOffset() == 0);
-          h2.check (parent.getEndOffset() == 11);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 5)
-      {
-        h2.checkPoint ("create fifth leaf element");
-        h2.check (p0 == 10);
-        h2.check (p1 == 21);
-        try
-        {
-          h2.check (parent.getStartOffset() == 11);
-          h2.check (parent.getEndOffset() == 21);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-
-    else
-      h2.fail ("too many leaf elements created");
-    return super.createLeafElement(parent, a, p0, p1);
-  }
-  
-  // Overriding this method allows us to check that the proper BranchElements
-  // are being created.
-  protected Element createBranchElement(Element parent,
-                                        AttributeSet a)
-  {
-    numBranches ++;
-    if (numBranches == 1)
-      {
-        h2.checkPoint("create branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 20);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else
-      h2.fail ("too many branch elements created");
-    return super.createBranchElement(parent, a);
-  }
-  
-  // Prints some spaces.
-  public static void pad(int pad)
-  {
-    for (int i = 0; i < pad; i++)
-      System.out.print(" ");
-  }
-
-  // Displays the Element hierarchy starting with <code>start</code>.
-  // This is just debugging code.
-  public static void printElements (Element start, int pad)
-  {
-    pad(pad);
-    if (pad == 0)
-      System.out.println ("ROOT ELEMENT ("+start.getStartOffset()+", "
-                          + start.getEndOffset()+")");
-    else if (start instanceof AbstractDocument.BranchElement)
-      System.out.println ("BranchElement ("+start.getStartOffset()+", "
-                          + start.getEndOffset()+")");
-    else
-      {
-        try
-          {
-            System.out.println ("LeafElement ("+start.getStartOffset()+", "
-                                + start.getEndOffset()+"): "
-                                + start.getAttributes().getAttributeCount() 
-                                + ": "
-                                + start.getDocument().
-                                getText(start.getStartOffset(), 
-                                        start.getEndOffset() - 
-                                        start.getStartOffset()));
-          }
-        catch (BadLocationException ble)
-          {
-          }
-      }
-    for (int i = 0; i < start.getElementCount(); i ++)
-      printElements (start.getElement(i), pad+3);
-  }
   
   // A class to be the buffer of the styled document that also prints out some 
   // debugging info and checks that internal structure is correct
Index: gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument4.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument4.java,v
retrieving revision 1.2
diff -u -r1.2 StyledDocument4.java
--- gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument4.java	23 Jan 2006 18:31:58 -0000	1.2
+++ gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument4.java	6 Feb 2006 15:10:04 -0000
@@ -96,175 +96,6 @@
     super.insertUpdate(ev, attr);
   }
 
-  // Overriding this method allows us to check that the proper LeafElements
-  // are being created.
-  protected Element createLeafElement(Element parent, 
-                                      AttributeSet a, int p0, int p1)
-  {
-    numLeaves++;
-    if (numLeaves== 1)
-      {
-        h2.checkPoint ("create first leaf element");
-        h2.check (p0 == 0);
-        h2.check (p1 == 10);
-        try
-        {
-          h2.check (parent.getStartOffset() == 0);
-          h2.check (parent.getEndOffset() == 20);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("parent Element should have children, but has none.");
-          h2.fail ("parent Element should have children, but has none.");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 2)
-      {
-        h2.checkPoint ("create second leaf element");
-        h2.check (p0 == 19);
-        h2.check (p1 == 20);
-        h2.check(parent.getElementCount() == 0);
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 3)
-      {
-        h2.checkPoint ("create third leaf element");
-        h2.check (p0 == 10);
-        h2.check (p1 == 20);
-        try
-        {
-          h2.check (parent.getStartOffset() == 19);
-          h2.check (parent.getEndOffset() == 20);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 4)
-      {
-        h2.checkPoint ("create fourth leaf element");
-        h2.check (p0 == 0);
-        h2.check (p1 == 6);
-        try
-        {
-          h2.check (parent.getStartOffset() == 0);
-          h2.check (parent.getEndOffset() == 12);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 5)
-      {
-        h2.checkPoint ("create fifth leaf element");
-        h2.check (p0 == 7);
-        h2.check (p1 == 12);
-        h2.check (parent.getElementCount() == 0);
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 6)
-      {
-        h2.checkPoint ("create sixth leaf element");
-        h2.check (p0 == 6);
-        h2.check (p1 == 12);
-        try
-        {
-          h2.check (parent.getStartOffset() == 7);
-          h2.check (parent.getEndOffset() == 12);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else
-      h2.fail ("too many leaf elements created");
-    return super.createLeafElement(parent, a, p0, p1);
-  }
-  
-  // Overriding this method allows us to check that the proper BranchElements
-  // are being created.
-  protected Element createBranchElement(Element parent,
-                                        AttributeSet a)
-  {
-    numBranches ++;
-    if (numBranches == 1)
-      {
-        h2.checkPoint("create first branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 20);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numBranches == 2)
-      {
-        h2.checkPoint("create second branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 22);
-        h2.check(a.getAttributeCount() == 0);
-      }
-
-    else
-      h2.fail ("too many branch elements created");
-    return super.createBranchElement(parent, a);
-  }
-  
-  // Prints some spaces.
-  public static void pad(int pad)
-  {
-    for (int i = 0; i < pad; i++)
-      System.out.print(" ");
-  }
-
-  // Displays the Element hierarchy starting with <code>start</code>.
-  // This is just debugging code.
-  public static void printElements (Element start, int pad)
-  {
-    pad(pad);
-    if (pad == 0)
-      System.out.println ("ROOT ELEMENT ("+start.getStartOffset()+", "
-                          + start.getEndOffset()+")");
-    else if (start instanceof AbstractDocument.BranchElement)
-      System.out.println ("BranchElement ("+start.getStartOffset()+", "
-                          + start.getEndOffset()+")");
-    else
-      {
-        try
-          {
-            System.out.println ("LeafElement ("+start.getStartOffset()+", "
-                                + start.getEndOffset()+"): "
-                                + start.getAttributes().getAttributeCount() 
-                                + ": "
-                                + start.getDocument().
-                                getText(start.getStartOffset(), 
-                                        start.getEndOffset() - 
-                                        start.getStartOffset()));
-          }
-        catch (BadLocationException ble)
-          {
-          }
-      }
-    for (int i = 0; i < start.getElementCount(); i ++)
-      printElements (start.getElement(i), pad+3);
-  }
-
-
   // A class to be the buffer of the styled document that also prints out some 
   // debugging info and checks that internal structure is correct
   public class ElementBuffer2 extends ElementBuffer
Index: gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument5.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument5.java,v
retrieving revision 1.2
diff -u -r1.2 StyledDocument5.java
--- gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument5.java	23 Jan 2006 18:31:58 -0000	1.2
+++ gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument5.java	6 Feb 2006 15:10:04 -0000
@@ -101,213 +101,6 @@
 
     super.insertUpdate(ev, attr);
   }
-
-  // Overriding this method allows us to check that the proper LeafElements
-  // are being created.
-  protected Element createLeafElement(Element parent, 
-                                      AttributeSet a, int p0, int p1)
-  {
-    numLeaves++;
-    if (numLeaves== 1)
-      {
-        h2.checkPoint ("create first leaf element");
-        h2.check (p0 == 0);
-        h2.check (p1 == 10);
-        try
-        {
-          h2.check (parent.getStartOffset() == 0);
-          h2.check (parent.getEndOffset() == 20);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("parent Element should have children, but has none.");
-          h2.fail ("parent Element should have children, but has none.");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 2)
-      {
-        h2.checkPoint ("create second leaf element");
-        h2.check (p0 == 19);
-        h2.check (p1 == 20);
-        h2.check(parent.getElementCount() == 0);
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 3)
-      {
-        h2.checkPoint ("create third leaf element");
-        h2.check (p0 == 10);
-        h2.check (p1 == 20);
-        try
-        {
-          h2.check (parent.getStartOffset() == 19);
-          h2.check (parent.getEndOffset() == 20);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 4)
-      {
-        h2.checkPoint ("create fourth leaf element");
-        h2.check (p0 == 0);
-        h2.check (p1 == 10);
-        try
-        {
-          h2.check (parent.getStartOffset() == 0);
-          h2.check (parent.getEndOffset() == 11);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 5)
-      {
-        h2.checkPoint ("create fifth leaf element");
-        h2.check (p0 == 10);
-        h2.check (p1 == 21);
-        try
-        {
-          h2.check (parent.getStartOffset() == 11);
-          h2.check (parent.getEndOffset() == 21);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 6)
-      {
-        h2.checkPoint ("create sixth leaf element");
-        h2.check (p0 == 0);
-        h2.check (p1 == 6);
-        try
-        {
-          h2.check (parent.getStartOffset() == 0);
-          h2.check (parent.getEndOffset() == 20);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 7)
-      {
-        h2.checkPoint ("create seventh leaf element");
-        h2.check (p0 == 15);
-        h2.check (p1 == 20);
-        h2.check(parent.getElementCount() == 0);
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 8)
-      {
-        h2.checkPoint ("create eigth leaf element");
-        h2.check (p0 == 6);
-        h2.check (p1 == 20);
-        try
-        {
-          h2.check (parent.getStartOffset() == 15);
-          h2.check (parent.getEndOffset() == 20);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-
-    else
-      h2.fail ("too many leaf elements created");
-    return super.createLeafElement(parent, a, p0, p1);
-  }
-  
-  // Overriding this method allows us to check that the proper BranchElements
-  // are being created.
-  protected Element createBranchElement(Element parent,
-                                        AttributeSet a)
-  {
-    numBranches ++;
-    if (numBranches == 1)
-      {
-        h2.checkPoint("create first branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 20);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numBranches == 2)
-      {
-        h2.checkPoint("create second branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 31);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else
-      h2.fail ("too many branch elements created");
-    return super.createBranchElement(parent, a);
-  }
-  
-  // Prints some spaces.
-  public static void pad(int pad)
-  {
-    for (int i = 0; i < pad; i++)
-      System.out.print(" ");
-  }
-
-  // Displays the Element hierarchy starting with <code>start</code>.
-  // This is just debugging code.
-  public static void printElements (Element start, int pad)
-  {
-    pad(pad);
-    if (pad == 0)
-      System.out.println ("ROOT ELEMENT ("+start.getStartOffset()+", "
-                          + start.getEndOffset()+")");
-    else if (start instanceof AbstractDocument.BranchElement)
-      System.out.println ("BranchElement ("+start.getStartOffset()+", "
-                          + start.getEndOffset()+")");
-    else
-      {
-        try
-          {
-            System.out.println ("LeafElement ("+start.getStartOffset()+", "
-                                + start.getEndOffset()+"): "
-                                + start.getAttributes().getAttributeCount() 
-                                + ": "
-                                + start.getDocument().
-                                getText(start.getStartOffset(), 
-                                        start.getEndOffset() - 
-                                        start.getStartOffset()));
-          }
-        catch (BadLocationException ble)
-          {
-          }
-      }
-    for (int i = 0; i < start.getElementCount(); i ++)
-      printElements (start.getElement(i), pad+3);
-  }
   
   // A class to be the buffer of the styled document that also prints out some 
   // debugging info and checks that internal structure is correct
Index: gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument6.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument6.java,v
retrieving revision 1.2
diff -u -r1.2 StyledDocument6.java
--- gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument6.java	23 Jan 2006 18:31:58 -0000	1.2
+++ gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/StyledDocument6.java	6 Feb 2006 15:10:04 -0000
@@ -118,249 +118,6 @@
     super.insertUpdate(ev, attr);
   }
 
-  // Overriding this method allows us to check that the proper LeafElements
-  // are being created.
-  protected Element createLeafElement(Element parent, 
-                                      AttributeSet a, int p0, int p1)
-  {
-    numLeaves++;
-    if (numLeaves== 1)
-      {
-        h2.checkPoint ("create first leaf element");
-        h2.check (p0 == 0);
-        h2.check (p1 == 3);
-        try
-        {
-          h2.check (parent.getStartOffset() == 0);
-          h2.check (parent.getEndOffset() == 7);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("parent Element should have children, but has none.");
-          h2.fail ("parent Element should have children, but has none.");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 2)
-      {
-        h2.checkPoint ("create second leaf element");
-        h2.check (p0 == 3);
-        h2.check (p1 == 6);
-        try
-        {
-          h2.check (parent.getStartOffset() == 0);
-          h2.check (parent.getEndOffset() == 7);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("parent Element should have children, but has none.");
-          h2.fail ("parent Element should have children, but has none.");
-        }
-        h2.check (a.getAttributeCount() == 1);
-        h2.check (a.getAttribute(StyleConstants.Underline) == Boolean.TRUE);
-      }
-    else if (numLeaves == 3)
-      {
-        h2.checkPoint ("create third leaf element");
-        h2.check (p0 == 6);
-        h2.check (p1 == 7);
-        try
-        {
-          h2.check (parent.getStartOffset() == 0);
-          h2.check (parent.getEndOffset() == 7);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 4)
-      {
-        h2.checkPoint ("create fourth leaf element");
-        h2.check (p0 == 3);
-        h2.check (p1 == 6);
-        try
-        {
-          h2.check (parent.getStartOffset() == 0);
-          h2.check (parent.getEndOffset() == 10);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 1);
-        h2.check (a.getAttribute(StyleConstants.Underline) == Boolean.TRUE);
-        
-      }
-    else if (numLeaves == 5)
-      {
-        h2.checkPoint ("create fifth leaf element");
-        h2.check (p0 == 6);
-        h2.check (p1 == 9);
-        try
-        {
-          h2.check (parent.getStartOffset() == 0);
-          h2.check (parent.getEndOffset() == 10);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 1);
-        h2.check 
-          (a.getAttribute(StyleConstants.StrikeThrough) == Boolean.TRUE);
-      }
-    else if (numLeaves == 6)
-      {
-        h2.checkPoint ("create sixth leaf element");
-        h2.check (p0 == 3);
-        h2.check (p1 == 6);
-        try
-        {
-          h2.check (parent.getStartOffset() == 0);
-          h2.check (parent.getEndOffset() == 12);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 1);
-        h2.check (a.getAttribute(StyleConstants.Underline) == Boolean.TRUE);
-      }
-    else if (numLeaves == 7)
-      {
-        h2.checkPoint ("create seventh leaf element");
-        h2.check (p0 == 7);
-        h2.check (p1 == 8);
-        h2.check(parent.getElementCount() == 0);
-        h2.check (a.getAttributeCount() == 1);
-        h2.check (a.getAttribute(StyleConstants.Underline) == Boolean.TRUE);
-      }
-    else if (numLeaves == 8)
-      {
-        h2.checkPoint ("create eighth leaf element");
-        h2.check (p0 == 8);
-        h2.check (p1 == 11);
-        h2.check (parent.getElementCount() == 0);
-        h2.check (a.getAttributeCount() == 1);
-        h2.check 
-          (a.getAttribute(StyleConstants.StrikeThrough) == Boolean.TRUE);
-      }
-    else if (numLeaves == 9)
-      {
-        h2.checkPoint ("create ninth leaf element");
-        h2.check (p0 == 11);
-        h2.check (p1 == 12);
-        h2.check (parent.getElementCount() == 0);
-        h2.check (a.getAttributeCount() == 0);
-      }
-    else if (numLeaves == 10)
-      {
-        h2.checkPoint ("create tenth leaf element");
-        h2.check (p0 == 6);
-        h2.check (p1 == 8);
-        try
-        {
-          h2.check (parent.getStartOffset() == 7);
-          h2.check (parent.getEndOffset() == 12);
-        }
-        catch (Exception e)
-        {
-          // I put 2 fails here so that the total number of tests will remain
-          // the same whether we pass or fail these tests.
-          h2.fail ("branch element should have children, but has none");
-          h2.fail ("branch element should have children, but has none");
-        }
-        h2.check (a.getAttributeCount() == 1);
-        h2.check (a.getAttribute(StyleConstants.Underline) == Boolean.TRUE);
-      }
-    else
-      h2.fail ("too many leaf elements created");
-    return super.createLeafElement(parent, a, p0, p1);
-  }
-  
-  // Overriding this method allows us to check that the proper BranchElements
-  // are being created.
-  protected Element createBranchElement(Element parent,
-                                        AttributeSet a)
-  {
-    numBranches ++;
-    if (numBranches == 1)
-      {
-        h2.checkPoint("create first branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 12);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else if (numBranches == 2)
-      {
-        h2.checkPoint("create second branch element");
-        h2.check(parent.getStartOffset() == 0);
-        h2.check(parent.getEndOffset() == 31);
-        h2.check(a.getAttributeCount() == 0);
-      }
-    else
-      h2.fail ("too many branch elements created");
-    return super.createBranchElement(parent, a);
-  }
-  
-  // Prints some spaces.
-  public static void pad(int pad)
-  {
-    for (int i = 0; i < pad; i++)
-      System.out.print(" ");
-  }
-
-  // Displays the Element hierarchy starting with <code>start</code>.
-  // This is just debugging code.
-  public static void printElements (Element start, int pad)
-  {
-    pad(pad);
-    if (pad == 0)
-      System.out.println ("ROOT ELEMENT ("+start.getStartOffset()+", "
-                          + start.getEndOffset()+")");
-    else if (start instanceof AbstractDocument.BranchElement)
-      System.out.println ("BranchElement ("+start.getStartOffset()+", "
-                          + start.getEndOffset()+")");
-    else
-      {
-        try
-          {
-            System.out.println ("LeafElement ("+start.getStartOffset()+", "
-                                + start.getEndOffset()+"): "
-                                + start.getAttributes().getAttributeCount() 
-                                + ": "
-                                + start.getDocument().
-                                getText(start.getStartOffset(), 
-                                        start.getEndOffset() - 
-                                        start.getStartOffset()));
-          }
-        catch (BadLocationException ble)
-          {
-          }
-      }
-    for (int i = 0; i < start.getElementCount(); i ++)
-      printElements (start.getElement(i), pad+3);
-  }
-
-  
   // A class to be the buffer of the styled document that also prints out some 
   // debugging info and checks that internal structure is correct
   public class ElementBuffer2 extends ElementBuffer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]