本文整理汇总了Java中net.ssehub.easy.instantiation.core.model.common.VilException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java VilException.printStackTrace方法的具体用法?Java VilException.printStackTrace怎么用?Java VilException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.ssehub.easy.instantiation.core.model.common.VilException
的用法示例。
在下文中一共展示了VilException.printStackTrace方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import net.ssehub.easy.instantiation.core.model.common.VilException; //导入方法依赖的package包/类
/**
* Executes the test.
*
* @param args the first argument shall be the model location
* @throws ModelManagementException in case that obtaining the models fails
* @throws IOException if file operations fail
*/
public static void main(String[] args) throws ModelManagementException, IOException {
if (0 == args.length) {
System.out.println("qualimaster.profile: <model location>");
System.exit(0);
} else {
Properties prop = new Properties();
prop.put(CoordinationConfiguration.PIPELINE_ELEMENTS_REPOSITORY,
"https://projects.sse.uni-hildesheim.de/qm/maven/");
CoordinationConfiguration.configure(prop, false);
File tmp = new File(FileUtils.getTempDirectory(), "qmDebugProfile");
FileUtils.deleteDirectory(tmp);
tmp.mkdirs();
File modelLocation = new File(args[0]);
if (!modelLocation.exists()) {
System.out.println("model location " + modelLocation + " does not exist");
System.exit(0);
}
initialize();
ModelInitializer.registerLoader(ProgressObserver.NO_OBSERVER);
ModelInitializer.addLocation(modelLocation, ProgressObserver.NO_OBSERVER);
Project project = RepositoryHelper.obtainModel(VarModel.INSTANCE, "QM", null);
// create descriptor before clearing the location - in infrastructure pass vil directly/resolve VIL
Configuration monConfig = RepositoryHelper.createConfiguration(project, "MONITORING");
QmProjectDescriptor source = new QmProjectDescriptor(tmp);
try {
ProfileData data = AlgorithmProfileHelper.createProfilePipeline(monConfig, "ProfileTestPip",
"fCorrelationFinancial", "TopoSoftwareCorrelationFinancial", source);
// "fPreprocessor", "Preprocessor", source);
System.out.println("Creation successful. " + data.getPipeline());
} catch (VilException e) {
e.printStackTrace();
}
ModelInitializer.removeLocation(modelLocation, ProgressObserver.NO_OBSERVER);
}
}
示例2: createStringText
import net.ssehub.easy.instantiation.core.model.common.VilException; //导入方法依赖的package包/类
/**
* Creates a new textual representation based on a string.
*
* @param useEmptyString <code>True</code> if the text should be based on an empty string,
* <code>false</code> otherwise
* @param modifiable <code>True</code> if the text should be modifiable, <code>false</code> otherwise
* @return a textual representation of a string.
*/
private Text createStringText(boolean useEmptyString, boolean modifiable) {
Text newText = null;
try {
if (useEmptyString) {
newText = new Text("", modifiable);
} else {
newText = new Text(textString, modifiable);
}
} catch (VilException e) {
e.printStackTrace();
}
return newText;
}
示例3: createFileText
import net.ssehub.easy.instantiation.core.model.common.VilException; //导入方法依赖的package包/类
/**
* Creates a new textual representation based on a file.
*
* @param useEmptyFile <code>True</code> if the text should be based on an empty file, <code>false</code> otherwise
* @param modifiable <code>True</code> if the text should be modifiable, <code>false</code> otherwise
* @return a textual representation of a file.
*/
private Text createFileText(boolean useEmptyFile, boolean modifiable) {
Text newText = null;
try {
if (useEmptyFile) {
newText = new Text(emptyTestFile, modifiable);
} else {
newText = new Text(testFile, modifiable);
}
} catch (VilException e) {
e.printStackTrace();
}
return newText;
}
示例4: substitute
import net.ssehub.easy.instantiation.core.model.common.VilException; //导入方法依赖的package包/类
/**
* Substitutes all occurrences of <code>search</code> by <code>replacement</code> in the given
* text.
*
* @param testObject the text in which <code>search</code> must be substituted
* @param search the regular expression
* @param replacement the replacement-string
* @return <code>True</code> if the substitution is successful, <code>false</code> otherwise
*/
private boolean substitute(Text testObject, String search, String replacement) {
boolean success = false;
try {
Text resultText = testObject.substitute(search, replacement);
success = !containsRegex(resultText, search) && resultText.getText().contains(replacement);
} catch (VilException e) {
e.printStackTrace();
}
return success;
}
示例5: testMatches
import net.ssehub.easy.instantiation.core.model.common.VilException; //导入方法依赖的package包/类
/**
* Tests matching of regular expression and textual representation.
*/
@Test
public void testMatches() {
String regexForString = ".{265}";
String regexForFile = ".{273}";
try {
Assert.assertFalse("successful match in empty, modifiable text",
createEmptyText(true).matches(regexForString));
Assert.assertFalse("successful match in empty, not modifiable text",
createEmptyText(false).matches(regexForString));
Assert.assertFalse("successful match in modifiable text based on empty string",
createStringText(true, true).matches(regexForString));
Assert.assertTrue("no match in modifiable text based on string",
createStringText(false, true).matches(regexForString));
Assert.assertFalse("successful match in not modifiable text based on empty string",
createStringText(true, false).matches(regexForString));
Assert.assertTrue("no match in not modifiable text based on string",
createStringText(false, false).matches(regexForString));
Assert.assertFalse("successful match in modifiable text based on empty file",
createFileText(true, true).matches(regexForFile));
Assert.assertTrue("no match in modifiable text based on file",
createFileText(false, true).matches(regexForFile));
Assert.assertFalse("successful match in not modifiable text based on empty file",
createFileText(true, false).matches(regexForFile));
Assert.assertTrue("no match in not modifiable text based on file",
createFileText(false, false).matches(regexForFile));
} catch (VilException e) {
e.printStackTrace();
}
}
示例6: testRemoveRegex
import net.ssehub.easy.instantiation.core.model.common.VilException; //导入方法依赖的package包/类
/**
* Tests the deletion of the first occurrence of a sub-string
* of a textual representation of an artifact that matches a
* specific regular expression.
*/
@Test
public void testRemoveRegex() {
String regex = "can .* provide";
String removedString = "can be used to provide";
try {
Text artifactText = new Text(testFile, true);
Assert.assertNotNull("text must exist", artifactText);
artifactText.removeAll(regex);
Assert.assertFalse(artifactText.getText().contains(removedString));
} catch (VilException e) {
e.printStackTrace();
}
}
示例7: testModifyMethod
import net.ssehub.easy.instantiation.core.model.common.VilException; //导入方法依赖的package包/类
/**
* Test the modification of methods by deleting java calls within a vil
* script.
*
* @throws IOException
* should not occur
*/
@Test
public void testModifyMethod() throws IOException {
final File expected = new File(getArtifactsFolder(), "classpathTest/src/ModifiedMethodFile.java");
final File expectedCpy = new File(getTempDir(), "ModifiedMethodFile.java");
FileUtils.copyFile(expected, expectedCpy);
try {
DefaultJavaFileArtifactCreator creator = new DefaultJavaFileArtifactCreator();
JavaFileArtifact javaFileArtefact = (JavaFileArtifact) creator.createArtifactInstance(expected, null);
Set<JavaClass> classes = javaFileArtefact.classes();
for (JavaClass javaClass : classes) {
javaClass.notifyChildChanged(javaClass);
javaClass.store();
}
} catch (VilException e) {
e.printStackTrace();
}
assertSelfInstantiate("method", "main", new SelfInstantiationAsserterAdapter() {
@Override
public File determineTestDirectory(File file) {
return new File(file, "classpathTest");
}
@Override
public void assertIn(File base) {
File tempFile = new File(base, "src/MethodFile.java");
assertFileEqualitySafe(tempFile, expected);
}
});
FileUtils.copyFile(expectedCpy, expected);
}
示例8: toString
import net.ssehub.easy.instantiation.core.model.common.VilException; //导入方法依赖的package包/类
@Override
public String toString() {
try {
inferType();
} catch (VilException e) {
e.printStackTrace();
}
return type != null ? type.getName() : "<unknown type>";
}
示例9: visitContentStatement
import net.ssehub.easy.instantiation.core.model.common.VilException; //导入方法依赖的package包/类
@Override
public Object visitContentStatement(ContentStatement cnt) throws VilException {
printIndentation();
String terminal = cnt.getTerminal();
print(terminal);
try {
setInContent(true);
cnt.getContent().accept(this);
setInContent(false);
print(terminal);
boolean semi = false;
LineEndType leType = cnt.getLineEndType();
if (LineEndType.LINE_END == leType) {
print(" <CR>");
semi = true;
} else if (LineEndType.NO_LINE_END == leType) {
print(" !<CR>");
semi = true;
} // no output for default
if (null != cnt.getIndentExpression()) {
print(" | ");
cnt.getIndentExpression().accept(this);
semi = true;
}
if (semi) {
print(";");
}
println();
} catch (VilException e1) {
e1.printStackTrace();
}
return null;
}
示例10: register
import net.ssehub.easy.instantiation.core.model.common.VilException; //导入方法依赖的package包/类
/**
* Registers additional types.
*/
public static void register() {
if (!done) {
done = true;
ITypeAnalyzer old = RtVilTypeRegistry.getTypeAnalyzer();
RtVilTypeRegistry.setTypeAnalyzer(new TypeAnalyzer());
TypeRegistry regSave = ReflectionResolver.setTypeRegistry(RtVilTypeRegistry.INSTANCE);
List<Class<?>> types = new ArrayList<Class<?>>();
types.add(IAdaptationEvent.class);
types.add(LifecycleEvent.class); // inner events are registered automatically
types.add(RegularAdaptationEvent.class);
types.add(Command.class);
types.add(CommandSequence.class);
types.add(AlgorithmChangeCommand.class);
types.add(StartupAdaptationEvent.class);
types.add(IObservable.class);
types.add(TimeBehavior.class);
types.add(ResourceUsage.class);
types.add(FrozenSystemState.class);
types.add(ParameterAdaptationEvent.class);
types.add(ParameterChangeCommand.class);
try {
RtVilTypeRegistry.registerRtTypes(types);
} catch (VilException e) {
e.printStackTrace();
}
RtVilTypeRegistry.setTypeAnalyzer(old);
ReflectionResolver.setTypeRegistry(regSave);
}
}