Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jairajsolanke committed Jan 24, 2025
1 parent 397aefa commit 4257bb1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public static void main(String[] args) throws Exception {
long optionParseStart = System.currentTimeMillis();
OptionParser parser = new OptionParser();

// ADD NEW OPTION HERE(1 option)
OptionSpec<String> inputOpt = parser.accepts("input", "Schema or directory of schemas to compile [REQUIRED]")
.withRequiredArg().required()
.describedAs("file");
Expand Down
3 changes: 1 addition & 2 deletions avro-builder/tests/codegen-110/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ task runOwnCodegen {
"--input", "$projectDir/src/main/avro",
"--output", "$buildDir/generated/sources/avro/java/main",
"--generator", "AVRO_UTIL",
"--minAvroVer", "1.4",
"--enableUtf8Encoding", "true"
"--minAvroVer", "1.4"
]
}
}
Expand Down
65 changes: 0 additions & 65 deletions avro-builder/tests/codegen-no-utf8-encoding/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,68 +66,3 @@ dependencies {
//required because generated code depends on the helper
implementation project(":helper:helper")
}

//
// plugins {
// id "java-library"
// }
//
// configurations {
// codegen
// }
//
// sourceSets {
// main {
// java {
// srcDir 'src/main/java'
// srcDir "$buildDir/generated/sources/avro/java/main"
// }
// resources {
// srcDirs = [
// "src/main/avro"
// ]
// }
// }
// }
//
// dependencies {
// codegen project(":avro-builder:builder")
// }
//
// task runOwnCodegen {
// description = 'generate specific classes using own codegen utility'
//
// dependsOn configurations.codegen
//
// doLast {
// javaexec {
// classpath configurations.codegen
// main = 'com.linkedin.avroutil1.builder.SchemaBuilder'
// args = [
// "--input", "$projectDir/src/main/avro",
// "--output", "$buildDir/generated/sources/avro/java/main",
// "--generator", "AVRO_UTIL",
// "--stringRepresentation", "CharSequence",
// "--methodStringRepresentation", "CharSequence",
// "--enableUtf8Encoding", "false"
// ]
// }
// }
// }
//
// compileJava.dependsOn runOwnCodegen
//
// dependencies {
// codegen project(":avro-builder:builder")
//
// implementation ("org.apache.avro:avro:1.4.1") {
// exclude group: "org.mortbay.jetty"
// exclude group: "org.apache.velocity"
// exclude group: "commons-lang"
// exclude group: "org.jboss.netty"
// exclude group: "com.thoughtworks.paranamer", module: "paranamer-ant"
// }
// //required because generated code depends on the helper
// implementation project(":helper:helper")
// }
//}
Original file line number Diff line number Diff line change
Expand Up @@ -1891,37 +1891,6 @@ public void modifiablePrimitiveCollectionTest() {
Assert.assertEquals((int) instance.intAr.get(instance.getIntAr().size() - 1), Integer.MAX_VALUE);
}

@Test
public void modifiablePrimitiveCollectionTestNot() {
String tba = "NewElement";
RandomRecordGenerator generator = new RandomRecordGenerator();
charseqmethod.TestCollections instance =
generator.randomSpecific(charseqmethod.TestCollections.class, RecordGenerationConfig.newConfig().withAvoidNulls(true));

// array of string
instance.getStrAr().add(tba);
Assert.assertTrue(instance.getStrAr().contains(tba));
Assert.assertTrue(instance.strAr.contains(new Utf8(tba)));

// union[null, List<String>]
instance.getUnionOfArray().add(tba);
Assert.assertTrue(instance.getUnionOfArray().contains(tba));
Assert.assertTrue(instance.unionOfArray.contains(new Utf8(tba)));

// array (union[null, string])
instance.getArOfUnionOfStr().add(tba);
Assert.assertTrue(instance.getArOfUnionOfStr().contains(tba));
Assert.assertTrue(instance.arOfUnionOfStr.contains(new Utf8(tba)));


// Union (null, Map<String, String>)
Assert.assertThrows(UnsupportedOperationException.class, () -> instance.getUnionOfMap().put("key1", tba));

instance.getIntAr().add(Integer.MAX_VALUE);
Assert.assertEquals((int) instance.getIntAr().get(instance.getIntAr().size() - 1), Integer.MAX_VALUE);
Assert.assertEquals((int) instance.intAr.get(instance.getIntAr().size() - 1), Integer.MAX_VALUE);
}

@Test
public void modifiablePrimitiveCollectionTestForCharSeq() {
String tba = "NewElement";
Expand Down
22 changes: 11 additions & 11 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@ include 'avro-builder:tests:tests-allavro'

include 'demos:spotbugs-demo'

//include 'fastserde:avro-fastserde'
//include 'fastserde:avro-fastserde-jmh'
//include 'fastserde:avro-fastserde-tests-common'
//include 'fastserde:avro-fastserde-tests14'
//include 'fastserde:avro-fastserde-tests15'
//include 'fastserde:avro-fastserde-tests16'
//include 'fastserde:avro-fastserde-tests17'
//include 'fastserde:avro-fastserde-tests18'
//include 'fastserde:avro-fastserde-tests19'
//include 'fastserde:avro-fastserde-tests110'
//include 'fastserde:avro-fastserde-tests111'
include 'fastserde:avro-fastserde'
include 'fastserde:avro-fastserde-jmh'
include 'fastserde:avro-fastserde-tests-common'
include 'fastserde:avro-fastserde-tests14'
include 'fastserde:avro-fastserde-tests15'
include 'fastserde:avro-fastserde-tests16'
include 'fastserde:avro-fastserde-tests17'
include 'fastserde:avro-fastserde-tests18'
include 'fastserde:avro-fastserde-tests19'
include 'fastserde:avro-fastserde-tests110'
include 'fastserde:avro-fastserde-tests111'

gradleEnterprise {
buildScan {
Expand Down

0 comments on commit 4257bb1

Please sign in to comment.