org.eclipse.core.tests.resources
Class CharsetTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.eclipse.core.tests.harness.CoreTest
              extended by org.eclipse.core.tests.resources.ResourceTest
                  extended by org.eclipse.core.tests.resources.CharsetTest
All Implemented Interfaces:
junit.framework.Test

public class CharsetTest
extends ResourceTest


Nested Class Summary
 class CharsetTest.CharsetVerifier
           
 
Field Summary
 
Fields inherited from class org.eclipse.core.tests.resources.ResourceTest
deltaListener, PI_RESOURCES_TESTS
 
Fields inherited from class org.eclipse.core.tests.harness.CoreTest
PI_HARNESS
 
Constructor Summary
CharsetTest(java.lang.String name)
           
 
Method Summary
 void _testBug67606()
          See bug 67606.
static junit.framework.Test suite()
           
 void testBug186984()
           
 void testBug261994()
          In this bug, a file starts with a particular content id and content type.
 void testBug59899()
           
 void testBug62732()
           
 void testBug64503()
           
 void testBug94279()
           
 void testChangesDifferentProject()
           
 void testChangesSameProject()
           
 void testClosingAndReopeningProject()
           
 void testContentBasedCharset()
          Tests Content Manager-based charset setting.
 void testDefaults()
           
 void testDeltaOnContentTypeChanges()
           
 void testDeltaOnPreferenceChanges()
           
 void testDeltasContainer()
          Test the contents of the resource deltas which are generated when we make encoding changes to containers (folders, projects, root).
 void testDeltasFile()
          Check that we are broadcasting the correct resource deltas when making encoding changes.
 void testFileCreation()
           
 void testGetCharsetFor()
          See enhancement request 60636.
 void testMovingProject()
          Moves a project and ensures the charsets are preserved.
 void testNonExistingResource()
          Two things to test here: - non-existing resources default to the parent's default charset; - cannot set the charset for a non-existing resource (exception is thrown).
 
Methods inherited from class org.eclipse.core.tests.resources.ResourceTest
assertDoesNotExistInFileSystem, assertDoesNotExistInFileSystem, assertDoesNotExistInFileSystem, assertDoesNotExistInFileSystem, assertDoesNotExistInWorkspace, assertDoesNotExistInWorkspace, assertDoesNotExistInWorkspace, assertDoesNotExistInWorkspace, assertExistsInFileSystem, assertExistsInFileSystem, assertExistsInFileSystem, assertExistsInFileSystem, assertExistsInWorkspace, assertExistsInWorkspace, assertExistsInWorkspace, assertExistsInWorkspace, assertExistsInWorkspace, assertExistsInWorkspace, assertExistsInWorkspace, assertExistsInWorkspace, buildResources, buildResources, compareContent, createFileInFileSystem, createFileInFileSystem, createFileInFileSystem, createFileInFileSystem, createHierarchy, defineHierarchy, ensureDoesNotExistInFileSystem, ensureDoesNotExistInFileSystem, ensureDoesNotExistInWorkspace, ensureDoesNotExistInWorkspace, ensureExistsInFileSystem, ensureExistsInFileSystem, ensureExistsInFileSystem, ensureExistsInWorkspace, ensureExistsInWorkspace, ensureExistsInWorkspace, ensureExistsInWorkspace, ensureOutOfSync, getUniqueString, getWorkspace
 
Methods inherited from class org.eclipse.core.tests.harness.CoreTest
createFileInFileSystem, debug, fail, getContents, getContents, getMonitor, getRandomContents, getRandomLocation, getRandomString, getTempDir, log, log, transferData, transferDataWithoutClose
 
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

CharsetTest

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

suite

public static junit.framework.Test suite()

_testBug67606

public void _testBug67606()
                   throws org.eclipse.core.runtime.CoreException
See bug 67606. TODO enable when bug is fixed

Throws:
org.eclipse.core.runtime.CoreException

testBug59899

public void testBug59899()

testBug62732

public void testBug62732()
                  throws java.io.UnsupportedEncodingException,
                         org.eclipse.core.runtime.CoreException
Throws:
java.io.UnsupportedEncodingException
org.eclipse.core.runtime.CoreException

testBug64503

public void testBug64503()
                  throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

testBug94279

public void testBug94279()
                  throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

testBug186984

public void testBug186984()

testBug261994

public void testBug261994()
                   throws java.io.UnsupportedEncodingException,
                          org.eclipse.core.runtime.CoreException
In this bug, a file starts with a particular content id and content type. It is then deleted and recreated, with the same content id but a different content type. This tricks the content type cache into returning an invalid result.

Throws:
java.io.UnsupportedEncodingException
org.eclipse.core.runtime.CoreException

testChangesDifferentProject

public void testChangesDifferentProject()
                                 throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

testChangesSameProject

public void testChangesSameProject()
                            throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

testClosingAndReopeningProject

public void testClosingAndReopeningProject()
                                    throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

testContentBasedCharset

public void testContentBasedCharset()
                             throws org.eclipse.core.runtime.CoreException,
                                    java.io.UnsupportedEncodingException
Tests Content Manager-based charset setting.

Throws:
org.eclipse.core.runtime.CoreException
java.io.UnsupportedEncodingException

testDefaults

public void testDefaults()
                  throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

testDeltaOnContentTypeChanges

public void testDeltaOnContentTypeChanges()

testDeltaOnPreferenceChanges

public void testDeltaOnPreferenceChanges()

testDeltasContainer

public void testDeltasContainer()
Test the contents of the resource deltas which are generated when we make encoding changes to containers (folders, projects, root).


testDeltasFile

public void testDeltasFile()
Check that we are broadcasting the correct resource deltas when making encoding changes.


testFileCreation

public void testFileCreation()
                      throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

testGetCharsetFor

public void testGetCharsetFor()
                       throws org.eclipse.core.runtime.CoreException
See enhancement request 60636.

Throws:
org.eclipse.core.runtime.CoreException

testMovingProject

public void testMovingProject()
                       throws org.eclipse.core.runtime.CoreException
Moves a project and ensures the charsets are preserved.

Throws:
org.eclipse.core.runtime.CoreException

testNonExistingResource

public void testNonExistingResource()
                             throws org.eclipse.core.runtime.CoreException
Two things to test here: - non-existing resources default to the parent's default charset; - cannot set the charset for a non-existing resource (exception is thrown).

Throws:
org.eclipse.core.runtime.CoreException