Search in sources :

Example 1 with NameAndExtension

use of org.eclipse.n4js.ide.tests.helper.server.TestWorkspaceManager.NameAndExtension in project n4js by eclipse.

the class AbstractIdeTest method createFile.

/**
 * Same as {@link #createFile(FileURI, CharSequence)}, using the {@link #DEFAULT_SOURCE_FOLDER}.
 */
protected void createFile(String projectName, String modulePathAndName, CharSequence content) {
    FileURI projectRoot = toFileURI(getProjectRoot(projectName));
    NameAndExtension nameAndExt = testWorkspaceManager.getN4JSNameAndExtension(modulePathAndName);
    String filePathAndName = nameAndExt.extension == null ? modulePathAndName + "." + TestWorkspaceManager.DEFAULT_EXTENSION : modulePathAndName;
    FileURI fileURI = projectRoot.resolve(DEFAULT_SOURCE_FOLDER).resolve(filePathAndName);
    createFile(fileURI, content);
}
Also used : FileURI(org.eclipse.n4js.workspace.locations.FileURI) NameAndExtension(org.eclipse.n4js.ide.tests.helper.server.TestWorkspaceManager.NameAndExtension)

Aggregations

NameAndExtension (org.eclipse.n4js.ide.tests.helper.server.TestWorkspaceManager.NameAndExtension)1 FileURI (org.eclipse.n4js.workspace.locations.FileURI)1