Skip to content
Snippets Groups Projects
Commit ff1fb8ad authored by Matthias's avatar Matthias
Browse files

Fixed Unit Tests, traceFolder Path fix

parent 5083f008
No related branches found
No related tags found
No related merge requests found
kieker.maxRunTimeInSeconds=10 kieker.log.directory=traceFiles\\
kieker.monitoring.default.properties=META-INF\\kieker.monitoring.default.properties kieker.log.hostname=KIEKER-DEMO-SRV
kieker.kiekerJarFile=kieker-1.12-aspectj.jar \ No newline at end of file
kieker.kiekerLocation=D:\\Master\\GR\\kieker-1.13-SNAPSHOT
kieker.applicationJarFile=test2.jar
kieker.log.directory=staticLog
\ No newline at end of file
...@@ -29,7 +29,7 @@ public class KiekerManagerTest { ...@@ -29,7 +29,7 @@ public class KiekerManagerTest {
EntityMapping request = MappingFactory.eINSTANCE.createEntityMapping(); EntityMapping request = MappingFactory.eINSTANCE.createEntityMapping();
String pathToConfig = "kiekerDqlTest.properties"; String pathToConfig = "dql.properties";
...@@ -89,7 +89,7 @@ public class KiekerManagerTest { ...@@ -89,7 +89,7 @@ public class KiekerManagerTest {
Entity res1 = DomainFactory.eINSTANCE.createEntity(); Entity res1 = DomainFactory.eINSTANCE.createEntity();
res1.setEntityType("SERVICE"); res1.setEntityType("SERVICE");
res1.setAlias("svc1"); res1.setAlias("svc1");
res1.setIdentifier("descartes.atest.App.test1()"); res1.setIdentifier("org.mybatis.jpetstore.web.actions.CatalogActionBean.getItem()");
this.request.setModelLocation(pathToConfig); this.request.setModelLocation(pathToConfig);
this.request.getEntities().add(res1); this.request.getEntities().add(res1);
......
$0=kieker.common.record.misc.KiekerMetadataRecord
$1=kieker.common.record.controlflow.OperationExecutionRecord
$2=kieker.common.record.system.CPUUtilizationRecord
$3=kieker.common.record.system.MemSwapUsageRecord
$4=kieker.common.record.system.LoadAverageRecord
$5=kieker.common.record.jvm.GCRecord
$6=kieker.common.record.jvm.ThreadsStatusRecord
$7=kieker.common.record.jvm.ClassLoadingRecord
$8=kieker.common.record.jvm.CompilationRecord
$9=kieker.common.record.jvm.MemoryRecord
$10=kieker.common.record.system.DiskUsageRecord
$11=kieker.common.record.system.NetworkUtilizationRecord
...@@ -237,11 +237,11 @@ public class KiekerHelper { ...@@ -237,11 +237,11 @@ public class KiekerHelper {
public static Configuration createAnalysisConfig(EntityMapping request, String outputPath, String hostname){ public static Configuration createAnalysisConfig(EntityMapping request, String outputPath, String hostname){
String[] traceFolders = KiekerHelper.getTraceFolders(outputPath); File[] traceFolders = KiekerHelper.getTraceFolders(outputPath);
Configuration readerConfig = new Configuration(); Configuration readerConfig = new Configuration();
for (int i = 0; i< traceFolders.length; i++){ for (int i = 0; i< traceFolders.length; i++){
readerConfig.setProperty("TRACE_"+i, traceFolders[i]); readerConfig.setProperty("TRACE_"+i, traceFolders[i].getAbsolutePath());
} }
for (Entity e : request.getEntities()) { for (Entity e : request.getEntities()) {
...@@ -279,9 +279,9 @@ public class KiekerHelper { ...@@ -279,9 +279,9 @@ public class KiekerHelper {
public static String[] getTraceFolders(String path) { public static File[] getTraceFolders(String path) {
File file = new File(path); File file = new File(path);
String[] directories = file.list(new FilenameFilter() { File[] directories = file.listFiles(new FilenameFilter() {
@Override @Override
public boolean accept(File current, String name) { public boolean accept(File current, String name) {
return new File(current, name).isDirectory(); return new File(current, name).isDirectory();
...@@ -291,14 +291,14 @@ public class KiekerHelper { ...@@ -291,14 +291,14 @@ public class KiekerHelper {
return directories; return directories;
} }
// if no folders found, files might be directly under this path and not in a subfolder // if no folders found, files might be directly under this path and not in a subfolder
String[] files = file.list(new FilenameFilter() { File[] files = file.listFiles(new FilenameFilter() {
@Override @Override
public boolean accept(File current, String name) { public boolean accept(File current, String name) {
return (name.endsWith(".map") || name.endsWith(".dat")); return (name.endsWith(".map") || name.endsWith(".dat"));
} }
}); });
if (files.length > 1){ if (files.length > 1){
directories = new String[]{file.getAbsolutePath()}; directories = new File[]{file};
} }
return directories; return directories;
} }
...@@ -347,7 +347,7 @@ public class KiekerHelper { ...@@ -347,7 +347,7 @@ public class KiekerHelper {
if (!file.exists() || ! file.isDirectory()){ if (!file.exists() || ! file.isDirectory()){
return false; return false;
} }
String[] folders = getTraceFolders(path); File[] folders = getTraceFolders(path);
if (folders.length>0){ if (folders.length>0){
return true; return true;
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment