Running Mauve tests with JUnit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 08, 2006 at 10:40:55AM +0000, David Gilbert wrote:
> I didn't get any feedback about this...anyone think it is a good/bad idea?


excellent idea in my opinion. Have you looked at graydon's junit mauve
bridge at
http://sources.redhat.com/ml/mauve-discuss/2003-q4/msg00003.html ?

If we do something like that. I'd like to see the junit code from
freenet merged in, to keep it simple to run mauve without external
dependencies.

cheers,
dalibor topic


> 
> Regards,
> 
> Dave
> 
> David Gilbert wrote:
> 
> >Hi All,
> >
> >A while back there was some discussion about converting Mauve tests to 
> >run under JUnit.  I did some experimentation and have put together the 
> >following patch that shows one approach to making this work.  I 
> >created a new JUnitRunnable class which makes it possible to run a 
> >Mauve testlet under JUnit (as well as continuing to support the 
> >standard Mauve runners).  It requires that the existing testlets be 
> >modified to 'extend JUnitRunnable' (or, where this isn't possible, an 
> >alternative JUnitWrapper class can be used, see AttributeSetTests.java 
> >for an example).  The patch includes conversion of the tests in the 
> >javax.swing.text.* package so you can at least try it out - if this 
> >patch is approved, I also have done the conversion of all the Swing 
> >tests (roughly 25% of Mauve I think).
> >
> >Here is a link to the patch, it's probably over the size limit for the 
> >mailing list (the ChangeLog entry is at the end of this e-mail):
> >
> >http://www.object-refinery.com/classpath/diff.txt
> >
> >I'm actually indifferent about whether or not this patch is accepted, 
> >I find Mauve slightly easier to work with relative to JUnit for the 
> >type of tests we write for GNU Classpath and plan to continue writing 
> >tests in the Mauve format.  Anyway, here's the pros and cons that I 
> >can think of, please feel free to add to the list:
> >
> >Pros:
> >- JUnit is integrated with Eclipse, so it can be used to run Mauve 
> >tests easily for developers that work in Eclipse;
> >- most Java developers are familiar with JUnit, so Mauve may reach a 
> >wider audience;
> >- other tools can work with JUnit (although I haven't used any of them 
> >- does anyone know of a JUnit runner that can produce comparisons of 
> >two runs? I'm interested in (a) regression reports (e.g. CVS vs last 
> >release) and (b) comparison reports (GNU Classpath vs Sun JDK1.5));
> >
> >Cons:
> >- a lot of work to modify the remaining tests in Mauve;
> >- one extra step to make Mauve tests that run with both JUnit and 
> >Mauve test runners - it's pretty easy, but still a mental step that 
> >new contributors to Mauve will have to learn;
> >- there is a possibility that some developers will write new tests 
> >against JUnit only, so we'll lose the ability to run all tests with 
> >the Mauve runners (which I think provide better detail on failures);
> >
> >Oh, and someone mentioned that the JUnit licence is not GPL 
> >compatible, so I compiled the tests against the GPLed code here:
> >
> >http://cvs.sourceforge.net/viewcvs.py/freenet/Contrib/junit/
> >
> >I had to add a no-arg constructor for the TestCase class, then the 
> >tests compiled OK.  And I can use the SimpleTestRunner to run a single 
> >test (this could do with some more work though).
> >
> >Please comment!
> >
> >Regards,
> >
> >Dave
> >
> >P.S. Here is the ChangeLog entry:
> >
> >2006-03-06  David Gilbert  <david.gilbert@xxxxxxxxxxxxxxxxxxx>
> >
> >   * gnu/testlet/JUnitRunnable.java: New file,
> >   * gnu/testlet/JUnitTestHarness.java: Likewise,
> >   * gnu/testlet/JUnitTestWrapper.java: Likewise,
> >   * gnu/testlet/JUnitWrapper.java: Likewise,
> >   * gnu/testlet/javax/swing/text/PackageTestSuite.java: Likewise,
> >   * 
> >gnu/testlet/javax/swing/text/AbstractDocument/AbstractDocumentTest.java: 
> >Now extends JUnitRunnable,
> >   * 
> >gnu/testlet/javax/swing/text/AbstractDocument/AbstractDocumentTests.java: 
> >New file,
> >   * gnu/testlet/javax/swing/text/AbstractDocument/ElementChange.java: 
> >Now extends JUnitRunnable,
> >   * 
> >gnu/testlet/javax/swing/text/AbstractDocument/ElementChange2.java: 
> >Likewise,
> >   * 
> >gnu/testlet/javax/swing/text/AbstractDocument/BranchElement/BranchElementTest.java: 
> >Updated header,
> >   * 
> >gnu/testlet/javax/swing/text/AbstractDocument/BranchElement/BranchElementTests.java: 
> >New file,
> >   * 
> >gnu/testlet/javax/swing/text/AbstractDocument/BranchElement/getElementIndexNullPointer.java: 
> >Now extends JUnitRunnable,
> >   * gnu/testlet/javax/swing/text/AttributeSet/AttributeSetTests.java: 
> >New file,
> >   * gnu/testlet/javax/swing/text/BoxView/BoxViewTests.java: Likewise,
> >   * gnu/testlet/javax/swing/text/BoxView/spans.java: Now extends 
> >JUnitRunnable,
> >   * 
> >gnu/testlet/javax/swing/text/DefaultEditorKit/DefaultEditorKitTests.java: 
> >New file,
> >   * gnu/testlet/javax/swing/text/DefaultEditorKit/getActions.java: 
> >Now extends JUnitRunnable,
> >   * 
> >gnu/testlet/javax/swing/text/DefaultFormatter/DefaultFormatterTests.java: 
> >New file,
> >   * gnu/testlet/javax/swing/text/DefaultFormatter/getValueClass.java: 
> >Now extends JUnitRunnable,
> >   * 
> >gnu/testlet/javax/swing/text/DefaultStyledDocument/DefaultStyledDocumentTests.java: 
> >New file,
> >   * 
> >gnu/testlet/javax/swing/text/DefaultStyledDocument/insertString.java: 
> >Now extends JUnitRunnable,
> >   * 
> >gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/ElementBufferTests.java: 
> >New file,
> >   * 
> >gnu/testlet/javax/swing/text/DefaultStyledDocument/ElementBuffer/insert.java: 
> >Now extends JUnitRunnable,
> >   * 
> >gnu/testlet/javax/swing/text/ElementIterator/ElementIteratorTest.java: 
> >Likewise,
> >   * 
> >gnu/testlet/javax/swing/text/ElementIterator/ElementIteratorTests.java: 
> >New file,
> >   * gnu/testlet/javax/swing/text/FlowView/FlowViewTests.java: New file,
> >   * gnu/testlet/javax/swing/text/FlowView/getFlowAxis.java: Now 
> >extends JUnitRunnable,
> >   * gnu/testlet/javax/swing/text/GapContent/GapContentTest.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/GapContent/GapContentTests.java: New 
> >file,
> >   * gnu/testlet/javax/swing/text/GapContent/PositionTest.java: Now 
> >extends JUnitRunnable,
> >   * gnu/testlet/javax/swing/text/GapContent/constructors.java: Likewise,
> >   * gnu/testlet/javax/swing/text/GapContent/createPosition.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/GapContent/getChars.java: Likewise,
> >   * gnu/testlet/javax/swing/text/GapContent/getString.java: Likewise,
> >   * gnu/testlet/javax/swing/text/GapContent/insertString.java: Likewise,
> >   * gnu/testlet/javax/swing/text/GapContent/length.java: Likewise,
> >   * gnu/testlet/javax/swing/text/GapContent/remove.java: Likewise,
> >   * 
> >gnu/testlet/javax/swing/text/InternationalFormatter/InternationalFormatterTest.java: 
> >Likewise,
> >   * 
> >gnu/testlet/javax/swing/text/InternationalFormatter/InternationalFormatterTests.java: 
> >New file,
> >   * 
> >gnu/testlet/javax/swing/text/MaskFormatter/MaskFormatterTest.java: Now 
> >extends JUnitRunnable,
> >   * 
> >gnu/testlet/javax/swing/text/MaskFormatter/MaskFormatterTests.java: 
> >New file,
> >   * 
> >gnu/testlet/javax/swing/text/PlainDocument/PlainDocumentTest.java: Now 
> >extends JUnitRunnable,
> >   * 
> >gnu/testlet/javax/swing/text/PlainDocument/PlainDocumentTests.java: 
> >New file,
> >   * gnu/testlet/javax/swing/text/PlainDocument/createPosition.java: 
> >Now extends JUnitRunnable,
> >   * gnu/testlet/javax/swing/text/PlainDocument/getLength.java: Likewise,
> >   * gnu/testlet/javax/swing/text/PlainDocument/getRootElements.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/PlainDocument/getText.java: Likewise,
> >   * gnu/testlet/javax/swing/text/PlainDocument/insertString.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/PlainDocument/multipleLeafs.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/PlainDocument/remove.java: Likewise,
> >   * 
> >gnu/testlet/javax/swing/text/PlainDocument/removeJoinesLines.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/Segment/SegmentTests.java: New file,
> >   * gnu/testlet/javax/swing/text/Segment/clone.java: Now extends 
> >JUnitRunnable,
> >   * gnu/testlet/javax/swing/text/Segment/constructors.java: Likewise,
> >   * gnu/testlet/javax/swing/text/Segment/first.java: Likewise,
> >   * gnu/testlet/javax/swing/text/Segment/getBeginIndex.java: Likewise,
> >   * gnu/testlet/javax/swing/text/Segment/getEndIndex.java: Likewise,
> >   * gnu/testlet/javax/swing/text/Segment/getIndex.java: Likewise,
> >   * gnu/testlet/javax/swing/text/Segment/isPartialReturn.java: Likewise,
> >   * gnu/testlet/javax/swing/text/Segment/last.java: Likewise,
> >   * gnu/testlet/javax/swing/text/Segment/next.java: Likewise,
> >   * gnu/testlet/javax/swing/text/Segment/previous.java: Likewise,
> >   * gnu/testlet/javax/swing/text/Segment/setIndex.java: Likewise,
> >   * gnu/testlet/javax/swing/text/Segment/setPartialReturn.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/Segment/toString(), Likewise,
> >   * 
> >gnu/testlet/javax/swing/text/SimpleAttributeSet/SimpleAttributeSetTests.java: 
> >New file,
> >   * 
> >gnu/testlet/javax/swing/text/StringContent/BadLocationExceptionTest.java: 
> >Now extends JUnitRunnable,
> >   * 
> >gnu/testlet/javax/swing/text/StringContent/StringContentTest.java: 
> >Likewise,
> >   * 
> >gnu/testlet/javax/swing/text/StringContent/StringContentTests.java: 
> >New file,
> >   * gnu/testlet/javax/swing/text/StringContent/constructors.java: Now 
> >extends JUnitRunnable,
> >   * gnu/testlet/javax/swing/text/StringContent/createPosition.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StringContent/getChars.java: Likewise,
> >   * gnu/testlet/javax/swing/text/StringContent/getString.java: Likewise,
> >   * gnu/testlet/javax/swing/text/StringContent/insertString.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StringContent/insertUndo.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StringContent/length.java: Likewise,
> >   * gnu/testlet/javax/swing/text/StringContent/remove.java: Likewise,
> >   * gnu/testlet/javax/swing/text/StringContent/removeUndo.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StringContent/stickyPosition.java: 
> >Likewise,
> >   * 
> >gnu/testlet/javax/swing/text/StyleConstants/StyleConstantsTests.java: 
> >New file,
> >   * gnu/testlet/javax/swing/text/StyleConstants/constants.java: Now 
> >extends JUnitRunnable,
> >   * gnu/testlet/javax/swing/text/StyleConstants/getAlignment.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/getBackground.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/getBidiLevel.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/getComponent.java: 
> >Likewise,
> >   * 
> >gnu/testlet/javax/swing/text/StyleConstants/getFirstLineIndent.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/getFontFamily.java: 
> >Liekwise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/getFontSize.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/getForeground.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/getIcon.java: Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/getLeftIndent.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/getLineSpacing.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/getRightIndent.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/getSpaceAbove.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/getSpaceBelow.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/getTabSet.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/isBold.java: Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/isItalic.java: Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/isStrikeThrough.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/isSubscript.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/isSuperscript.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/isUnderline.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setAlignment.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setBackground.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setBidiLevel.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setBold.java: Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setComponent.java: 
> >Likewise,
> >   * 
> >gnu/testlet/javax/swing/text/StyleConstants/setFirstLineIndent.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setFontFamily.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setFontSize.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setForeground.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setIcon.java: Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setItalic.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setLeftIndent.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setLineSpacing.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setRightIndent.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setSpaceAbove.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setSpaceBelow.java: 
> >Likewise,
> >   * 
> >gnu/testlet/javax/swing/text/StyleConstants/setStrikeThrough.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setSubscript.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setSuperscript.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setTabSet.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleConstants/setUnderline.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleContext/NamedStyleInit.java: 
> >Likewise,
> >   * 
> >gnu/testlet/javax/swing/text/StyleContext/NamedStyleSetResolveParent.java: 
> >Likewise,
> >   * gnu/testlet/javax/swing/text/StyleContext/StyleContextTests.java: 
> >New file,
> >   * gnu/testlet/javax/swing/text/StyleContext/addAttribute.java: Now 
> >extends JUnitRunnable,
> >   * gnu/testlet/javax/swing/text/StyleContext/addStyle.java: Likewise,
> >   * 
> >gnu/testlet/javax/swing/text/StyledEditorKit/StyledEditorKitTests.java: 
> >New file,
> >   * 
> >gnu/testlet/javax/swing/text/StyledEditorKit/createInputAttributesTest.java: 
> >Now extends JUnitRunnable,
> >   * gnu/testlet/javax/swing/text/TextAction/TextActionTests.java: New 
> >file,
> >   * gnu/testlet/javax/swing/text/TextAction/augmentList.java: Now 
> >extends JUnitRunnable,
> >   * gnu/testlet/javax/swing/text/View/ViewTests.java: New file,
> >   * gnu/testlet/javax/swing/text/View/getAlignment.java: Now extends 
> >JUnitRunnable,
> >   * gnu/testlet/javax/swing/text/View/getMaximumSpan.java: Likewise,
> >   * gnu/testlet/javax/swing/text/View/getMinimumSpan.java: Likewise,
> >   * gnu/testlet/javax/swing/text/View/getResizeWeight.java: Likewise.  
> >
> >
> 


[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux