com.ecfeed.core.operations.MethodOperationRenameTestCases Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ecfeed.junit Show documentation
Show all versions of ecfeed.junit Show documentation
An open library used to connect to the ecFeed service. It can be also used as a standalone testing tool. It is integrated with Junit5 and generates a stream of test cases using a selected algorithm (e.g. Cartesian, N-Wise). There are no limitations associated with the off-line version but the user cannot access the on-line computation servers and the model database.
The newest version!
/*******************************************************************************
*
* Copyright (c) 2016 ecFeed AS.
* 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
*
*******************************************************************************/
package com.ecfeed.core.operations;
import java.util.Collection;
import com.ecfeed.core.model.AbstractNode;
import com.ecfeed.core.model.ModelOperationException;
import com.ecfeed.core.model.TestCaseNode;
import com.ecfeed.core.utils.RegexHelper;
public class MethodOperationRenameTestCases extends BulkOperation {
public MethodOperationRenameTestCases(
Collection testCases,
String newName) throws ModelOperationException {
super(OperationNames.RENAME_TEST_CASE, false, getFirstParent(testCases), getFirstParent(testCases));
if (newName.matches(RegexHelper.REGEX_TEST_CASE_NODE_NAME) == false) {
ModelOperationException.report(OperationMessages.TEST_CASE_NAME_REGEX_PROBLEM);
}
for(TestCaseNode testCase : testCases){
addOperation(FactoryRenameOperation.getRenameOperation(testCase, newName));
}
}
private static AbstractNode getFirstParent(Collection testCases) {
if (testCases.isEmpty()) {
return null;
}
for (TestCaseNode testCaseNode : testCases) {
return testCaseNode.getParent();
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy