org.apache.commons.configuration
Class TestHierarchicalINIConfiguration

java.lang.Object
  extended by org.apache.commons.configuration.TestHierarchicalINIConfiguration

public class TestHierarchicalINIConfiguration
extends Object

Test class for HierarchicalINIConfiguration.

Version:
$Id: TestHierarchicalINIConfiguration.java 1234362 2012-01-21 16:59:48Z oheger $
Author:
Commons Configuration team

Constructor Summary
TestHierarchicalINIConfiguration()
           
 
Method Summary
 void tearDown()
           
 void testGetPropertyNoKey()
          Tests a property that has no key.
 void testGetPropertyNoValue()
          Tests a property that has no value.
 void testGetSectionDuplicate()
          Tests whether getSection() can deal with duplicate sections.
 void testGetSectionExisting()
          Tests querying the properties of an existing section.
 void testGetSectionGloabalMultiThreaded()
          Tests concurrent access to the global section.
 void testGetSectionGlobal()
          Tests querying the content of the global section.
 void testGetSectionGlobalNonExisting()
          Tests querying the content of the global section if there is none.
 void testGetSectionMerged()
          Tests querying the properties of a section that was merged from two sections with the same name.
 void testGetSectionNonExisting()
          Tests querying a non existing section.
 void testGetSectionNonExistingManipulate()
          Tests whether a section that was created by getSection() can be manipulated.
 void testGetSections()
          Test of getSections method, of class HierarchicalINIConfiguration .
 void testGetSectionsAdded()
          Tests whether a section added later is also found by getSections().
 void testGetSectionsDottedVar()
          Tests whether variables containing a dot are not misinterpreted as sections.
 void testGetSectionsGlobalOnly()
          Tests whether the sections of a configuration can be queried that contains only a global section.
 void testGetSectionsNoGlobal()
          Tests querying the sections if there is no global section.
 void testGetSectionsWithGlobal()
          Tests querying the sections if a global section if available.
 void testGlobalProperty()
          Tests reading a property from the global section.
 void testIsCommentLine()
          Test of isCommentLine method, of class HierarchicalINIConfiguration.
 void testIsSectionLine()
          Test of isSectionLine method, of class HierarchicalINIConfiguration.
 void testLineContinuation()
          Tests a property whose value spans multiple lines.
 void testLineContinuationAtEnd()
          Tests a line continuation at the end of the file.
 void testLineContinuationComment()
          Tests a property whose value spans multiple lines with a comment.
 void testLineContinuationEmptyLine()
          Tests a multi-line property value with an empty line.
 void testLineContinuationNone()
          Tests a property value that ends on a backslash, which is no line continuation character.
 void testLineContinuationQuoted()
          Tests a property whose value spans multiple lines when quoting is involved.
 void testLineContinuationQuotedComment()
          Tests a property with a quoted value spanning multiple lines and a comment.
 void testListParsingDisabled()
          Tests whether parsing of lists can be disabled.
 void testLoad()
          Test of load method, of class HierarchicalINIConfiguration.
 void testLoadAlternativeSeparator()
          Tests the load() method when the alternative value separator is used (a ':' for '=').
 void testLoadFile()
          Tests loading a configuration from a File.
 void testLoadFileName()
          Tests loading a configuration from a file name.
 void testLoadURL()
          Tests loading a configuration from a URL.
 void testMergeDuplicateSection()
          Tests whether a duplicate session is merged.
 void testMultipleSeparators()
          Tests property definitions containing multiple separators.
 void testMultipleSeparatorsQuoted()
          Tests property definitions containing multiple separators that are quoted.
 void testQuotedValue()
           
 void testQuotedValueEmpty()
          Tests an empty quoted value.
 void testQuotedValueWithComment()
           
 void testQuotedValueWithQuotes()
           
 void testQuotedValueWithSingleQuotes()
           
 void testQuotedValueWithWhitespace()
          Tests whether whitespace is left unchanged for quoted values.
 void testQuotedValueWithWhitespaceAndComment()
          Tests a quoted value with space and a comment.
 void testSave()
          Test of save method, of class HierarchicalINIConfiguration.
 void testSaveClearedSection()
          Tests whether a section that has been cleared can be manipulated and saved later.
 void testSaveKeysWithDelimiters()
          Tests whether a configuration can be saved that contains section keys with delimiter characters.
 void testSaveWithGlobalSection()
          Tests saving a configuration that contains a global section.
 void testSaveWithOnlyGlobalSection()
          Tests whether a configuration that contains only a global section can be saved correctly.
 void testSeparators()
          Tests whether the different separators with or without whitespace are recognized.
 void testValueWithComment()
           
 void testValueWithDelimiters()
          Tests whether the list delimiter character is recognized.
 void testValueWithSemicolon()
          Tests whether a value which contains a semicolon can be loaded successfully.
 void testWriteValueWithCommentChar()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestHierarchicalINIConfiguration

