import org.apache.pig.tools.parameters.ParseException;
import java.io.IOException;
import org.apache.pig.pigunit.PigTest;
import org.junit.Test;

public class TestAlexaCountRankPerSite {
    private PigTest test;
    private static final String SCRIPT = "alexa_count_rank_per_site.pig";

    @Test public void testSampleData() throws IOException, ParseException {
	PigTest test = new PigTest(SCRIPT);

	String[] input = {
	    "foo.example.com\t{(2012-12-16,1),(2012-12-15,1),(2012-12-14,1)}",
	    "bar.example.com\t{(2012-12-16,2),(2012-12-15,2),(2012-12-14,2)}",
	};

	String[] output = {
	    "foo.example.com\t3",
	    "bar.example.com\t2",
	};

	test.assertOutput("sites", input, "site_count", output);
    }
	
}
@@ -583,32 +583,33 @@
 utput = %7B%0A%09    %22
+(
 foo.example.com%5C
@@ -611,11 +611,11 @@
 .com
-%5Ct3
+,3)
 %22,%0A%09
@@ -611,32 +611,33 @@
 .com,3)%22,%0A%09    %22
+(
 bar.example.com%5C
@@ -639,11 +639,11 @@
 .com
-%5Ct2
+,3)
 %22,%0A%09

test is not on actual output but on relation