Skip to main content
summaryrefslogtreecommitdiffstats
blob: ae6c53803772568a04bd25a2e9ec0aa421913678 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*****************************************************************************
 * Copyright (c) 2015 CEA LIST and others.
 * 
 * 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:
 *  Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
 *   
 *****************************************************************************/

package org.eclipse.papyrus.uml.nattable.tests.tests.configs;

import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.Diagnostician;
import org.eclipse.papyrus.junit.framework.classification.InvalidTest;
import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;

/**
 * Test the genericTreeTable model :
 *  - validate the model
 * 
 * @author Benoit Maggi
 */
public class GenericTreeTableConfigurationTest extends AbstractPapyrusTest{
	
	// path to the model
	public static final String GENERIC_TREE_TABLE_CONFIGURATION_MODEL_PATH = org.eclipse.papyrus.uml.nattable.Activator.PLUGIN_ID+"/configs/genericTreeTable.configuration"; //$NON-NLS-0$
	
	/**
	 * Validate the model with the rules defined in the meta-model tooling
	 */
	@InvalidTest("The current model is not complient with the ecore model")
	@Test
	public void validateGenericTreeTableConfigurationModel() {
		URI createPlatformPluginURI = URI.createPlatformPluginURI(GENERIC_TREE_TABLE_CONFIGURATION_MODEL_PATH, true);
		Resource resource = new ResourceSetImpl().getResource(createPlatformPluginURI, true);
		Diagnostic diagnostic = Diagnostician.INSTANCE.validate(resource.getContents().get(0));
		Assert.assertEquals("The genericTreeTable model is not valid ", Diagnostic.OK, diagnostic.getSeverity());
	}
}

Back to the top