org.newsml.toolkit.conformance
Class FormalNameTest

java.lang.Object
  |
  +--org.newsml.toolkit.conformance.TestBase
        |
        +--org.newsml.toolkit.conformance.FormalNameTest

public class FormalNameTest
extends TestBase

FormalName-specific conformance tests.

This class tests that a FormalNameNode has a vocabulary (either explicit or defaulted), and, if possible, confirms that the formal name appears in that vocabulary. It is possible to pass on option to the constructor to disable the error report if a vocabulary is not available (for NewsItemId and ProviderId).

Version:
2.0
Author:
Reuters PLC
See Also:
NewsMLTestManager

Constructor Summary
FormalNameTest()
          Default constructor.
FormalNameTest(boolean requireVocab)
          Constructor.
 
Method Summary
 void run(BaseNode node, boolean useExternal)
          Run tests for a FormalNameNode.
 
Methods inherited from class org.newsml.toolkit.conformance.TestBase
error, internal, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormalNameTest

public FormalNameTest()
Default constructor.

By default, the test will report an error if a vocabulary is not specified for the formal name.


FormalNameTest

public FormalNameTest(boolean requireVocab)
Constructor.
Parameters:
requireVocab - true if the test should report an error if a vocabulary is not specified, false otherwise.
Method Detail

run

public void run(BaseNode node,
                boolean useExternal)
         throws NewsMLException
Run tests for a FormalNameNode.
Overrides:
run in class TestBase
Parameters:
node - A FormalNameNode.
useExternal - Not used.
Throws:
NewsMLException - If the test fails.
java.lang.ClassCastException - If the node parameter is not an instance of FormalNameNode.
See Also:
TestBase.run(org.newsml.toolkit.BaseNode, boolean)