/* Copyright (C) 2008-2009 by Claas Wilke (claaswilke@gmx.net) This file is part of the OCL2 Parser Test Suite of Dresden OCL2 for Eclipse. Dresden OCL2 for Eclipse is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Dresden OCL2 for Eclipse is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Dresden OCL2 for Eclipse. If not, see <http://www.gnu.org/licenses/>. */ package org.dresdenocl.ocl2parser.test.standardlibrary; import org.junit.Ignore; import org.junit.Test; import org.dresdenocl.ocl2parser.test.TestPerformer; /** * <p> * Contains test cases that check that all operations defined on the type String * are parsed appropriately. * </p> * * @author Claas Wilke */ public class TestString { /** * <p> * A test case testing the method <code>String.+(String)</code>. * </p> */ @Test public void testAddPositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/addPositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.+(String)</code>. * </p> */ @Test @Ignore("Postfix syntax for infix operators is currently not possible using EMFText.") public void testAddPositive02() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/addPositive02.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.at(Integer)</code>. * </p> */ @Test public void testAtPositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/atPositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.characters()</code>. * </p> */ @Test public void testCharactersPositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/charactersPositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.concat(String)</code>. * </p> */ @Test public void testConcatPositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/concatPositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.equalsIgnoreCase(String)</code> * . * </p> */ @Test public void testEqualsIgnoreCasePositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/equalsIgnoreCasePositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.>(String)</code> . * </p> */ @Test public void testGreaterThanPositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/greaterThanPositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.>(String)</code> . * </p> */ @Test @Ignore("Postfix syntax for infix operators is currently not possible using EMFText.") public void testGreaterThanPositive02() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/greaterThanPositive02.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.>=(String)</code> . * </p> */ @Test public void testGreaterThanEqualPositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/greaterThanEqualPositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.>=(String)</code> . * </p> */ @Test @Ignore("Postfix syntax for infix operators is currently not possible using EMFText.") public void testGreaterThanEqualPositive02() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/greaterThanEqualPositive02.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.indexOf(String)</code> . * </p> */ @Test public void testIndexOfPositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/indexOfPositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.<(String)</code> . * </p> */ @Test public void testLessThanPositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/lessThanPositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.<(String)</code> . * </p> */ @Test @Ignore("Postfix syntax for infix operators is currently not possible using EMFText.") public void testLessThanPositive02() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/lessThanPositive02.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.<=(String)</code> . * </p> */ @Test public void testLessThanEqualPositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/lessThanEqualPositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.<=(String)</code> . * </p> */ @Test @Ignore("Postfix syntax for infix operators is currently not possible using EMFText.") public void testLessThanEqualPositive02() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/lessThanEqualPositive02.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.size()</code> . * </p> */ @Test public void testSizePositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/sizePositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method * <code>String.substring(Integer, Integer)</code> . * </p> */ @Test public void testSubstringPositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/substringPositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.toBoolean()</code> . * </p> */ @Test public void testToBooleanPositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/toBooleanPositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.toInteger()</code> . * </p> */ @Test public void testToIntegerPositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/toIntegerPositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.toLowerCase()</code> . * </p> */ @Test public void testToLowerCasePositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/toLowerCasePositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.toReal()</code> . * </p> */ @Test public void testToRealPositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/toRealPositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } /** * <p> * A test case testing the method <code>String.toUpperCase()</code> . * </p> */ @Test public void testToUpperCasePositive01() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "standardlibrary/string/toUpperCasePositive01.ocl"; modelFileName = "testmodel.uml"; /* Try to get the TestPerformer. */ testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); /* Try to parse the constraint file. */ testPerformer.parseFile(oclFileName); } }