| /***************************************************************************** |
| * 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 java.util.Collection; |
| |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.util.EcoreUtil; |
| import org.eclipse.papyrus.junit.utils.rules.PluginResource; |
| import org.eclipse.papyrus.model2doc.emf.documentstructuretemplate.TextDocumentTemplate; |
| import org.junit.Assert; |
| import org.junit.Test; |
| |
| /** |
| * This test checked the created Document Structure for IEEE Requirements when the model contains only the Packages |
| */ |
| @SuppressWarnings("nls") |
| @PluginResource("resources/IEEEDocumentStructureCreation/EmptySysMLModel/EmptySysMLModel.pdst") |
| public class IEEEDocumentStructureCreation_EmptySysMLModel_Test extends AbstractTemplateToStructureTests { |
| |
| public static final String EXPECTED_RESOURCE_PATH = PLUGIN_EXPECTED_RESOURCE_PATH + "IEEEDocumentStructureCreation/EmptySysMLModel/expectedOutput/"; |
| |
| @Test |
| public void checkCreatedDocumentStructure() { |
| TextDocumentTemplate textDocumentTemplate = getTextDocumentTemplate("EmptySysMLModel"); |
| Collection<?> commandResult = generateDocumentStructure(textDocumentTemplate); |
| // Test the generated file is the same as the expected one |
| EObject expectedTextDocument = loadExpectedDocumentStructureResource(EXPECTED_RESOURCE_PATH + "EmptySysMLModel.pds"); |
| Assert.assertTrue("The generated DocumentStructure does not match with the expected one", EcoreUtil.equals(expectedTextDocument, (EObject) commandResult.iterator().next())); |
| } |
| |
| |
| } |