Skip to content

Commit

Permalink
Merge pull request #43 from lifey/master
Browse files Browse the repository at this point in the history
decimal seperator should be localized
  • Loading branch information
lifey committed Nov 11, 2014
2 parents 3ea2ed4 + 37e9428 commit 03e8f4b
Showing 1 changed file with 29 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@

import com.performizeit.mjprof.model.Profile;
import org.junit.Test;

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;

import static org.junit.Assert.assertEquals;

public class StackTreeTest {
static char sep = getSeparator();
static String stck =

" at org.apache.hadoop.hdfs.DFSUtil.<clinit>(DFSUtil.java:128)\n"
Expand All @@ -48,23 +53,23 @@ public class StackTreeTest {
+ " at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:316)\n"
+ " at com.akkka.aaa.bbbb.rest.FileSystemFactory.provide(FileSystemFactory.java:32)\n"
+ " at com.akkka.aaa.bbb.rest.FileSystemFactory.provide(FlsFactory.java:44)\n";
static String tree = "100.00% [3/3]\\ at com.akkka.aaa.bbb.rest.FileSystemFactory.provide(FlsFactory.java:44)\n"
+ "100.00% [3/3] \\ at com.akkka.aaa.bbbb.rest.FileSystemFactory.provide(FileSystemFactory.java:32)\n"
+ "100.00% [3/3] \\ at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:316)\n"
+ "100.00% [3/3] \\ at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2289)\n"
+ "100.00% [3/3] X at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2307)\n"
+ " 33.33% [1/3] |\\ at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:87)\n"
+ " 33.33% [1/3] | \\ at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2273)\n"
+ " 33.33% [1/3] | \\ at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:127)\n"
+ " 33.33% [1/3] | \\ at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:410)\n"
+ " 33.33% [1/3] | \\ at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:437)\n"
+ " 33.33% [1/3] | V at org.apache.hadoop.hdfs.DFSUtil.<clinit>(DFSUtil.java:128)\n"
+ " 66.67% [2/3] \\ at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:86)\n"
+ " 66.67% [2/3] \\ at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2273)\n"
+ " 66.67% [2/3] \\ at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:127)\n"
+ " 66.67% [2/3] \\ at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:410)\n"
+ " 66.67% [2/3] \\ at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:437)\n"
+ " 66.67% [2/3] V at org.apache.hadoop.hdfs.DFSUtil.<clinit>(DFSUtil.java:128)\n";
static String tree = "100"+sep+"00% [3/3]\\ at com.akkka.aaa.bbb.rest.FileSystemFactory.provide(FlsFactory.java:44)\n"
+ "100"+sep+"00% [3/3] \\ at com.akkka.aaa.bbbb.rest.FileSystemFactory.provide(FileSystemFactory.java:32)\n"
+ "100"+sep+"00% [3/3] \\ at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:316)\n"
+ "100"+sep+"00% [3/3] \\ at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2289)\n"
+ "100"+sep+"00% [3/3] X at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2307)\n"
+ " 33"+sep+"33% [1/3] |\\ at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:87)\n"
+ " 33"+sep+"33% [1/3] | \\ at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2273)\n"
+ " 33"+sep+"33% [1/3] | \\ at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:127)\n"
+ " 33"+sep+"33% [1/3] | \\ at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:410)\n"
+ " 33"+sep+"33% [1/3] | \\ at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:437)\n"
+ " 33"+sep+"33% [1/3] | V at org.apache.hadoop.hdfs.DFSUtil.<clinit>(DFSUtil.java:128)\n"
+ " 66"+sep+"67% [2/3] \\ at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:86)\n"
+ " 66"+sep+"67% [2/3] \\ at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2273)\n"
+ " 66"+sep+"67% [2/3] \\ at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:127)\n"
+ " 66"+sep+"67% [2/3] \\ at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:410)\n"
+ " 66"+sep+"67% [2/3] \\ at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:437)\n"
+ " 66"+sep+"67% [2/3] V at org.apache.hadoop.hdfs.DFSUtil.<clinit>(DFSUtil.java:128)\n";

@Test
public void testConstructor() {
Expand All @@ -78,4 +83,11 @@ public void testConstructor() {
// System.out.println(st2.toString());
assertEquals(tree, st2.toString());
}

private static char getSeparator() {
DecimalFormat format= (DecimalFormat) DecimalFormat.getInstance();
DecimalFormatSymbols symbols=format.getDecimalFormatSymbols();
char sep=symbols.getDecimalSeparator();
return sep;
}
}

0 comments on commit 03e8f4b

Please sign in to comment.