AccessAsciiArt.java revision 181
/*
* Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 4706779 4956908
* @summary Add text equivalent of class tree ASCII art for accessibility
* @author dkramer
* @run main AccessAsciiArt
*/
/**
* Runs javadoc and runs regression tests on the resulting HTML.
* It reads each file, complete with newlines, into a string to easily
* find strings that contain newlines.
*/
public class AccessAsciiArt {
// Subtest number. Needed because runResultsOnHTML is run twice,
// and subtestNum should increment across subtest runs.
public static int subtestNum = 0;
public static int numSubtestsPassed = 0;
// Entry point
// Directory that contains source files that javadoc runs on
// Test for all cases except the split index page
"-sourcepath", srcdir,
"p1", "p1.subpkg"});
printSummary();
}
/** Run javadoc */
throw new Error("Javadoc failed to execute");
}
}
/**
* Assign value for [ stringToFind, filename ]
* NOTE: The standard doclet uses the same separator "\n" for all OS's
*/
// Test the top line of the class tree
{
" <IMG SRC=\"../../resources/inherit.gif\" ALT=\"extended by \"><A HREF=\"../../p1/C.html\" title=\"class in p1\">p1.C</A>",
// Test the second line of the class tree
{
" <IMG SRC=\"../../resources/inherit.gif\" ALT=\"extended by \"><A HREF=\"../../p1/SC.html\" title=\"class in p1\">p1.SC</A>",
// Test the third line of the class tree
{
" <IMG SRC=\"../../resources/inherit.gif\" ALT=\"extended by \"><STRONG>p1.subpkg.SSC</STRONG>",
};
subtestNum += 1;
// Read contents of file into a string
// Get string to find
// Find string in file's contents
+ "when searching for:\n"
+ stringToFind);
} else {
numSubtestsPassed += 1;
}
}
}
public static void printSummary() {
if ( numSubtestsPassed == subtestNum ) {
} else {
}
}
// Read the file into a String
try {
}
// Create an array of characters the size of the file
// Read the characters into the allChars array
// Convert to a string
return allCharsString;
} catch (FileNotFoundException e) {
return "";
} catch (IOException e) {
return "";
}
}
}
}