JavadocTest.java - import static org.junit.Assert import...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
import static org.junit.Assert.*; import org.junit.Test; /** * Hello, students! * * If you're seeing this message, you've double-clicked into the code-view * of this testing module. You sohuld find that when it is compiled, * the BlueJ 'Integrated Development Environment' turns JavadocTest * into a green box. When the green-box is right-clicked for contextual options, * "Test All" is one such option presented to you. Choose that to have * the javadocumentation in your code evaluated. * * This evaluation that you will receive is delivered via the 'JUnit' * pass-or-fail system. It should produce a pop-up window with the name * of the evaluation method ("evaluateFilesInThisFolder"), preceded by * a green checkmark, a red X, or a grey X. An X result should be expected * while you are learning. The conditions for success are quite demanding. * * In fact, when you use this module -- this one specifically -- you are * welcome to view the results with mistrust. JavadocTest was not meant * as an ultimate authority: Your final grade may be affected by the * deductions this module suggests, but the only true evaluators are your * instructor or Teaching Assistant. The tool itself is intentionally * flawed; it performs some language processing, which is not an area * that computers currently excel at. * * You may find that you can deceive the tool by adopting unexpected * programming styles, and there will be other times where the tool fails, * but the reason will not be apparent. It is your marker's responsibility * to review all of your code for mistakes, just as this is also your * responsibility. If you can't overcome a problem that the tool reports, * send e-mail to your T.A., with the code included somehow. Together, * you will learn what has to be learned to produce the best results. * [Just don't wait to the last minute! :-D] * * If you feel especially confident in your understanding of the Java * language, read ahead to the in-line commentary in this module. * An effort has been made to explain the operation of the JavadocTest tool, * including some assumptions that may not be true. * * @author James Pede [[email protected]] * @version Jul8'15,2139h Scanner.next() no longer crashes when odd character sets are employed. */
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
public class JavadocTest implements java.io.FilenameFilter { // Windows and Macintosh systems use their own, unique set of 'invisible letters' // to visually create a 'carriage-return, line-feed' effect [or, if you prefer, 'enter']. // A program needs to know the exact sequence used, and that information can't be hard-coded. // Fortunately, this is the kind of information that the Java language always knows for us. private final static String NEWLINE_CHAR = System.getProperties().getProperty("line.separator"); /** * The test module is, itself, a file filter -- * processing only those files in the folder JavadocTest occupies * ending in the file extension ".java".
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern