Michael Blow has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/2687

Change subject: Merge commit '2a182c495d311757f1aa9291ca407c8068f00ff2' from 
release-0.9.4-pre-rc
......................................................................

Merge commit '2a182c495d311757f1aa9291ca407c8068f00ff2' from 
release-0.9.4-pre-rc

Change-Id: I69cf41237858ecbca4d89e8f0403e0f443101539
---
M 
asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/test/ADMDataParserTest.java
1 file changed, 13 insertions(+), 45 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/87/2687/1

diff --git 
a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/test/ADMDataParserTest.java
 
b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/test/ADMDataParserTest.java
index 9c30d3a..189c842 100644
--- 
a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/test/ADMDataParserTest.java
+++ 
b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/test/ADMDataParserTest.java
@@ -23,23 +23,17 @@
 import java.io.DataOutput;
 import java.io.DataOutputStream;
 import java.io.IOException;
-<<<<<<< HEAD   (5c26b4 [ASTERIXDB-2395][COMP] Source location handling cleanup)
 import java.io.InputStream;
-import java.nio.ByteBuffer;
-=======
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
->>>>>>> BRANCH (2a182c [NO ISSUE][TEST] Use reflection in ADMDataParserTest)
+import java.nio.ByteBuffer;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.asterix.external.parser.ADMDataParser;
-<<<<<<< HEAD   (5c26b4 [ASTERIXDB-2395][COMP] Source location handling cleanup)
+import org.apache.asterix.external.parser.AbstractDataParser;
 import org.apache.asterix.formats.nontagged.SerializerDeserializerProvider;
 import org.apache.asterix.om.base.AGeometry;
 import org.apache.asterix.om.base.AInt32;
-=======
-import org.apache.asterix.external.parser.AbstractDataParser;
->>>>>>> BRANCH (2a182c [NO ISSUE][TEST] Use reflection in ADMDataParserTest)
 import org.apache.asterix.om.base.AMutableDate;
 import org.apache.asterix.om.base.AMutableDateTime;
 import org.apache.asterix.om.base.AMutableTime;
@@ -57,14 +51,9 @@
 public class ADMDataParserTest {
 
     @Test
-<<<<<<< HEAD   (5c26b4 [ASTERIXDB-2395][COMP] Source location handling cleanup)
-    public void test() throws IOException {
+    public void test() throws IOException, NoSuchMethodException, 
SecurityException, NoSuchFieldException {
         char[][] dates = toChars(
                 new String[] { "-9537-08-04", "9656-06-03", "-9537-04-04", 
"9656-06-04", "-9537-10-04", "9626-09-05" });
-=======
-    public void test() throws IOException, NoSuchMethodException, 
SecurityException, NoSuchFieldException {
-        String[] dates = { "-9537-08-04", "9656-06-03", "-9537-04-04", 
"9656-06-04", "-9537-10-04", "9626-09-05" };
->>>>>>> BRANCH (2a182c [NO ISSUE][TEST] Use reflection in ADMDataParserTest)
         AMutableDate[] parsedDates =
                 new AMutableDate[] { new AMutableDate(-4202630), new 
AMutableDate(2807408), new AMutableDate(-4202752),
                         new AMutableDate(2807409), new AMutableDate(-4202569), 
new AMutableDate(2796544), };
@@ -83,22 +72,22 @@
                         new AMutableDateTime(-45286270768513L), new 
AMutableDateTime(151729886421653L),
                         new AMutableDateTime(5047449515758L), new 
AMutableDateTime(210721439419691L) };
 
-        Method parseDateMethod =
-                AbstractDataParser.class.getDeclaredMethod("parseDate", 
String.class, DataOutput.class);
+        Method parseDateMethod = 
AbstractDataParser.class.getDeclaredMethod("parseDate", char[].class, int.class,
+                int.class, DataOutput.class);
         parseDateMethod.setAccessible(true);
 
         Field aDateField = AbstractDataParser.class.getDeclaredField("aDate");
         aDateField.setAccessible(true);
 
-        Method parseTimeMethod =
-                AbstractDataParser.class.getDeclaredMethod("parseTime", 
String.class, DataOutput.class);
+        Method parseTimeMethod = 
AbstractDataParser.class.getDeclaredMethod("parseTime", char[].class, int.class,
+                int.class, DataOutput.class);
         parseTimeMethod.setAccessible(true);
 
         Field aTimeField = AbstractDataParser.class.getDeclaredField("aTime");
         aTimeField.setAccessible(true);
 
-        Method parseDateTimeMethod =
-                AbstractDataParser.class.getDeclaredMethod("parseDateTime", 
String.class, DataOutput.class);
+        Method parseDateTimeMethod = 
AbstractDataParser.class.getDeclaredMethod("parseDateTime", char[].class,
+                int.class, int.class, DataOutput.class);
         parseDateTimeMethod.setAccessible(true);
 
         Field aDateTimeField = 
AbstractDataParser.class.getDeclaredField("aDateTime");
@@ -119,40 +108,22 @@
                         while (round++ < 10000) {
                             // Test parseDate.
                             for (int index = 0; index < dates.length; ++index) 
{
-<<<<<<< HEAD   (5c26b4 [ASTERIXDB-2395][COMP] Source location handling cleanup)
-                                PA.invokeMethod(parser, "parseDate(char[], 
int, int, java.io.DataOutput)", dates[index],
-                                        0, dates[index].length, dos);
-                                AMutableDate aDate = (AMutableDate) 
PA.getValue(parser, "aDate");
-=======
-                                parseDateMethod.invoke(parser, dates[index], 
dos);
+                                parseDateMethod.invoke(parser, dates[index], 
0, dates[index].length, dos);
                                 AMutableDate aDate = (AMutableDate) 
aDateField.get(parser);
->>>>>>> BRANCH (2a182c [NO ISSUE][TEST] Use reflection in ADMDataParserTest)
                                 
Assert.assertTrue(aDate.equals(parsedDates[index]));
                             }
 
                             // Tests parseTime.
                             for (int index = 0; index < times.length; ++index) 
{
-<<<<<<< HEAD   (5c26b4 [ASTERIXDB-2395][COMP] Source location handling cleanup)
-                                PA.invokeMethod(parser, "parseTime(char[], 
int, int, java.io.DataOutput)", times[index],
-                                        0, times[index].length, dos);
-                                AMutableTime aTime = (AMutableTime) 
PA.getValue(parser, "aTime");
-=======
-                                parseTimeMethod.invoke(parser, times[index], 
dos);
+                                parseTimeMethod.invoke(parser, times[index], 
0, times[index].length, dos);
                                 AMutableTime aTime = (AMutableTime) 
aTimeField.get(parser);
->>>>>>> BRANCH (2a182c [NO ISSUE][TEST] Use reflection in ADMDataParserTest)
                                 
Assert.assertTrue(aTime.equals(parsedTimes[index]));
                             }
 
                             // Tests parseDateTime.
                             for (int index = 0; index < dateTimes.length; 
++index) {
-<<<<<<< HEAD   (5c26b4 [ASTERIXDB-2395][COMP] Source location handling cleanup)
-                                PA.invokeMethod(parser, "parseDateTime(char[], 
int, int, java.io.DataOutput)",
-                                        dateTimes[index], 0, 
dateTimes[index].length, dos);
-                                AMutableDateTime aDateTime = 
(AMutableDateTime) PA.getValue(parser, "aDateTime");
-=======
-                                parseDateTimeMethod.invoke(parser, 
dateTimes[index], dos);
+                                parseDateTimeMethod.invoke(parser, 
dateTimes[index], 0, dateTimes[index].length, dos);
                                 AMutableDateTime aDateTime = 
(AMutableDateTime) aDateTimeField.get(parser);
->>>>>>> BRANCH (2a182c [NO ISSUE][TEST] Use reflection in ADMDataParserTest)
                                 
Assert.assertTrue(aDateTime.equals(parsedDateTimes[index]));
                             }
                         }
@@ -177,7 +148,6 @@
         // Asserts no failure.
         Assert.assertTrue(errorCount.get() == 0);
     }
-<<<<<<< HEAD   (5c26b4 [ASTERIXDB-2395][COMP] Source location handling cleanup)
 
     private char[][] toChars(String[] strings) {
         char[][] results = new char[strings.length][];
@@ -232,6 +202,4 @@
         }
 
     }
-=======
->>>>>>> BRANCH (2a182c [NO ISSUE][TEST] Use reflection in ADMDataParserTest)
-}
\ No newline at end of file
+}

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/2687
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I69cf41237858ecbca4d89e8f0403e0f443101539
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <[email protected]>

Reply via email to