org.htmlparser.tests.lexerTests
Class AttributeTests

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.htmlparser.tests.ParserTestCase
              extended byorg.htmlparser.tests.lexerTests.AttributeTests
All Implemented Interfaces:
junit.framework.Test

public class AttributeTests
extends ParserTestCase


Field Summary
 
Fields inherited from class org.htmlparser.tests.ParserTestCase
mLexer, node, nodeCount, parser
 
Constructor Summary
AttributeTests(java.lang.String name)
           
 
Method Summary
 void getParameterTableFor(java.lang.String tagContents)
           
 void getParameterTableFor(java.lang.String tagContents, boolean dump)
           
 void testAltAndSrc()
          see bug #778781 SRC-attribute suppression in IMG-tags
 void testAttributeWithSpuriousEqualTo()
          Test attribute containing an equals sign.
 void testConstructors()
          Test constructors.
 void testConstructors2()
          Test constructors.
 void testEmptyAltAndSrc()
          see bug #778781 SRC-attribute suppression in IMG-tags
 void testEmptyTag()
          Check that an empty tag is considered a string node.
 void testIncorrectSpaceKeyBug()
          This is a simulation of a bug reported by Dhaval Udani - wherein a space before the end of the tag causes a problem - there is a key in the table with just a space in it and an empty value
 void testJspWithinAttributes()
          Test attributes when they contain scriptlets.
 void testMissingAttribute()
          Test missing value.
 void testNoSpace()
          see bug #979893 Not Parsing all Attributes
 void testNullTag()
          Test empty attribute.
 void testParseEmptyValues()
          Test empty value.
 void testParseMissingEqual()
          Test no equals or whitespace.
 void testParseParameters()
          Test simple value.
 void testParseTokenValues()
          Test quote value.
 void testPlainParams()
          Test unquoted attributes.
 void testPredicates()
          see bug #911565 isValued() and isNull() don't work
 void testProperties()
          Test bean properties.
 void testProperties2()
          Test bean properties.
 void testQuestionMarksInAttributes()
          Test attribute containing a question mark.
 void testRule1()
          Test Rule 1.
 void testRule2()
          Test Rule 2.
 void testRule3()
          Test Rule 3.
 void testRule4()
          Test Rule 4.
 void testRule5()
          Test Rule 5.
 void testScriptedTag()
          Test Script in attributes.
 void testSetQuote()
          see bug #911565 isValued() and isNull() don't work
 void testSrcAndAlt()
          Test for lost attributes.
 void testSrcAndEmptyAlt()
          see bug #778781 SRC-attribute suppression in IMG-tags
 void testStandaloneAttribute()
          Test that stand-alone attributes are kept that way, rather than being given empty values.
 void testTwoParams()
          Test multiple attributes.
 void testValueMissing()
          Test standalone attribute.
 
Methods inherited from class org.htmlparser.tests.ParserTestCase
assertHiddenIDTagPresent, assertNodeCount, assertNodeCount, assertSameType, assertStringEquals, assertSuperType, assertTagEquals, assertType, assertXmlEquals, createParser, createParser, createParser, createParser, failWithMessage, getParser, main, parse, parseAndAssertNodeCount, parseNodes, removeEscapeCharacters, setParser
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeTests

public AttributeTests(java.lang.String name)
Method Detail

getParameterTableFor

public void getParameterTableFor(java.lang.String tagContents)

getParameterTableFor

public void getParameterTableFor(java.lang.String tagContents,
                                 boolean dump)

testConstructors

public void testConstructors()
Test constructors.


testProperties

public void testProperties()
Test bean properties.


testConstructors2

public void testConstructors2()
Test constructors.


testProperties2

public void testProperties2()
Test bean properties.


testParseParameters

public void testParseParameters()
Test simple value.


testParseTokenValues

public void testParseTokenValues()
Test quote value.


testParseEmptyValues

