Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Fix test case
  • Loading branch information
fangyiwang committed May 22, 2017
1 parent 322119d commit c9715241cfb24954f423099e94c053f7cc37ad2a
Showing 3 changed files with 9 additions and 9 deletions.
@@ -564,12 +564,13 @@
<include>**/Test*.java</include>
</includes>
<excludes>
<exclude>**/TestMemoryUsageDetection.java</exclude>
<exclude>**/TestFSMBuilder.java</exclude>
<exclude>**/TestDatabase*.java</exclude>
<exclude>**/TestArchive.java</exclude>
<exclude>**/TestJobLogEntry.java</exclude>
<exclude>**/*$*</exclude>
<exclude>**/TestClientTrace.java</exclude>
<exclude>**/TestClientTrace.java</exclude>
</excludes>
<systemPropertyVariables>
<test.build.dir>${project.build.directory}/test</test.build.dir>
@@ -120,7 +120,7 @@ public void drawImages () throws Exception
long elapseTime = endTime - startTime;
if (elapseTime > X_SIZE) {
totalPoint = totalPoint + dataList.size ();
String imageFileName = dirName + "\\image" + imageId + ".png";
String imageFileName = "image" + imageId + ".png";
System.out.println ("elapseTime: " + elapseTime + ", data size: " + dataList.size () + ", imageFileName: " + imageFileName);
drawImage (dataList, imageFileName, X_SIZE, Y_SIZE);
bufferedWriter.write (imageFileName + " 0\n");
@@ -131,9 +131,8 @@ public void drawImages () throws Exception
}
}
bufferedReader.close ();
bufferedWriter.close ();
}
//System.out.println ("Total points: " + totalPoint + ", lineNum: " + lineNum);
bufferedWriter.close ();
}

private static void drawImage (List <String []> dataList, String imageFileName, int x_size, int y_size) throws Exception
@@ -49,11 +49,11 @@ public void setUp() {}
public void tearDown() {}

public void testMemoryDetection () {
String dirName = "/caffe-test/train/data";
String dirName = "/caffe-test/train";
Thread teraSortThread = createTeraSortThread ();
ExecutorService executor = Executors.newFixedThreadPool(1);
Future<?> task = executor.submit(teraSortThread);
collectNodeManagerMetrics (dirName);
collectNodeManagerMetrics (dirName + "/data");
task.cancel (true);
executor.shutdown ();
caffeTrain (dirName);
@@ -104,7 +104,7 @@ private void collectNodeManagerMetrics(String dirName) {

// draw images of size 1000 * 200 from the collected csv files
try {
ImageCreator generator = new ImageCreator ("/caffe-test/train/data");
ImageCreator generator = new ImageCreator (dirName);
generator.drawImages ();
} catch (Exception e) {
fail(ExceptionUtil.getStackTrace(e));
@@ -116,10 +116,10 @@ private void collectNodeManagerMetrics(String dirName) {
*/
private void caffeTrain (String dirName) {
try {
String target = new String(dirName);
String target = new String(dirName + "/train.sh");
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(target);
proc.waitFor();
//proc.waitFor();
BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream()));
String line = "";
while ((line = reader.readLine())!= null) {

0 comments on commit c971524

Please sign in to comment.