You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by ch...@apache.org on 2014/04/14 20:27:47 UTC
svn commit: r1587274 - in /pig/trunk: CHANGES.txt
test/org/apache/pig/test/TestMRJobStats.java
Author: cheolsoo
Date: Mon Apr 14 18:27:46 2014
New Revision: 1587274
URL: http://svn.apache.org/r1587274
Log:
PIG-3887: TestMRJobStats is broken in trunk (cheolsoo)
Modified:
pig/trunk/CHANGES.txt
pig/trunk/test/org/apache/pig/test/TestMRJobStats.java
Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1587274&r1=1587273&r2=1587274&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Mon Apr 14 18:27:46 2014
@@ -105,6 +105,8 @@ PIG-3882: Multiquery off mode execution
BUG FIXES
+PIG-3887: TestMRJobStats is broken in trunk (cheolsoo)
+
PIG-3868: Fix Iterator_1 e2e test on windows (ssvinarchukhorton via rohini)
PIG-3871: Replace org.python.google.* with com.google.* in imports (cheolsoo)
Modified: pig/trunk/test/org/apache/pig/test/TestMRJobStats.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/TestMRJobStats.java?rev=1587274&r1=1587273&r2=1587274&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestMRJobStats.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestMRJobStats.java Mon Apr 14 18:27:46 2014
@@ -244,9 +244,8 @@ public class TestMRJobStats {
Configuration conf = new Configuration();
long size = 2L * 1024 * 1024 * 1024;
- Method getOutputSize = getJobStatsMethod("getOutputSize", POStore.class, Configuration.class);
- long outputSize = (Long) getOutputSize.invoke(
- null, createPOStoreForFileBasedSystem(size, new PigStorageWithStatistics(), conf), conf);
+ long outputSize = JobStats.getOutputSize(
+ createPOStoreForFileBasedSystem(size, new PigStorageWithStatistics(), conf), conf);
assertEquals("The returned output size is expected to be the same as the file size",
size, outputSize);
@@ -259,9 +258,8 @@ public class TestMRJobStats {
// ClientSystemProps is needed to instantiate HBaseStorage
UDFContext.getUDFContext().setClientSystemProps(new Properties());
- Method getOutputSize = getJobStatsMethod("getOutputSize", POStore.class, Configuration.class);
- long outputSize = (Long) getOutputSize.invoke(
- null, createPOStoreForNonFileBasedSystem(new HBaseStorage("colName"), conf), conf);
+ long outputSize = JobStats.getOutputSize(
+ createPOStoreForNonFileBasedSystem(new HBaseStorage("colName"), conf), conf);
assertEquals("The default output size reader returns -1 for a non-file-based uri",
-1, outputSize);
@@ -276,15 +274,14 @@ public class TestMRJobStats {
// ClientSystemProps is needed to instantiate HBaseStorage
UDFContext.getUDFContext().setClientSystemProps(new Properties());
- Method getOutputSize = getJobStatsMethod("getOutputSize", POStore.class, Configuration.class);
- long outputSize = (Long) getOutputSize.invoke(
- null, createPOStoreForNonFileBasedSystem(new HBaseStorage("colName"), conf), conf);
+ long outputSize = JobStats.getOutputSize(
+ createPOStoreForNonFileBasedSystem(new HBaseStorage("colName"), conf), conf);
assertEquals("The dummy output size reader always returns " + DummyOutputSizeReader.SIZE,
DummyOutputSizeReader.SIZE, outputSize);
}
- @Test(expected = InvocationTargetException.class)
+ @Test(expected = RuntimeException.class)
public void testGetOuputSizeUsingNonFileBasedStorage3() throws Exception {
// Register an invalid output size reader in configuration, and verify
// that an exception is thrown at run-time.
@@ -293,10 +290,8 @@ public class TestMRJobStats {
// ClientSystemProps is needed to instantiate HBaseStorage
UDFContext.getUDFContext().setClientSystemProps(new Properties());
- Method getOutputSize = getJobStatsMethod("getOutputSize", POStore.class, Configuration.class);
-
- getOutputSize.invoke(
- null, createPOStoreForNonFileBasedSystem(new HBaseStorage("colName"), conf), conf);
+ JobStats.getOutputSize(
+ createPOStoreForNonFileBasedSystem(new HBaseStorage("colName"), conf), conf);
}
@Test
@@ -310,9 +305,8 @@ public class TestMRJobStats {
// ClientSystemProps needs to be initialized to instantiate HBaseStorage
UDFContext.getUDFContext().setClientSystemProps(new Properties());
- Method getOutputSize = getJobStatsMethod("getOutputSize", POStore.class, Configuration.class);
- long outputSize = (Long) getOutputSize.invoke(
- null, createPOStoreForNonFileBasedSystem(new HBaseStorage("colName"), conf), conf);
+ long outputSize = JobStats.getOutputSize(
+ createPOStoreForNonFileBasedSystem(new HBaseStorage("colName"), conf), conf);
assertEquals("The dummy output size reader always returns " + DummyOutputSizeReader.SIZE,
DummyOutputSizeReader.SIZE, outputSize);