This repository has been archived by the owner on Apr 3, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11b4c7a
commit f82a5f9
Showing
5 changed files
with
64 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
plugin_ide.core.tests/src-lang/melnorme/lang/ide/core/tests/CoreTestWithProject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2016 Bruno Medeiros and other Contributors. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Bruno Medeiros - initial API and implementation | ||
*******************************************************************************/ | ||
package melnorme.lang.ide.core.tests; | ||
|
||
|
||
import org.eclipse.core.resources.IProject; | ||
import org.eclipse.core.runtime.CoreException; | ||
|
||
import melnorme.lang.ide.core.tests.CommonCoreTest_ActualClass; | ||
import melnorme.utilbox.core.CommonException; | ||
import melnorme.utilbox.ownership.IDisposable; | ||
|
||
public abstract class CoreTestWithProject extends CommonCoreTest_ActualClass { | ||
|
||
public CoreTestWithProject() { | ||
super(); | ||
} | ||
|
||
protected SampleProject sampleProject; | ||
protected IProject project; | ||
|
||
protected SampleProject initSampleProject() throws CoreException, CommonException { | ||
this.sampleProject = new SampleProject(getClass().getSimpleName()); | ||
return setSampleProject(sampleProject); | ||
} | ||
|
||
protected SampleProject setSampleProject(SampleProject sampleProject) { | ||
this.project = sampleProject.getProject(); | ||
|
||
owned.add(new IDisposable() { | ||
@Override | ||
public void dispose() { | ||
try { | ||
sampleProject.cleanUp(); | ||
} catch(CoreException e) { | ||
throw melnorme.utilbox.core.ExceptionAdapter.unchecked(e); | ||
} | ||
} | ||
}); | ||
return sampleProject; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters