blob: 5fed327e471fe82e8fbe7fbe9d3c5e33884cad48 [file] [log] [blame]
/*****************************************************************************
* Copyright (c) 2021 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.model2doc.integration.ieee.requirements.sysml16.odt.architecture.tests;
import org.eclipse.papyrus.junit.utils.rules.PluginResource;
import org.eclipse.papyrus.model2doc.integration.ieee.requirements.sysml16.odt.architecture.utils.IEEEConstants;
import org.eclipse.papyrus.model2doc.integration.ieee.requirements.utils.IEEERequirementsConstants;
import org.eclipse.uml2.uml.Package;
import org.junit.Assert;
import org.junit.Test;
/**
* This class test the creation of the IEEE Template inside an empty SysML model
*/
@SuppressWarnings("nls")
@PluginResource("resources/IEEETemplateCreation/IEEETemplateCreation.di")
public class IEEETemplateCreationTest extends AbstractDocumentTemplateCreationTest {
/**
* creates an IEEE Template
*/
@Test
public void createIEEETemplate() throws Exception {
checkDocumentCreation(IEEEConstants.IEEE_ODT_SYSML_16_TEMPLATE_TYPE);
}
/**
* @see org.eclipse.papyrus.model2doc.integration.ieee.requirements.sysml16.odt.architecture.tests.AbstractDocumentTemplateCreationTest#checkDocumentCreation(java.lang.String)
*
* @param documentType
* @throws Exception
*/
@Override
protected void checkDocumentCreation(String documentType) throws Exception {
final Package pack = this.fixture.getModel();
Assert.assertNull("The IEEE profile must not be applied on the input model", pack.getAppliedProfile(IEEERequirementsConstants.IEEE_PROFILE_NAME));
super.checkDocumentCreation(documentType);
}
/**
* @see org.eclipse.papyrus.model2doc.integration.ieee.requirements.sysml16.odt.architecture.tests.AbstractDocumentTemplateCreationTest#checkModelAfterRedo()
*
*/
@Override
protected void checkModelAfterRedo() {
final Package pack = this.fixture.getModel();
Assert.assertNotNull("The IEEE profile must be re-applied after the redo of the template creation", pack.getAppliedProfile(IEEERequirementsConstants.IEEE_PROFILE_NAME));
}
/**
* @see org.eclipse.papyrus.model2doc.integration.ieee.requirements.sysml16.odt.architecture.tests.AbstractDocumentTemplateCreationTest#checkModelAfterUndo()
*
*/
@Override
protected void checkModelAfterUndo() {
final Package pack = this.fixture.getModel();
Assert.assertNull("The IEEE profile must be un-applied after the undo of the template creation", pack.getAppliedProfile(IEEERequirementsConstants.IEEE_PROFILE_NAME));
}
/**
* @see org.eclipse.papyrus.model2doc.integration.ieee.requirements.sysml16.odt.architecture.tests.AbstractDocumentTemplateCreationTest#checkModelAfterCreation()
*
*/
@Override
protected void checkModelAfterCreation() {
final Package pack = this.fixture.getModel();
Assert.assertNotNull("The IEEE profile must be applied after the template creation", pack.getAppliedProfile(IEEERequirementsConstants.IEEE_PROFILE_NAME));
}
}