public TestHierarchicalINIConfiguration()
Method Detail

tearDown

public void tearDown()
              throws Exception
Throws:
Exception

testSave

public void testSave()
              throws Exception
Test of save method, of class HierarchicalINIConfiguration.

Throws:
Exception

testSaveWithGlobalSection

public void testSaveWithGlobalSection()
                               throws ConfigurationException
Tests saving a configuration that contains a global section.

Throws:
ConfigurationException

testSaveWithOnlyGlobalSection

public void testSaveWithOnlyGlobalSection()
                                   throws ConfigurationException
Tests whether a configuration that contains only a global section can be saved correctly.

Throws:
ConfigurationException

testLoad

public void testLoad()
              throws Exception
Test of load method, of class HierarchicalINIConfiguration.

Throws:
Exception

testLoadAlternativeSeparator

public void testLoadAlternativeSeparator()
                                  throws Exception
Tests the load() method when the alternative value separator is used (a ':' for '=').

Throws:
Exception

testLoadFile

public void testLoadFile()
                  throws ConfigurationException,
                         IOException
Tests loading a configuration from a File.

Throws:
ConfigurationException
IOException

testLoadFileName

public void testLoadFileName()
                      throws ConfigurationException,
                             IOException
Tests loading a configuration from a file name.

Throws:
ConfigurationException
IOException

testLoadURL

public void testLoadURL()
                 throws ConfigurationException,
                        IOException
Tests loading a configuration from a URL.

Throws:
ConfigurationException
IOException

testIsCommentLine

public void testIsCommentLine()
Test of isCommentLine method, of class HierarchicalINIConfiguration.


testIsSectionLine

public void testIsSectionLine()
Test of isSectionLine method, of class HierarchicalINIConfiguration.


testGetSections

public void testGetSections()
Test of getSections method, of class HierarchicalINIConfiguration .


testQuotedValue

public void testQuotedValue()
                     throws Exception
Throws:
Exception

testQuotedValueWithQuotes

public void testQuotedValueWithQuotes()
                               throws Exception
Throws:
Exception

testValueWithComment

public void testValueWithComment()
                          throws Exception
Throws:
Exception

testQuotedValueWithComment

public void testQuotedValueWithComment()
                                throws Exception
Throws:
Exception

testQuotedValueWithSingleQuotes

public void testQuotedValueWithSingleQuotes()
                                     throws Exception
Throws:
Exception

testWriteValueWithCommentChar

public void testWriteValueWithCommentChar()
                                   throws Exception
Throws:
Exception

testQuotedValueWithWhitespace

public void testQuotedValueWithWhitespace()
                                   throws Exception
Tests whether whitespace is left unchanged for quoted values.

Throws:
Exception

testQuotedValueWithWhitespaceAndComment

public void testQuotedValueWithWhitespaceAndComment()
                                             throws Exception
Tests a quoted value with space and a comment.

Throws:
Exception

testQuotedValueEmpty

public void testQuotedValueEmpty()
                          throws ConfigurationException
Tests an empty quoted value.

Throws:
ConfigurationException

testGetPropertyNoValue

public void testGetPropertyNoValue()
                            throws ConfigurationException
Tests a property that has no value.

Throws:
ConfigurationException

testGetPropertyNoKey

public void testGetPropertyNoKey()
                          throws ConfigurationException
Tests a property that has no key.

Throws:
ConfigurationException

testGlobalProperty

public void testGlobalProperty()
                        throws ConfigurationException
Tests reading a property from the global section.

Throws:
ConfigurationException

testGetSectionsWithGlobal

public void testGetSectionsWithGlobal()
                               throws ConfigurationException
Tests querying the sections if a global section if available.

Throws:
ConfigurationException

testGetSectionsNoGlobal

public void testGetSectionsNoGlobal()
                             throws ConfigurationException
Tests querying the sections if there is no global section.

Throws:
ConfigurationException

testGetSectionsGlobalOnly

public void testGetSectionsGlobalOnly()
                               throws ConfigurationException
Tests whether the sections of a configuration can be queried that contains only a global section.

Throws:
ConfigurationException

testGetSectionsDottedVar

public void testGetSectionsDottedVar()
                              throws ConfigurationException
Tests whether variables containing a dot are not misinterpreted as sections. This test is related to CONFIGURATION-327.

Throws:
ConfigurationException