public void testParseEmptyValues()
Test empty value.


testParseMissingEqual

public void testParseMissingEqual()
Test no equals or whitespace. This might be reason for another rule, since another interpretation would have an attribute called B with a value of "C".


testTwoParams

public void testTwoParams()
Test multiple attributes.


testPlainParams

public void testPlainParams()
Test unquoted attributes.


testValueMissing

public void testValueMissing()
Test standalone attribute.


testIncorrectSpaceKeyBug

public void testIncorrectSpaceKeyBug()
This is a simulation of a bug reported by Dhaval Udani - wherein a space before the end of the tag causes a problem - there is a key in the table with just a space in it and an empty value


testNullTag

public void testNullTag()
Test empty attribute.


testAttributeWithSpuriousEqualTo

public void testAttributeWithSpuriousEqualTo()
Test attribute containing an equals sign.


testQuestionMarksInAttributes

public void testQuestionMarksInAttributes()
Test attribute containing a question mark.


testEmptyTag

public void testEmptyTag()
Check that an empty tag is considered a string node. Believe it or not Moi (vincent_aumont) wants htmlparser to parse a text file containing something that looks nearly like a tag:
 "basic_string<char, string_char_traits<char>, <>>::basic_string()"
 
This was throwing a null pointer exception when the empty <> was encountered. Bug #725420 NPE in StringBean.visitTag


testJspWithinAttributes

public void testJspWithinAttributes()
Test attributes when they contain scriptlets. Submitted by Cory Seefurth See also feature request #725376 Handle script in attributes.


testScriptedTag

public void testScriptedTag()
Test Script in attributes. See feature request #725376 Handle script in attributes.


testStandaloneAttribute

public void testStandaloneAttribute()
Test that stand-alone attributes are kept that way, rather than being given empty values. -Joe Robins, 6/19/03


testMissingAttribute

public void testMissingAttribute()
Test missing value.


testRule1

public void testRule1()
Test Rule 1. See discussion in Bug#891058 Bug in lexer. regarding alternate interpretations.


testRule2

public void testRule2()
Test Rule 2.


testRule3

public void testRule3()
Test Rule 3.


testRule4

public void testRule4()
Test Rule 4. See discussion in Bug#891058 Bug in lexer. regarding alternate interpretations.


testRule5

public void testRule5()
Test Rule 5. See discussion in Bug#891058 Bug in lexer. regarding alternate interpretations.


testSrcAndAlt

public void testSrcAndAlt()
                   throws ParserException
Test for lost attributes. see bug #778781 SRC-attribute suppression in IMG-tags & #753012 IMG SRC not parsed v1.3 & v1.4 & #755929 Empty string attr. value causes attr parsing to be stopped & #778781 SRC-attribute suppression in IMG-tags & #832530 empty attribute causes parser to fail & #851882 zero length alt tag causes bug in ImageScanner HTML before parse: first" third HTML after parse: first third

Throws:
ParserException

testSrcAndEmptyAlt

public void testSrcAndEmptyAlt()
                        throws ParserException
see bug #778781 SRC-attribute suppression in IMG-tags

Throws:
ParserException

testAltAndSrc

public void testAltAndSrc()
                   throws ParserException
see bug #778781 SRC-attribute suppression in IMG-tags

Throws:
ParserException

testEmptyAltAndSrc

public void testEmptyAltAndSrc()
                        throws ParserException
see bug #778781 SRC-attribute suppression in IMG-tags

Throws:
ParserException

testPredicates

public void testPredicates()
                    throws ParserException
see bug #911565 isValued() and isNull() don't work

Throws:
ParserException

testSetQuote

public void testSetQuote()
                  throws ParserException
see bug #911565 isValued() and isNull() don't work

Throws:
ParserException

testNoSpace

public void testNoSpace()
                 throws ParserException
see bug #979893 Not Parsing all Attributes

Throws:
ParserException