Search in sources :

Example 1 with JpsEncodingConfigurationService

use of org.jetbrains.jps.model.JpsEncodingConfigurationService in project intellij-community by JetBrains.

the class JpsProjectSerializationTest method testLoadEncoding.

public void testLoadEncoding() {
    loadProject(SAMPLE_PROJECT_PATH);
    JpsEncodingConfigurationService service = JpsEncodingConfigurationService.getInstance();
    assertEquals("UTF-8", service.getProjectEncoding(myModel));
    JpsEncodingProjectConfiguration configuration = service.getEncodingConfiguration(myProject);
    assertNotNull(configuration);
    assertEquals("UTF-8", configuration.getProjectEncoding());
    assertEquals("windows-1251", configuration.getEncoding(new File(getAbsolutePath("util"))));
    assertEquals("windows-1251", configuration.getEncoding(new File(getAbsolutePath("util/foo/bar/file.txt"))));
    assertEquals("UTF-8", configuration.getEncoding(new File(getAbsolutePath("other"))));
}
Also used : JpsEncodingConfigurationService(org.jetbrains.jps.model.JpsEncodingConfigurationService) JpsEncodingProjectConfiguration(org.jetbrains.jps.model.JpsEncodingProjectConfiguration) File(java.io.File)

Aggregations

File (java.io.File)1 JpsEncodingConfigurationService (org.jetbrains.jps.model.JpsEncodingConfigurationService)1 JpsEncodingProjectConfiguration (org.jetbrains.jps.model.JpsEncodingProjectConfiguration)1