testGetSectionsAdded

public void testGetSectionsAdded()
                          throws ConfigurationException
Tests whether a section added later is also found by getSections().

Throws:
ConfigurationException

testGetSectionExisting

public void testGetSectionExisting()
                            throws ConfigurationException
Tests querying the properties of an existing section.

Throws:
ConfigurationException

testGetSectionMerged

public void testGetSectionMerged()
                          throws ConfigurationException
Tests querying the properties of a section that was merged from two sections with the same name.

Throws:
ConfigurationException

testGetSectionGlobal

public void testGetSectionGlobal()
                          throws ConfigurationException
Tests querying the content of the global section.

Throws:
ConfigurationException

testGetSectionGloabalMultiThreaded

public void testGetSectionGloabalMultiThreaded()
                                        throws ConfigurationException,
                                               InterruptedException
Tests concurrent access to the global section.

Throws:
ConfigurationException
InterruptedException

testGetSectionGlobalNonExisting

public void testGetSectionGlobalNonExisting()
                                     throws ConfigurationException
Tests querying the content of the global section if there is none.

Throws:
ConfigurationException

testGetSectionNonExisting

public void testGetSectionNonExisting()
                               throws ConfigurationException
Tests querying a non existing section.

Throws:
ConfigurationException

testLineContinuation

public void testLineContinuation()
                          throws ConfigurationException
Tests a property whose value spans multiple lines.

Throws:
ConfigurationException

testLineContinuationNone

public void testLineContinuationNone()
                              throws ConfigurationException
Tests a property value that ends on a backslash, which is no line continuation character.

Throws:
ConfigurationException

testLineContinuationQuoted

public void testLineContinuationQuoted()
                                throws ConfigurationException
Tests a property whose value spans multiple lines when quoting is involved. In this case whitespace must not be trimmed.

Throws:
ConfigurationException

testLineContinuationComment

public void testLineContinuationComment()
                                 throws ConfigurationException
Tests a property whose value spans multiple lines with a comment.

Throws:
ConfigurationException

testLineContinuationQuotedComment

public void testLineContinuationQuotedComment()
                                       throws ConfigurationException
Tests a property with a quoted value spanning multiple lines and a comment.

Throws:
ConfigurationException

testLineContinuationEmptyLine

public void testLineContinuationEmptyLine()
                                   throws ConfigurationException
Tests a multi-line property value with an empty line.

Throws:
ConfigurationException

testLineContinuationAtEnd

public void testLineContinuationAtEnd()
                               throws ConfigurationException
Tests a line continuation at the end of the file.

Throws:
ConfigurationException

testSaveKeysWithDelimiters

public void testSaveKeysWithDelimiters()
                                throws ConfigurationException
Tests whether a configuration can be saved that contains section keys with delimiter characters. This test is related to CONFIGURATION-409.

Throws:
ConfigurationException

testValueWithSemicolon

public void testValueWithSemicolon()
                            throws ConfigurationException
Tests whether a value which contains a semicolon can be loaded successfully. This test is related to CONFIGURATION-434.

Throws:
ConfigurationException

testSeparators

public void testSeparators()
                    throws ConfigurationException
Tests whether the different separators with or without whitespace are recognized.

Throws:
ConfigurationException

testMultipleSeparators

public void testMultipleSeparators()
                            throws ConfigurationException
Tests property definitions containing multiple separators.

Throws:
ConfigurationException

testMultipleSeparatorsQuoted

public void testMultipleSeparatorsQuoted()
                                  throws ConfigurationException
Tests property definitions containing multiple separators that are quoted.

Throws:
ConfigurationException

testSaveClearedSection

public void testSaveClearedSection()
                            throws ConfigurationException
Tests whether a section that has been cleared can be manipulated and saved later.

Throws:
ConfigurationException

testMergeDuplicateSection

public void testMergeDuplicateSection()
                               throws ConfigurationException
Tests whether a duplicate session is merged.

Throws:
ConfigurationException

testGetSectionNonExistingManipulate

public void testGetSectionNonExistingManipulate()
                                         throws ConfigurationException
Tests whether a section that was created by getSection() can be manipulated.

Throws:
ConfigurationException

testGetSectionDuplicate

public void testGetSectionDuplicate()
Tests whether getSection() can deal with duplicate sections.


testValueWithDelimiters

public void testValueWithDelimiters()
                             throws ConfigurationException
Tests whether the list delimiter character is recognized.

Throws:
ConfigurationException

testListParsingDisabled

public void testListParsingDisabled()
                             throws ConfigurationException
Tests whether parsing of lists can be disabled.

Throws:
ConfigurationException


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.