Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2015-02-10 10:21:53 +0000
committerCamille Letavernier2015-02-10 10:21:53 +0000
commit9ee85132ae94b2a5bc4c29e28797fd3c16b41a25 (patch)
tree89917ae7cd1f765b6de2af9ed06455f1fdd21e2e
parentcc966f1fceb6476f232a0e56f7d31564ae9689b6 (diff)
downloadorg.eclipse.papyrus-9ee85132ae94b2a5bc4c29e28797fd3c16b41a25.tar.gz
org.eclipse.papyrus-9ee85132ae94b2a5bc4c29e28797fd3c16b41a25.tar.xz
org.eclipse.papyrus-9ee85132ae94b2a5bc4c29e28797fd3c16b41a25.zip
[Tests] Fix errors in test build
-rwxr-xr-xtests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableCreationTest2.java11
-rwxr-xr-xtests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableVerifyContents.java36
2 files changed, 28 insertions, 19 deletions
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableCreationTest2.java b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableCreationTest2.java
index 299f78a157f..8c080566323 100755
--- a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableCreationTest2.java
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableCreationTest2.java
@@ -97,7 +97,7 @@ public class TableCreationTest2 extends AbstractPapyrusTest {
protected static ModelExplorerView view;
@BeforeClass
- public static void init() {
+ public static void init() throws Exception {
try {
initTests(Activator.getDefault().getBundle(), PROJECT_NAME, MODEL_PATH);
} catch (CoreException e) {
@@ -109,7 +109,7 @@ public class TableCreationTest2 extends AbstractPapyrusTest {
}
}
- public static void initTests(final Bundle bundle, final String projectName, final String papyrusModelPath) throws CoreException, IOException, BundleException {
+ public static void initTests(final Bundle bundle, final String projectName, final String papyrusModelPath) throws CoreException, IOException, BundleException, Exception {
ProjectUtils.removeAllProjectFromTheWorkspace();
IProject testProject = houseKeeper.createProject(projectName);
final IFile file = PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, FILE_ROOT_NAME);
@@ -117,7 +117,12 @@ public class TableCreationTest2 extends AbstractPapyrusTest {
@Override
public void run() {
- papyrusEditor = houseKeeper.openPapyrusEditor(file);
+ try {
+ papyrusEditor = houseKeeper.openPapyrusEditor(file);
+ } catch (Exception ex){
+ Activator.log.error(ex);
+ return;
+ }
try {
TableCreationTest2.view = ModelExplorerUtils.openModelExplorerView();
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableVerifyContents.java b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableVerifyContents.java
index 757e2d756de..84e22fd69b0 100755
--- a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableVerifyContents.java
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableVerifyContents.java
@@ -66,7 +66,7 @@ public class TableVerifyContents extends AbstractPapyrusTest {
@ClassRule
public static final HouseKeeper.Static houseKeeper = new HouseKeeper.Static();
-
+
private static final String MODEL_PATH = "/resources/model2"; //$NON-NLS-1$
private static final String SOURCE_PATH = "/resources/"; //$NON-NLS-1$
@@ -114,30 +114,34 @@ public class TableVerifyContents extends AbstractPapyrusTest {
@Override
public void run() {
- papyrusEditor = houseKeeper.openPapyrusEditor(file);
-
+ try {
+ papyrusEditor = houseKeeper.openPapyrusEditor(file);
+ } catch (Exception ex) {
+ Activator.log.error(ex);
+ }
+
try {
TableVerifyContents.view = ModelExplorerUtils.openModelExplorerView();
} catch (PartInitException e) {
setStatus(new Status(IStatus.ERROR, bundle.getSymbolicName(), e.getMessage()));
}
EObject root = ModelExplorerUtils.getRootInModelExplorer(TableVerifyContents.view);
- TableVerifyContents.rootModel = (Model)root;
- subModel = (Model)TableVerifyContents.rootModel.getMember("SubModel1"); //$NON-NLS-1$
+ TableVerifyContents.rootModel = (Model) root;
+ subModel = (Model) TableVerifyContents.rootModel.getMember("SubModel1"); //$NON-NLS-1$
PageList pageList = getPageList(rootModel);
- for(final PageRef pageRef : pageList.getAvailablePage()) {
+ for (final PageRef pageRef : pageList.getAvailablePage()) {
Object identifier = pageRef.getPageIdentifier();
- if(identifier instanceof Diagram) {
- if("ClassDiagram2".equals(((Diagram)identifier).getName())) {
- diagram2 = (Diagram)identifier;
- } else if("ClassDiagram1".equals(((Diagram)identifier).getName())) {
- diagram1 = (Diagram)identifier;
+ if (identifier instanceof Diagram) {
+ if ("ClassDiagram2".equals(((Diagram) identifier).getName())) {
+ diagram2 = (Diagram) identifier;
+ } else if ("ClassDiagram1".equals(((Diagram) identifier).getName())) {
+ diagram1 = (Diagram) identifier;
}
- } else if(identifier instanceof Table) {
- if("TableOfViews0".equals(((Table)identifier).getName())) {
- table1 = (Table)identifier;
+ } else if (identifier instanceof Table) {
+ if ("TableOfViews0".equals(((Table) identifier).getName())) {
+ table1 = (Table) identifier;
}
}
@@ -167,7 +171,7 @@ public class TableVerifyContents extends AbstractPapyrusTest {
*/
private static final PageList getPageList(final EObject object) {
final Resource resource = object.eResource();
- final ModelSet modelSet = (ModelSet)resource.getResourceSet();
+ final ModelSet modelSet = (ModelSet) resource.getResourceSet();
final Resource diResource = modelSet.getAssociatedResource(resource, DiModel.DI_FILE_EXTENSION, false);
final SashWindowsMngr windowMngr = DiUtils.lookupSashWindowsMngr(diResource);
final PageList pageList = windowMngr.getPageList();
@@ -186,7 +190,7 @@ public class TableVerifyContents extends AbstractPapyrusTest {
DisplayUtils.safeReadAndDispatch();
tableEditor = papyrusEditor.getActiveEditor();
Assert.assertTrue(tableEditor instanceof NatTableEditor);
- INattableModelManager manager = (INattableModelManager)tableEditor.getAdapter(INattableModelManager.class);
+ INattableModelManager manager = (INattableModelManager) tableEditor.getAdapter(INattableModelManager.class);
Assert.assertNotNull(manager);
Assert.assertEquals(AllTests.VIEWS_TABLE_ID, manager.getTable().getTableConfiguration().getType());

Back to the top