Author: cutting
Date: Wed May 28 22:25:55 2014
New Revision: 1598161

URL: http://svn.apache.org/r1598161
Log:
AVRO-1442. Java: Fix ResolvingGrammarGenerator to work with fixed type.  
Contributed by Jim Pivarski.

Added:
    
avro/trunk/lang/java/avro/src/test/java/org/apache/avro/io/parsing/TestResolvingGrammarGenerator2.java
   (with props)
Modified:
    avro/trunk/CHANGES.txt
    
avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/parsing/ResolvingGrammarGenerator.java

Modified: avro/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1598161&r1=1598160&r2=1598161&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Wed May 28 22:25:55 2014
@@ -70,6 +70,9 @@ Trunk (not yet released)
     AVRO-1457. Java: Fix Encoder so that offset in non-array-backed
     ByteBuffers is not altered when written. (Rob Turner via cutting)
 
+    AVRO-1442. Java: Fix ResolvingGrammarGenerator to work with fixed type.
+    (Jim Pivarski via cutting)
+
 Avro 1.7.6 (15 January 2014)
 
   NEW FEATURES

Modified: 
avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/parsing/ResolvingGrammarGenerator.java
URL: 
http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/parsing/ResolvingGrammarGenerator.java?rev=1598161&r1=1598160&r2=1598161&view=diff
==============================================================================
--- 
avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/parsing/ResolvingGrammarGenerator.java
 (original)
+++ 
avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/parsing/ResolvingGrammarGenerator.java
 Wed May 28 22:25:55 2014
@@ -167,6 +167,7 @@ public class ResolvingGrammarGenerator e
       case ARRAY:
       case MAP:
       case RECORD:
+      case FIXED:
         break;
       default:
         throw new RuntimeException("Unexpected schema type: " + readerType);

Added: 
avro/trunk/lang/java/avro/src/test/java/org/apache/avro/io/parsing/TestResolvingGrammarGenerator2.java
URL: 
http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/test/java/org/apache/avro/io/parsing/TestResolvingGrammarGenerator2.java?rev=1598161&view=auto
==============================================================================
--- 
avro/trunk/lang/java/avro/src/test/java/org/apache/avro/io/parsing/TestResolvingGrammarGenerator2.java
 (added)
+++ 
avro/trunk/lang/java/avro/src/test/java/org/apache/avro/io/parsing/TestResolvingGrammarGenerator2.java
 Wed May 28 22:25:55 2014
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.avro.io.parsing;
+
+import org.apache.avro.io.parsing.ResolvingGrammarGenerator;
+import org.apache.avro.Schema;
+import org.junit.Test;
+
+/** ResolvingGrammarGenerator tests that are not Parameterized.*/
+public class TestResolvingGrammarGenerator2 {  
+  @Test public void testFixed() throws java.io.IOException {
+    new ResolvingGrammarGenerator().generate
+      (Schema.createFixed("MyFixed", null, null, 10),
+       Schema.create(Schema.Type.BYTES));
+    new ResolvingGrammarGenerator().generate
+      (Schema.create(Schema.Type.BYTES),
+       Schema.createFixed("MyFixed", null, null, 10));
+  }
+}

Propchange: 
avro/trunk/lang/java/avro/src/test/java/org/apache/avro/io/parsing/TestResolvingGrammarGenerator2.java
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to