package jetbrains.mps.lang.test.generator.baseLanguage.template.util;
/*Generated by MPS */
import org.jetbrains.mps.openapi.model.SModel;
import jetbrains.mps.smodel.IOperationContext;
import jetbrains.mps.lang.test.behavior.TestInfo__BehaviorDescriptor;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.apache.log4j.Logger;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SModelOperations;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.baseLanguage.unitTest.behavior.ITestCase__BehaviorDescriptor;
import jetbrains.mps.lang.test.behavior.NodesTestCase__BehaviorDescriptor;
public final class TestsUtil {
private TestsUtil() {
}
/**
*
* @deprecated use {@link jetbrains.mps.lang.test.generator.baseLanguage.template.util.TestsUtil#getProjectPath(SModel) } instead. This method is left for compatibility with mbeddr code that needs to compile against both 2017.1 and 2017.2.
*/
@Deprecated
public static String getProjectPath(SModel model, IOperationContext unused) {
// drop once there's mbeddr branch for 2017.2 and use of the method in com.mbeddr.debugger.tests gone
return getProjectPath(model);
}
public static String getProjectPath(SModel model) {
String projectPath = TestInfo__BehaviorDescriptor.getProjectPath_id4qWC2JVrBcn.invoke(SNodeOperations.asSConcept(MetaAdapterFactory.getConcept(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x46bca02bfb6e730aL, "jetbrains.mps.lang.test.structure.TestInfo")), model);
if (projectPath != null) {
return projectPath;
}
Logger.getLogger(TestsUtil.class).error(String.format("Model %s (from %s) doesn't specify project path in TestInfo!", SModelOperations.getModelName(model), model.getSource()));
return "";
}
public static String getTestBodyClassName(SNode testCase) {
return ITestCase__BehaviorDescriptor.getClassName_idhGBnqtL.invoke(testCase) + "$" + NodesTestCase__BehaviorDescriptor.getTestBodyName_idhOw0ICJ.invoke(SNodeOperations.asSConcept(MetaAdapterFactory.getConcept(0x8585453e6bfb4d80L, 0x98deb16074f1d86cL, 0x11b55b49e46L, "jetbrains.mps.lang.test.structure.NodesTestCase")));
}
}