public void checkSmallJavaPrograms(final String program1, final String program2, final int expectedErrors) { try { final IFile file1 = IResourcesSetupUtil.createFile((this.TEST_PROJECT + "/src/test1.smalljava"), program1); final IFile file2 = IResourcesSetupUtil.createFile((this.TEST_PROJECT + "/src/test2.smalljava"), program2); IResourcesSetupUtil.waitForAutoBuild(); IMarker[] _findMarkers = file1.findMarkers(EValidator.MARKER, true, IResource.DEPTH_INFINITE); int _size = ((List<IMarker>)Conversions.doWrapArray(_findMarkers)).size(); Assert.assertEquals(expectedErrors, _size); IMarker[] _findMarkers_1 = file2.findMarkers(EValidator.MARKER, true, IResource.DEPTH_INFINITE); int _size_1 = ((List<IMarker>)Conversions.doWrapArray(_findMarkers_1)).size(); Assert.assertEquals(expectedErrors, _size_1); } catch (Throwable _e) { throw Exceptions.sneakyThrow(_e); } }
@BeforeClass public static void setUp(){ TFSM_PlainK3ExampleWizard sample = new TFSM_PlainK3ExampleWizard(); sample.performFinish(); wsRoot = ResourcesPlugin.getWorkspace().getRoot(); IResourcesSetupUtil.waitForAutoBuild(); }
@BeforeClass public static void setUp(){ SigPMLExampleWizard sample = new SigPMLExampleWizard(); sample.performFinish(); wsRoot = ResourcesPlugin.getWorkspace().getRoot(); IResourcesSetupUtil.waitForAutoBuild(); }
@BeforeClass public static void setUp(){ TFSMExampleWizard sample = new TFSMExampleWizard(); sample.performFinish(); wsRoot = ResourcesPlugin.getWorkspace().getRoot(); IResourcesSetupUtil.waitForAutoBuild(); }
/** * Clean up after all tests have terminated. */ @AfterClass public static void cleanUp() { try { IResourcesSetupUtil.cleanWorkspace(); } catch (CoreException e) { LOGGER.error(e.getMessage(), e); } }
/** {@inheritDoc} */ @Override public void setup(final Iterable<? extends TestSource> initialSources) { try { IResourcesSetupUtil.waitForAutoBuild(); createPluginProject(injector, TEST_PROJECT_NAME); } catch (CoreException e) { throw new IllegalStateException("Failed to create plugin project"); } }
public void checkEntityProgram(final String contents, final int expectedErrors) { try { final IFile file = IResourcesSetupUtil.createFile((this.TEST_PROJECT + "/src/test.entities"), contents); IResourcesSetupUtil.waitForAutoBuild(); IMarker[] _findMarkers = file.findMarkers(EValidator.MARKER, true, IResource.DEPTH_INFINITE); int _size = ((List<IMarker>)Conversions.doWrapArray(_findMarkers)).size(); Assert.assertEquals(expectedErrors, _size); } catch (Throwable _e) { throw Exceptions.sneakyThrow(_e); } }
public IFile createTestFile(final String contents) { try { return IResourcesSetupUtil.createFile((this.TEST_PROJECT + "/src/test.entities"), contents); } catch (Throwable _e) { throw Exceptions.sneakyThrow(_e); } }
/** {@inheritDoc} */ @Override public void build() { IResourcesSetupUtil.waitForAutoBuild(); }
/** * Initializes a project with the given name, required bundles and sources. * * @param projectName * the name of the project * @param folders * the folders to create (source and source-generated folders will be created unless methods are overridden and specified as null or empty), or * {@code null} if none * @param requiredBundles * required bundles of the project to be created, or {@code null} if none * @param importedPackages * imported packages of the project to be created, or {@code null} if none * @param exportedPackages * exported packages of the project to be created, or {@code null} if none * @param sourceFileNames * the source file names, mapping input filename to output filename * @throws CoreException * the {@link CoreException} */ public void initializeProject(final String projectName, final List<String> folders, final List<String> requiredBundles, final List<String> importedPackages, final List<String> exportedPackages, final ImmutableMap<String, String> sourceFileNames) throws CoreException { // a project must be created createPluginProject(projectName, folders, requiredBundles, importedPackages, exportedPackages); // sources are copied into the project and then built by the Xtext builder addSourcesToWorkspace(projectName, sourceFileNames); // wait for build to finish, otherwise included catalog may not be resolvable IResourcesSetupUtil.waitForAutoBuild(); }
/** * Creates a file with given name and contents. * * @param fileName * the file name * @param content * the file content * @return the file * @throws Exception * the exception */ public IFile createFile(final String fileName, final String content) throws Exception { // NOPMD String fullFileName = getFullFileName(fileName); IFile file = IResourcesSetupUtil.createFile(fullFileName, content); getFiles().add(file); return file; }