org.eclipse.emf.test.core.common.util
Class URITest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.eclipse.emf.test.core.common.util.URITest
All Implemented Interfaces:
junit.framework.Test

public class URITest
extends junit.framework.TestCase


Field Summary
protected static java.lang.String[] ABSOLUTE_URLS
           
protected static java.lang.String[] AUTHORITY_PARSE_HOSTS
           
protected static java.lang.String[] AUTHORITY_PARSE_PORTS
           
protected static java.lang.String[] AUTHORITY_PARSE_URIS
           
protected static java.lang.String[] AUTHORITY_PARSE_USER_INFOS
           
protected static java.lang.String[] BAD_JAR_URIS
           
protected static java.lang.String BASE_URI
           
protected static java.lang.String[] ENCODED_PLATFORM_PATH_URIS
           
protected static java.lang.String[] ENCODED_URIS
           
protected static java.lang.String[] ENCODED_URIS_IGNORE_ESCAPED
           
protected static java.lang.String[] FRAGMENTS
           
protected static java.lang.String[] JAR_URIS
           
protected static java.lang.String[] NON_CANONICAL_NO_PRESERVE_ABOVE_ROOT_UNRESOLVED_URIS
           
protected static java.lang.String[] NON_CANONICAL_PRESERVE_ABOVE_ROOT_UNRESOLVED_URIS
           
protected static java.lang.String[] NON_CANONICAL_UNRESOLVED_URIS
           
protected static java.lang.String[] QUERIES
           
protected static java.lang.String[] RELATIVE_URLS
           
protected static java.lang.String[] RESOLVED_NO_PRESERVE_ABOVE_ROOT_URIS
           
protected static java.lang.String[] RESOLVED_PRESERVE_ABOVE_ROOT_URIS
           
protected static java.lang.String[] RESOLVED_URIS
           
protected static java.lang.String[] UNENCODED_PLATFORM_PATHS
           
protected static java.lang.String[] UNENCODED_URIS
           
protected static java.lang.String[] UNRESOLVED_ABOVE_ROOT_URIS
           
protected static java.lang.String[] UNRESOLVED_URIS
           
protected static java.lang.String URN
           
 
Constructor Summary
URITest(java.lang.String name)
           
 
Method Summary
protected  java.lang.String[] getAbsoluteURLs()
           
protected  java.lang.String[] getAllURLs()
           
protected  java.lang.String[] getNonCanonicalUnresolvedURIs(boolean preserve)
           
protected  java.lang.String[] getRelativeURLs()
           
protected  java.lang.String[] getResolvedURIs(boolean preserve)
           
protected  java.lang.String[] getUnresolvedURIs()
           
protected  java.lang.String[] getURNs()
           
static junit.framework.Test suite()
           
 void testAuthorityParse()
          Parses URIs and calls the authority sub-part accessors, comparing with known results.
 void testDeresolve()
          Deresolves URIs against a base, comparing with the known correct results.
 void testEncodeAndDecode()
          Performs automatic encoding of general URIs and platform resource URIs, and decodes the former back, comparing the result to known encoded versions.
 void testFragmentAppendAndTrim()
          Parses a URI with a fragment, appends a fragment to a URI, replaces that fragment with another, then trims the three fragments, comparing the results to the base.
 void testJARParse()
           
 void testParse()
          Parses URIs and converts them back to strings, comparing with the originals.
 void testPlatformURI()
           
 void testResolve()
          Resolves URIs against a base, comparing with the known correct results.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, 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, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

URN

protected static final java.lang.String URN
See Also:
Constant Field Values

ABSOLUTE_URLS

protected static final java.lang.String[] ABSOLUTE_URLS

RELATIVE_URLS

protected static final java.lang.String[] RELATIVE_URLS

QUERIES

protected static final java.lang.String[] QUERIES

FRAGMENTS

protected static final java.lang.String[] FRAGMENTS

BASE_URI

protected static final java.lang.String BASE_URI
See Also:
Constant Field Values

UNRESOLVED_URIS

protected static final java.lang.String[] UNRESOLVED_URIS

RESOLVED_URIS

protected static final java.lang.String[] RESOLVED_URIS

UNRESOLVED_ABOVE_ROOT_URIS

protected static final java.lang.String[] UNRESOLVED_ABOVE_ROOT_URIS

RESOLVED_PRESERVE_ABOVE_ROOT_URIS

protected static final java.lang.String[] RESOLVED_PRESERVE_ABOVE_ROOT_URIS

RESOLVED_NO_PRESERVE_ABOVE_ROOT_URIS

protected static final java.lang.String[] RESOLVED_NO_PRESERVE_ABOVE_ROOT_URIS

NON_CANONICAL_UNRESOLVED_URIS

protected static final java.lang.String[] NON_CANONICAL_UNRESOLVED_URIS

NON_CANONICAL_PRESERVE_ABOVE_ROOT_UNRESOLVED_URIS

protected static final java.lang.String[] NON_CANONICAL_PRESERVE_ABOVE_ROOT_UNRESOLVED_URIS

NON_CANONICAL_NO_PRESERVE_ABOVE_ROOT_UNRESOLVED_URIS

protected static final java.lang.String[] NON_CANONICAL_NO_PRESERVE_ABOVE_ROOT_UNRESOLVED_URIS

AUTHORITY_PARSE_URIS

protected static final java.lang.String[] AUTHORITY_PARSE_URIS

AUTHORITY_PARSE_USER_INFOS

protected static final java.lang.String[] AUTHORITY_PARSE_USER_INFOS

AUTHORITY_PARSE_HOSTS

protected static final java.lang.String[] AUTHORITY_PARSE_HOSTS

AUTHORITY_PARSE_PORTS

protected static final java.lang.String[] AUTHORITY_PARSE_PORTS

JAR_URIS

protected static final java.lang.String[] JAR_URIS

BAD_JAR_URIS

protected static final java.lang.String[] BAD_JAR_URIS

UNENCODED_URIS

protected static final java.lang.String[] UNENCODED_URIS

ENCODED_URIS

protected static final java.lang.String[] ENCODED_URIS

ENCODED_URIS_IGNORE_ESCAPED

protected static final java.lang.String[] ENCODED_URIS_IGNORE_ESCAPED

UNENCODED_PLATFORM_PATHS

protected static final java.lang.String[] UNENCODED_PLATFORM_PATHS

ENCODED_PLATFORM_PATH_URIS

protected static final java.lang.String[] ENCODED_PLATFORM_PATH_URIS
Constructor Detail

URITest

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

suite

public static junit.framework.Test suite()

getURNs

protected java.lang.String[] getURNs()

getAbsoluteURLs

protected java.lang.String[] getAbsoluteURLs()

getRelativeURLs

protected java.lang.String[] getRelativeURLs()

getAllURLs

protected java.lang.String[] getAllURLs()

getUnresolvedURIs

protected java.lang.String[] getUnresolvedURIs()

getResolvedURIs

protected java.lang.String[] getResolvedURIs(boolean preserve)

getNonCanonicalUnresolvedURIs

protected java.lang.String[] getNonCanonicalUnresolvedURIs(boolean preserve)

testParse

public void testParse()
Parses URIs and converts them back to strings, comparing with the originals.


testResolve

public void testResolve()
Resolves URIs against a base, comparing with the known correct results. This tests both preserving and not preserving path segments above root.


testDeresolve

public void testDeresolve()
Deresolves URIs against a base, comparing with the known correct results. This tests both preserving and no preserving path segments above roots, and skips cases where the unresolved URI is non-canonical.


testAuthorityParse

public void testAuthorityParse()
Parses URIs and calls the authority sub-part accessors, comparing with known results.


testJARParse

public void testJARParse()

testFragmentAppendAndTrim

public void testFragmentAppendAndTrim()
Parses a URI with a fragment, appends a fragment to a URI, replaces that fragment with another, then trims the three fragments, comparing the results to the base.


testEncodeAndDecode

public void testEncodeAndDecode()
Performs automatic encoding of general URIs and platform resource URIs, and decodes the former back, comparing the result to known encoded versions.


testPlatformURI

public void testPlatformURI()
                     throws java.lang.Exception
Throws:
java.lang.Exception

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.