-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate static getClassSchema() method for record classes under avro…
… < 1.7 (#43) Co-authored-by: Radai Rosenblatt <[email protected]>
- Loading branch information
1 parent
65ca605
commit bd59deb
Showing
7 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...m/linkedin/avroutil1/compatibility/AvroCompatibilityHelperGeneratedRecordClassesTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2020 LinkedIn Corp. | ||
* Licensed under the BSD 2-Clause License (the "License"). | ||
* See License in the project root for license information. | ||
*/ | ||
|
||
package com.linkedin.avroutil1.compatibility; | ||
|
||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
|
||
/** | ||
* tests record classes generated by {@link AvroCompatibilityHelper} under different avro versions | ||
*/ | ||
public class AvroCompatibilityHelperGeneratedRecordClassesTest { | ||
|
||
@Test | ||
public void testRecordGeneratedUnderAvro14HasGetClassSchema() throws Exception { | ||
Assert.assertEquals(under14.SimpleRecord.getClassSchema(), under14.SimpleRecord.SCHEMA$); | ||
} | ||
|
||
@Test | ||
public void testRecordGeneratedUnderAvro15HasGetClassSchema() throws Exception { | ||
Assert.assertEquals(under15.SimpleRecord.getClassSchema(), under15.SimpleRecord.SCHEMA$); | ||
} | ||
|
||
@Test | ||
public void testRecordGeneratedUnderAvro16HasGetClassSchema() throws Exception { | ||
Assert.assertEquals(under16.SimpleRecord.getClassSchema(), under16.SimpleRecord.SCHEMA$); | ||
} | ||
|
||
@Test | ||
public void testRecordGeneratedUnderAvro17HasGetClassSchema() throws Exception { | ||
Assert.assertEquals(under17.SimpleRecord.getClassSchema(), under17.SimpleRecord.SCHEMA$); | ||
} | ||
} |