com.hp.hpl.jena.shared
Class AbstractTestPrefixMapping

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.hp.hpl.jena.test.JenaTestBase
              extended by com.hp.hpl.jena.graph.test.GraphTestBase
                  extended by com.hp.hpl.jena.shared.AbstractTestPrefixMapping
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
TestPrefixMapping

public abstract class AbstractTestPrefixMapping
extends com.hp.hpl.jena.graph.test.GraphTestBase

Test prefix mappings - subclass this test and override getMapping() to deliver the prefixMapping to be tested.

Author:
kers

Constructor Summary
AbstractTestPrefixMapping(java.lang.String name)
           
 
Method Summary
 void testAddDefaultMap()
           
 void testAddMap()
          as for testAddOtherPrefixMapping, except that it's a plain Map we're adding.
 void testAddOtherPrefixMapping()
          test that we can add the maplets from another PrefixMapping without losing our own.
 void testAllowNastyNamespace()
           
 void testCheckNames()
          Test that various illegal names are trapped.
 void testEasyQName()
           
 void testEmptyDoesNotWipeURI()
          Test that the empty prefix does not wipe an existing prefix for the same URI.
 void testEmptyPrefix()
          The empty prefix is specifically allowed [for the default namespace].
 void testEquality()
           
 void testEqualsBase(java.lang.String S, java.lang.String T, boolean expected)
           
 void testExpandPrefix()
           
 void testLock()
           
 void testNoQNameBadLocal()
           
 void testNoQNameNoPrefix()
           
 void testNullURITrapped()
           
 void testPrefixMappingMap()
          test that we can extract a proper Map from a PrefixMapping
 void testPrefixMappingMapping()
          test that a PrefixMapping maps names to URIs.
 void testPrefixMappingSecret()
          test that the Map returned by getNsPrefixMap does not alias (parts of) the secret internal map of the PrefixMapping
 void testQnameFromEmail()
          The tests implied by the email where Chris suggested adding qnameFor; shortForm generates illegal qnames but qnameFor does not.
 void testRemovePrefix()
           
 void testReturnsSelf()
           
 void testReversePrefixMapping()
          Test that we can run the prefix mapping in reverse - from URIs to prefixes.
 void testSameURIKeepsDefault()
          Test that adding a new prefix mapping for U does not throw away a default mapping for U.
 void testSecondPrefixDeletedUncoversPreviousMap()
           
 void testSecondPrefixReplacesReverseMap()
           
 void testSecondPrefixRetainsExistingMap()
           
static void testShortForm(java.lang.String title, PrefixMapping ns)
           
 void testUseEasyPrefix()
           
static void testUseEasyPrefix(java.lang.String title, PrefixMapping ns)
           
 
Methods inherited from class com.hp.hpl.jena.graph.test.GraphTestBase
arrayToSet, assertContains, assertContainsAll, assertEqualsTemplate, assertIsomorphic, assertIsomorphic, assertOmits, assertOmitsAll, contains, getGraph, graphAdd, graphWith, iteratorToList, iteratorToSet, newGraph, nice, node, nodeArray, nodeList, nodeSet, testContains, testContains, testContains, testContains, testOmits, testOmits, testOmits, testOmits, triple, triple, tripleArray, tripleSet
 
Methods inherited from class com.hp.hpl.jena.test.JenaTestBase
append, assertDiffer, assertDiffer, assertHasParent, assertInstanceOf, getConstructor, hasAsParent, isPublicTestMethod, isTestMethod, listOfOne, listOfStrings, listToSet, pass, setOfOne, setOfStrings, testToSilenceJunitComplaintsAboutNoTestMethods
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractTestPrefixMapping

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

testEmptyPrefix

public void testEmptyPrefix()
The empty prefix is specifically allowed [for the default namespace].


testCheckNames

public void testCheckNames()
Test that various illegal names are trapped.


testNullURITrapped

public void testNullURITrapped()

testPrefixMappingMapping

public void testPrefixMappingMapping()
test that a PrefixMapping maps names to URIs. The names and URIs are all fully distinct - overlapping names/uris are dealt with in other tests.


testReversePrefixMapping

public void testReversePrefixMapping()
Test that we can run the prefix mapping in reverse - from URIs to prefixes. uriB is a prefix of uriA to try and ensure that the ordering of the map doesn't matter.


testPrefixMappingMap

public void testPrefixMappingMap()
test that we can extract a proper Map from a PrefixMapping


testPrefixMappingSecret

public void testPrefixMappingSecret()
test that the Map returned by getNsPrefixMap does not alias (parts of) the secret internal map of the PrefixMapping


testExpandPrefix

public void testExpandPrefix()

testUseEasyPrefix

public void testUseEasyPrefix()

testUseEasyPrefix

public static void testUseEasyPrefix(java.lang.String title,
                                     PrefixMapping ns)

testShortForm

public static void testShortForm(java.lang.String title,
                                 PrefixMapping ns)

testEasyQName

public void testEasyQName()

testNoQNameNoPrefix

public void testNoQNameNoPrefix()

testNoQNameBadLocal

public void testNoQNameBadLocal()

testQnameFromEmail

public void testQnameFromEmail()
The tests implied by the email where Chris suggested adding qnameFor; shortForm generates illegal qnames but qnameFor does not.


testAddOtherPrefixMapping

public void testAddOtherPrefixMapping()
test that we can add the maplets from another PrefixMapping without losing our own.


testAddMap

public void testAddMap()
as for testAddOtherPrefixMapping, except that it's a plain Map we're adding.


testAddDefaultMap

public void testAddDefaultMap()

testSecondPrefixRetainsExistingMap

public void testSecondPrefixRetainsExistingMap()

testSecondPrefixReplacesReverseMap

public void testSecondPrefixReplacesReverseMap()

testSecondPrefixDeletedUncoversPreviousMap

public void testSecondPrefixDeletedUncoversPreviousMap()

testEmptyDoesNotWipeURI

public void testEmptyDoesNotWipeURI()
Test that the empty prefix does not wipe an existing prefix for the same URI.


testSameURIKeepsDefault

public void testSameURIKeepsDefault()
Test that adding a new prefix mapping for U does not throw away a default mapping for U.


testReturnsSelf

public void testReturnsSelf()

testRemovePrefix

public void testRemovePrefix()

testEquality

public void testEquality()

testEqualsBase

public void testEqualsBase(java.lang.String S,
                           java.lang.String T,
                           boolean expected)

testAllowNastyNamespace

public void testAllowNastyNamespace()

testLock

public void testLock()


Copyright ? 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP