10 fail, 20 skipped, 5 193 pass in 34m 29s
Annotations
Check warning on line 0 in com.google.firebase.encoders.processor.EncodableProcessorTest
github-actions / Unit Test Results
compile_withMapOfListOfCustomType_shouldRegisterEncoderForThatType (com.google.firebase.encoders.processor.EncodableProcessorTest) failed
artifacts/unit-test-result-/encoders/firebase-encoders-processor/build/test-results/test/TEST-com.google.firebase.encoders.processor.EncodableProcessorTest.xml
Raw output
value of:
compilation.generatedFile(/AutoTypeWithListEncoder.java)
for file:
/SOURCE_OUTPUT/AutoTypeWithListEncoder.java
expected to be equivalent to:
/home/runner/work/firebase-android-sdk/firebase-android-sdk/encoders/firebase-encoders-processor/build/resources/test/ExpectedTypeWithListEncoder.java
diff:
Found 1 unmatched nodes in the actual tree.
> Extra node in actual tree.
Line 7 COMPILATION_UNIT->IMPORT(non-static)
Node contents: <import java.lang.Override;>.
expected:
// Copyright 2019 Google LLC
//
// Licensed 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.
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
/**
* @hide */
@SuppressWarnings("KotlinInternal")
public final class AutoTypeWithListEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoTypeWithListEncoder();
private AutoTypeWithListEncoder() {}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(TypeWithList.class, TypeWithListEncoder.INSTANCE);
cfg.registerEncoder(Member.class, MemberEncoder.INSTANCE);
}
private static final class TypeWithListEncoder implements ObjectEncoder<TypeWithList> {
static final TypeWithListEncoder INSTANCE = new TypeWithListEncoder();
private static final FieldDescriptor MEMBER_DESCRIPTOR = FieldDescriptor.of("member");
@Override
public void encode(TypeWithList value, ObjectEncoderContext ctx) throws IOException {
ctx.add(MEMBER_DESCRIPTOR, value.getMember());
}
}
private static final class MemberEncoder implements ObjectEncoder<Member> {
static final MemberEncoder INSTANCE = new MemberEncoder();
@Override
public void encode(Member value, ObjectEncoderContext ctx) throws IOException {}
}
}
but was:
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
import java.lang.Override;
import java.lang.SuppressWarnings;
@SuppressWarnings("KotlinInternal")
public final class AutoTypeWithListEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoTypeWithListEncoder();
private AutoTypeWithListEncoder() {
}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(TypeWithList.class, TypeWithListEncoder.INSTANCE);
cfg.registerEncoder(Member.class, MemberEncoder.INSTANCE);
}
private static final class TypeWithListEncoder implements ObjectEncoder<TypeWithList> {
static final TypeWithListEncoder INSTANCE = new TypeWithListEncoder();
private static final FieldDescriptor MEMBER_DESCRIPTOR = FieldDescriptor.of("member");
@Override
public void encode(TypeWithList value, ObjectEncoderContext ctx) throws IOException {
ctx.add(MEMBER_DESCRIPTOR, value.getMember());
}
}
private static final class MemberEncoder implements ObjectEncoder<Member> {
static final MemberEncoder INSTANCE = new MemberEncoder();
@Override
public void encode(Member value, ObjectEncoderContext ctx) throws IOException {
}
}
}
compilation was:
compilation of [TypeWithList.java, Member.java] using annotation processors [com.google.firebase.encoders.processor.EncodableProcessor@3a320ade]
at app//com.google.firebase.encoders.processor.EncodableProcessorTest.compile_withMapOfListOfCustomType_shouldRegisterEncoderForThatType(EncodableProcessorTest.java:426)
Check warning on line 0 in com.google.firebase.encoders.processor.EncodableProcessorTest
github-actions / Unit Test Results
compile_withMultipleGenericArgs_shouldCreateEncodersForAllKnownGenericArgs (com.google.firebase.encoders.processor.EncodableProcessorTest) failed
artifacts/unit-test-result-/encoders/firebase-encoders-processor/build/test-results/test/TEST-com.google.firebase.encoders.processor.EncodableProcessorTest.xml
Raw output
value of:
compilation.generatedFile(/AutoGenericsEncoder.java)
for file:
/SOURCE_OUTPUT/AutoGenericsEncoder.java
expected to be equivalent to:
/home/runner/work/firebase-android-sdk/firebase-android-sdk/encoders/firebase-encoders-processor/build/resources/test/ExpectedGenericsEncoder.java
diff:
Found 1 unmatched nodes in the actual tree.
> Extra node in actual tree.
Line 7 COMPILATION_UNIT->IMPORT(non-static)
Node contents: <import java.lang.Override;>.
expected:
// Copyright 2019 Google LLC
//
// Licensed 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.
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
/**
* @hide */
@SuppressWarnings("KotlinInternal")
public final class AutoGenericsEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoGenericsEncoder();
private AutoGenericsEncoder() {}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(Generics.class, GenericsEncoder.INSTANCE);
cfg.registerEncoder(Bar.class, BarEncoder.INSTANCE);
cfg.registerEncoder(Baz.class, BazEncoder.INSTANCE);
cfg.registerEncoder(Foo.class, FooEncoder.INSTANCE);
cfg.registerEncoder(Member3.class, Member3Encoder.INSTANCE);
cfg.registerEncoder(Member4.class, Member4Encoder.INSTANCE);
cfg.registerEncoder(Multi.class, MultiEncoder.INSTANCE);
cfg.registerEncoder(Member.class, MemberEncoder.INSTANCE);
cfg.registerEncoder(Member2.class, Member2Encoder.INSTANCE);
}
private static final class GenericsEncoder implements ObjectEncoder<Generics> {
static final GenericsEncoder INSTANCE = new GenericsEncoder();
private static final FieldDescriptor BAR3_DESCRIPTOR = FieldDescriptor.of("bar3");
private static final FieldDescriptor BAR4_DESCRIPTOR = FieldDescriptor.of("bar4");
private static final FieldDescriptor MULTI_DESCRIPTOR = FieldDescriptor.of("multi");
@Override
public void encode(Generics value, ObjectEncoderContext ctx) throws IOException {
ctx.add(BAR3_DESCRIPTOR, value.getBar3());
ctx.add(BAR4_DESCRIPTOR, value.getBar4());
ctx.add(MULTI_DESCRIPTOR, value.getMulti());
}
}
private static final class BarEncoder implements ObjectEncoder<Bar> {
static final BarEncoder INSTANCE = new BarEncoder();
private static final FieldDescriptor FOO_DESCRIPTOR = FieldDescriptor.of("foo");
@Override
public void encode(Bar value, ObjectEncoderContext ctx) throws IOException {
ctx.add(FOO_DESCRIPTOR, value.getFoo());
}
}
private static final class BazEncoder implements ObjectEncoder<Baz> {
static final BazEncoder INSTANCE = new BazEncoder();
private static final FieldDescriptor T_DESCRIPTOR = FieldDescriptor.of("t");
@Override
public void encode(Baz value, ObjectEncoderContext ctx) throws IOException {
ctx.add(T_DESCRIPTOR, value.getT());
}
}
private static final class FooEncoder implements ObjectEncoder<Foo> {
static final FooEncoder INSTANCE = new FooEncoder();
private static final FieldDescriptor T_DESCRIPTOR = FieldDescriptor.of("t");
@Override
public void encode(Foo value, ObjectEncoderContext ctx) throws IOException {
ctx.add(T_DESCRIPTOR, value.getT());
}
}
private static final class Member3Encoder implements ObjectEncoder<Member3> {
static final Member3Encoder INSTANCE = new Member3Encoder();
@Override
public void encode(Member3 value, ObjectEncoderContext ctx) throws IOException {}
}
private static final class Member4Encoder implements ObjectEncoder<Member4> {
static final Member4Encoder INSTANCE = new Member4Encoder();
@Override
public void encode(Member4 value, ObjectEncoderContext ctx) throws IOException {}
}
private static final class MultiEncoder implements ObjectEncoder<Multi> {
static final MultiEncoder INSTANCE = new MultiEncoder();
private static final FieldDescriptor FOOT_DESCRIPTOR = FieldDescriptor.of("fooT");
private static final FieldDescriptor FOOU_DESCRIPTOR = FieldDescriptor.of("fooU");
@Override
public void encode(Multi value, ObjectEncoderContext ctx) throws IOException {
ctx.add(FOOT_DESCRIPTOR, value.getFooT());
ctx.add(FOOU_DESCRIPTOR, value.getFooU());
}
}
private static final class MemberEncoder implements ObjectEncoder<Member> {
static final MemberEncoder INSTANCE = new MemberEncoder();
@Override
public void encode(Member value, ObjectEncoderContext ctx) throws IOException {}
}
private static final class Member2Encoder implements ObjectEncoder<Member2> {
static final Member2Encoder INSTANCE = new Member2Encoder();
@Override
public void encode(Member2 value, ObjectEncoderContext ctx) throws IOException {}
}
}
but was:
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
import java.lang.Override;
import java.lang.SuppressWarnings;
@SuppressWarnings("KotlinInternal")
public final class AutoGenericsEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoGenericsEncoder();
private AutoGenericsEncoder() {
}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(Generics.class, GenericsEncoder.INSTANCE);
cfg.registerEncoder(Bar.class, BarEncoder.INSTANCE);
cfg.registerEncoder(Baz.class, BazEncoder.INSTANCE);
cfg.registerEncoder(Foo.class, FooEncoder.INSTANCE);
cfg.registerEncoder(Member3.class, Member3Encoder.INSTANCE);
cfg.registerEncoder(Member4.class, Member4Encoder.INSTANCE);
cfg.registerEncoder(Multi.class, MultiEncoder.INSTANCE);
cfg.registerEncoder(Member.class, MemberEncoder.INSTANCE);
cfg.registerEncoder(Member2.class, Member2Encoder.INSTANCE);
}
private static final class GenericsEncoder implements ObjectEncoder<Generics> {
static final GenericsEncoder INSTANCE = new GenericsEncoder();
private static final FieldDescriptor BAR3_DESCRIPTOR = FieldDescriptor.of("bar3");
private static final FieldDescriptor BAR4_DESCRIPTOR = FieldDescriptor.of("bar4");
private static final FieldDescriptor MULTI_DESCRIPTOR = FieldDescriptor.of("multi");
@Override
public void encode(Generics value, ObjectEncoderContext ctx) throws IOException {
ctx.add(BAR3_DESCRIPTOR, value.getBar3());
ctx.add(BAR4_DESCRIPTOR, value.getBar4());
ctx.add(MULTI_DESCRIPTOR, value.getMulti());
}
}
private static final class BarEncoder implements ObjectEncoder<Bar> {
static final BarEncoder INSTANCE = new BarEncoder();
private static final FieldDescriptor FOO_DESCRIPTOR = FieldDescriptor.of("foo");
@Override
public void encode(Bar value, ObjectEncoderContext ctx) throws IOException {
ctx.add(FOO_DESCRIPTOR, value.getFoo());
}
}
private static final class BazEncoder implements ObjectEncoder<Baz> {
static final BazEncoder INSTANCE = new BazEncoder();
private static final FieldDescriptor T_DESCRIPTOR = FieldDescriptor.of("t");
@Override
public void encode(Baz value, ObjectEncoderContext ctx) throws IOException {
ctx.add(T_DESCRIPTOR, value.getT());
}
}
private static final class FooEncoder implements ObjectEncoder<Foo> {
static final FooEncoder INSTANCE = new FooEncoder();
private static final FieldDescriptor T_DESCRIPTOR = FieldDescriptor.of("t");
@Override
public void encode(Foo value, ObjectEncoderContext ctx) throws IOException {
ctx.add(T_DESCRIPTOR, value.getT());
}
}
private static final class Member3Encoder implements ObjectEncoder<Member3> {
static final Member3Encoder INSTANCE = new Member3Encoder();
@Override
public void encode(Member3 value, ObjectEncoderContext ctx) throws IOException {
}
}
private static final class Member4Encoder implements ObjectEncoder<Member4> {
static final Member4Encoder INSTANCE = new Member4Encoder();
@Override
public void encode(Member4 value, ObjectEncoderContext ctx) throws IOException {
}
}
private static final class MultiEncoder implements ObjectEncoder<Multi> {
static final MultiEncoder INSTANCE = new MultiEncoder();
private static final FieldDescriptor FOOT_DESCRIPTOR = FieldDescriptor.of("fooT");
private static final FieldDescriptor FOOU_DESCRIPTOR = FieldDescriptor.of("fooU");
@Override
public void encode(Multi value, ObjectEncoderContext ctx) throws IOException {
ctx.add(FOOT_DESCRIPTOR, value.getFooT());
ctx.add(FOOU_DESCRIPTOR, value.getFooU());
}
}
private static final class MemberEncoder implements ObjectEncoder<Member> {
static final MemberEncoder INSTANCE = new MemberEncoder();
@Override
public void encode(Member value, ObjectEncoderContext ctx) throws IOException {
}
}
private static final class Member2Encoder implements ObjectEncoder<Member2> {
static final Member2Encoder INSTANCE = new Member2Encoder();
@Override
public void encode(Member2 value, ObjectEncoderContext ctx) throws IOException {
}
}
}
compilation was:
compilation of [Generics.java, Foo.java, Baz.java, Bar.java, Multi.java, Member.java, Member2.java, Member3.java, Member3.java] using annotation processors [com.google.firebase.encoders.processor.EncodableProcessor@5a917723]
at app//com.google.firebase.encoders.processor.EncodableProcessorTest.compile_withMultipleGenericArgs_shouldCreateEncodersForAllKnownGenericArgs(EncodableProcessorTest.java:173)
Check warning on line 0 in com.google.firebase.encoders.processor.EncodableProcessorTest
github-actions / Unit Test Results
compile_withRecursiveGenericTypes_shouldSucceed (com.google.firebase.encoders.processor.EncodableProcessorTest) failed
artifacts/unit-test-result-/encoders/firebase-encoders-processor/build/test-results/test/TEST-com.google.firebase.encoders.processor.EncodableProcessorTest.xml
Raw output
value of:
compilation.generatedFile(/com/example/AutoMainClassEncoder.java)
for file:
/SOURCE_OUTPUT/com/example/AutoMainClassEncoder.java
expected to be equivalent to:
/home/runner/work/firebase-android-sdk/firebase-android-sdk/encoders/firebase-encoders-processor/build/resources/test/ExpectedRecursiveGenericEncoder.java
diff:
Found 1 unmatched nodes in the actual tree.
> Extra node in actual tree.
Line 9 COMPILATION_UNIT->IMPORT(non-static)
Node contents: <import java.lang.Override;>.
expected:
// Copyright 2019 Google LLC
//
// Licensed 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 com.example;
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
/**
* @hide */
@SuppressWarnings("KotlinInternal")
public final class AutoMainClassEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoMainClassEncoder();
private AutoMainClassEncoder() {}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(MainClass.class, MainClassEncoder.INSTANCE);
cfg.registerEncoder(Child.class, ChildEncoder.INSTANCE);
}
private static final class MainClassEncoder implements ObjectEncoder<MainClass> {
static final MainClassEncoder INSTANCE = new MainClassEncoder();
private static final FieldDescriptor CHILD_DESCRIPTOR = FieldDescriptor.of("child");
@Override
public void encode(MainClass value, ObjectEncoderContext ctx) throws IOException {
ctx.add(CHILD_DESCRIPTOR, value.getChild());
}
}
private static final class ChildEncoder implements ObjectEncoder<Child> {
static final ChildEncoder INSTANCE = new ChildEncoder();
private static final FieldDescriptor STRINGCHILD_DESCRIPTOR = FieldDescriptor.of("stringChild");
private static final FieldDescriptor INTCHILD_DESCRIPTOR = FieldDescriptor.of("intChild");
private static final FieldDescriptor MAIN_DESCRIPTOR = FieldDescriptor.of("main");
@Override
public void encode(Child value, ObjectEncoderContext ctx) throws IOException {
ctx.add(STRINGCHILD_DESCRIPTOR, value.getStringChild());
ctx.add(INTCHILD_DESCRIPTOR, value.getIntChild());
ctx.add(MAIN_DESCRIPTOR, value.getMain());
}
}
}
but was:
package com.example;
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
import java.lang.Override;
import java.lang.SuppressWarnings;
@SuppressWarnings("KotlinInternal")
public final class AutoMainClassEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoMainClassEncoder();
private AutoMainClassEncoder() {
}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(MainClass.class, MainClassEncoder.INSTANCE);
cfg.registerEncoder(Child.class, ChildEncoder.INSTANCE);
}
private static final class MainClassEncoder implements ObjectEncoder<MainClass> {
static final MainClassEncoder INSTANCE = new MainClassEncoder();
private static final FieldDescriptor CHILD_DESCRIPTOR = FieldDescriptor.of("child");
@Override
public void encode(MainClass value, ObjectEncoderContext ctx) throws IOException {
ctx.add(CHILD_DESCRIPTOR, value.getChild());
}
}
private static final class ChildEncoder implements ObjectEncoder<Child> {
static final ChildEncoder INSTANCE = new ChildEncoder();
private static final FieldDescriptor STRINGCHILD_DESCRIPTOR = FieldDescriptor.of("stringChild");
private static final FieldDescriptor INTCHILD_DESCRIPTOR = FieldDescriptor.of("intChild");
private static final FieldDescriptor MAIN_DESCRIPTOR = FieldDescriptor.of("main");
@Override
public void encode(Child value, ObjectEncoderContext ctx) throws IOException {
ctx.add(STRINGCHILD_DESCRIPTOR, value.getStringChild());
ctx.add(INTCHILD_DESCRIPTOR, value.getIntChild());
ctx.add(MAIN_DESCRIPTOR, value.getMain());
}
}
}
compilation was:
compilation of [com/example/MainClass.java, com/example/Child.java] using annotation processors [com.google.firebase.encoders.processor.EncodableProcessor@664e848c]
at app//com.google.firebase.encoders.processor.EncodableProcessorTest.compile_withRecursiveGenericTypes_shouldSucceed(EncodableProcessorTest.java:200)
Check warning on line 0 in com.google.firebase.encoders.processor.EncodableProcessorTest
github-actions / Unit Test Results
compile_withSetOfSetOfCustomType_shouldRegisterEncoderForThatType (com.google.firebase.encoders.processor.EncodableProcessorTest) failed
artifacts/unit-test-result-/encoders/firebase-encoders-processor/build/test-results/test/TEST-com.google.firebase.encoders.processor.EncodableProcessorTest.xml
Raw output
value of:
compilation.generatedFile(/AutoTypeWithListEncoder.java)
for file:
/SOURCE_OUTPUT/AutoTypeWithListEncoder.java
expected to be equivalent to:
/home/runner/work/firebase-android-sdk/firebase-android-sdk/encoders/firebase-encoders-processor/build/resources/test/ExpectedTypeWithListEncoder.java
diff:
Found 1 unmatched nodes in the actual tree.
> Extra node in actual tree.
Line 7 COMPILATION_UNIT->IMPORT(non-static)
Node contents: <import java.lang.Override;>.
expected:
// Copyright 2019 Google LLC
//
// Licensed 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.
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
/**
* @hide */
@SuppressWarnings("KotlinInternal")
public final class AutoTypeWithListEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoTypeWithListEncoder();
private AutoTypeWithListEncoder() {}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(TypeWithList.class, TypeWithListEncoder.INSTANCE);
cfg.registerEncoder(Member.class, MemberEncoder.INSTANCE);
}
private static final class TypeWithListEncoder implements ObjectEncoder<TypeWithList> {
static final TypeWithListEncoder INSTANCE = new TypeWithListEncoder();
private static final FieldDescriptor MEMBER_DESCRIPTOR = FieldDescriptor.of("member");
@Override
public void encode(TypeWithList value, ObjectEncoderContext ctx) throws IOException {
ctx.add(MEMBER_DESCRIPTOR, value.getMember());
}
}
private static final class MemberEncoder implements ObjectEncoder<Member> {
static final MemberEncoder INSTANCE = new MemberEncoder();
@Override
public void encode(Member value, ObjectEncoderContext ctx) throws IOException {}
}
}
but was:
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
import java.lang.Override;
import java.lang.SuppressWarnings;
@SuppressWarnings("KotlinInternal")
public final class AutoTypeWithListEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoTypeWithListEncoder();
private AutoTypeWithListEncoder() {
}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(TypeWithList.class, TypeWithListEncoder.INSTANCE);
cfg.registerEncoder(Member.class, MemberEncoder.INSTANCE);
}
private static final class TypeWithListEncoder implements ObjectEncoder<TypeWithList> {
static final TypeWithListEncoder INSTANCE = new TypeWithListEncoder();
private static final FieldDescriptor MEMBER_DESCRIPTOR = FieldDescriptor.of("member");
@Override
public void encode(TypeWithList value, ObjectEncoderContext ctx) throws IOException {
ctx.add(MEMBER_DESCRIPTOR, value.getMember());
}
}
private static final class MemberEncoder implements ObjectEncoder<Member> {
static final MemberEncoder INSTANCE = new MemberEncoder();
@Override
public void encode(Member value, ObjectEncoderContext ctx) throws IOException {
}
}
}
compilation was:
compilation of [TypeWithList.java, Member.java] using annotation processors [com.google.firebase.encoders.processor.EncodableProcessor@756b2d90]
at app//com.google.firebase.encoders.processor.EncodableProcessorTest.compile_withSetOfSetOfCustomType_shouldRegisterEncoderForThatType(EncodableProcessorTest.java:405)
Check warning on line 0 in com.google.firebase.encoders.processor.EncodableProcessorTest
github-actions / Unit Test Results
compile_validClass_shouldProduceValidEncoder (com.google.firebase.encoders.processor.EncodableProcessorTest) failed
artifacts/unit-test-result-/encoders/firebase-encoders-processor/build/test-results/test/TEST-com.google.firebase.encoders.processor.EncodableProcessorTest.xml
Raw output
value of:
compilation.generatedFile(/AutoSimpleClassEncoder.java)
for file:
/SOURCE_OUTPUT/AutoSimpleClassEncoder.java
expected to be equivalent to:
/home/runner/work/firebase-android-sdk/firebase-android-sdk/encoders/firebase-encoders-processor/build/resources/test/ExpectedSimpleClassEncoder.java
diff:
Found 1 unmatched nodes in the actual tree.
> Extra node in actual tree.
Line 7 COMPILATION_UNIT->IMPORT(non-static)
Node contents: <import java.lang.Override;>.
expected:
// Copyright 2019 Google LLC
//
// Licensed 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.
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
/**
* @hide */
@SuppressWarnings("KotlinInternal")
public final class AutoSimpleClassEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoSimpleClassEncoder();
private AutoSimpleClassEncoder() {}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(SimpleClass.class, SimpleClassEncoder.INSTANCE);
}
private static final class SimpleClassEncoder implements ObjectEncoder<SimpleClass> {
static final SimpleClassEncoder INSTANCE = new SimpleClassEncoder();
private static final FieldDescriptor INT_DESCRIPTOR = FieldDescriptor.of("int");
private static final FieldDescriptor BOOL_DESCRIPTOR = FieldDescriptor.of("bool");
private static final FieldDescriptor MAP_DESCRIPTOR = FieldDescriptor.of("map");
private static final FieldDescriptor FOO_DESCRIPTOR = FieldDescriptor.of("foo");
@Override
public void encode(SimpleClass value, ObjectEncoderContext ctx) throws IOException {
ctx.add(INT_DESCRIPTOR, value.getInt());
ctx.add(BOOL_DESCRIPTOR, value.isBool());
ctx.add(MAP_DESCRIPTOR, value.getMap());
ctx.add(FOO_DESCRIPTOR, value.getField());
}
}
}
but was:
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
import java.lang.Override;
import java.lang.SuppressWarnings;
@SuppressWarnings("KotlinInternal")
public final class AutoSimpleClassEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoSimpleClassEncoder();
private AutoSimpleClassEncoder() {
}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(SimpleClass.class, SimpleClassEncoder.INSTANCE);
}
private static final class SimpleClassEncoder implements ObjectEncoder<SimpleClass> {
static final SimpleClassEncoder INSTANCE = new SimpleClassEncoder();
private static final FieldDescriptor INT_DESCRIPTOR = FieldDescriptor.of("int");
private static final FieldDescriptor BOOL_DESCRIPTOR = FieldDescriptor.of("bool");
private static final FieldDescriptor MAP_DESCRIPTOR = FieldDescriptor.of("map");
private static final FieldDescriptor FOO_DESCRIPTOR = FieldDescriptor.of("foo");
@Override
public void encode(SimpleClass value, ObjectEncoderContext ctx) throws IOException {
ctx.add(INT_DESCRIPTOR, value.getInt());
ctx.add(BOOL_DESCRIPTOR, value.isBool());
ctx.add(MAP_DESCRIPTOR, value.getMap());
ctx.add(FOO_DESCRIPTOR, value.getField());
}
}
}
compilation was:
compilation of [SimpleClass.java, TestEncoderCompile.java] using annotation processors [com.google.firebase.encoders.processor.EncodableProcessor@7f93f4c]
at app//com.google.firebase.encoders.processor.EncodableProcessorTest.compile_validClass_shouldProduceValidEncoder(EncodableProcessorTest.java:63)
Check warning on line 0 in com.google.firebase.encoders.processor.EncodableProcessorTest
github-actions / Unit Test Results
compile_withExtraProperty_annotation_shouldIncludeThePropertyInFieldDescriptor (com.google.firebase.encoders.processor.EncodableProcessorTest) failed
artifacts/unit-test-result-/encoders/firebase-encoders-processor/build/test-results/test/TEST-com.google.firebase.encoders.processor.EncodableProcessorTest.xml
Raw output
value of:
compilation.generatedFile(/AutoMyClassEncoder.java)
for file:
/SOURCE_OUTPUT/AutoMyClassEncoder.java
expected to be equivalent to:
/home/runner/work/firebase-android-sdk/firebase-android-sdk/encoders/firebase-encoders-processor/build/resources/test/ExpectedMyClassEncoderWithExtraProperty.java
diff:
Found 1 unmatched nodes in the actual tree.
> Extra node in actual tree.
Line 8 COMPILATION_UNIT->IMPORT(non-static)
Node contents: <import java.lang.Override;>.
expected:
// Copyright 2020 Google LLC
//
// Licensed 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.
import com.example.AtMyAnnotation;
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
/**
* @hide */
@SuppressWarnings("KotlinInternal")
public final class AutoMyClassEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoMyClassEncoder();
private AutoMyClassEncoder() {}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(MyClass.class, MyClassEncoder.INSTANCE);
}
private static final class MyClassEncoder implements ObjectEncoder<MyClass> {
static final MyClassEncoder INSTANCE = new MyClassEncoder();
private static final FieldDescriptor HELLO_DESCRIPTOR =
FieldDescriptor.builder("hello")
.withProperty(AtMyAnnotation.builder().value(42).build())
.build();
@Override
public void encode(MyClass value, ObjectEncoderContext ctx) throws IOException {
ctx.add(HELLO_DESCRIPTOR, value.getHello());
}
}
}
but was:
import com.example.AtMyAnnotation;
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
import java.lang.Override;
import java.lang.SuppressWarnings;
@SuppressWarnings("KotlinInternal")
public final class AutoMyClassEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoMyClassEncoder();
private AutoMyClassEncoder() {
}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(MyClass.class, MyClassEncoder.INSTANCE);
}
private static final class MyClassEncoder implements ObjectEncoder<MyClass> {
static final MyClassEncoder INSTANCE = new MyClassEncoder();
private static final FieldDescriptor HELLO_DESCRIPTOR = FieldDescriptor.builder("hello")
.withProperty(AtMyAnnotation.builder()
.value(42)
.build())
.build();
@Override
public void encode(MyClass value, ObjectEncoderContext ctx) throws IOException {
ctx.add(HELLO_DESCRIPTOR, value.getHello());
}
}
}
compilation was:
compilation of [com/example/MyAnnotation.java, MyClass.java] using annotation processors [com.google.firebase.encoders.processor.EncodableProcessor@7d4d65f5, com.google.firebase.encoders.processor.ExtraPropertyProcessor@38cf3ae1]
at app//com.google.firebase.encoders.processor.EncodableProcessorTest.compile_withExtraProperty_annotation_shouldIncludeThePropertyInFieldDescriptor(EncodableProcessorTest.java:498)
Check warning on line 0 in com.google.firebase.encoders.processor.EncodableProcessorTest
github-actions / Unit Test Results
compile_withGenericClass_ShouldWarnAboutPotentialProblems (com.google.firebase.encoders.processor.EncodableProcessorTest) failed
artifacts/unit-test-result-/encoders/firebase-encoders-processor/build/test-results/test/TEST-com.google.firebase.encoders.processor.EncodableProcessorTest.xml
Raw output
value of:
compilation.generatedFile(/AutoGenericClassEncoder.java)
for file:
/SOURCE_OUTPUT/AutoGenericClassEncoder.java
expected to be equivalent to:
/home/runner/work/firebase-android-sdk/firebase-android-sdk/encoders/firebase-encoders-processor/build/resources/test/ExpectedGenericsEncoderWithUnknownType.java
diff:
Found 1 unmatched nodes in the actual tree.
> Extra node in actual tree.
Line 7 COMPILATION_UNIT->IMPORT(non-static)
Node contents: <import java.lang.Override;>.
expected:
// Copyright 2020 Google LLC
//
// Licensed 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.
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
/**
* @hide */
@SuppressWarnings("KotlinInternal")
public final class AutoGenericClassEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoGenericClassEncoder();
private AutoGenericClassEncoder() {}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(GenericClass.class, GenericClassEncoder.INSTANCE);
}
private static final class GenericClassEncoder implements ObjectEncoder<GenericClass> {
static final GenericClassEncoder INSTANCE = new GenericClassEncoder();
private static final FieldDescriptor T_DESCRIPTOR = FieldDescriptor.of("t");
private static final FieldDescriptor U_DESCRIPTOR = FieldDescriptor.of("u");
@Override
public void encode(GenericClass value, ObjectEncoderContext ctx) throws IOException {
ctx.add(T_DESCRIPTOR, value.getT());
ctx.add(U_DESCRIPTOR, value.getU());
}
}
}
but was:
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
import java.lang.Override;
import java.lang.SuppressWarnings;
@SuppressWarnings("KotlinInternal")
public final class AutoGenericClassEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoGenericClassEncoder();
private AutoGenericClassEncoder() {
}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(GenericClass.class, GenericClassEncoder.INSTANCE);
}
private static final class GenericClassEncoder implements ObjectEncoder<GenericClass> {
static final GenericClassEncoder INSTANCE = new GenericClassEncoder();
private static final FieldDescriptor T_DESCRIPTOR = FieldDescriptor.of("t");
private static final FieldDescriptor U_DESCRIPTOR = FieldDescriptor.of("u");
@Override
public void encode(GenericClass value, ObjectEncoderContext ctx) throws IOException {
ctx.add(T_DESCRIPTOR, value.getT());
ctx.add(U_DESCRIPTOR, value.getU());
}
}
}
compilation was:
compilation of [GenericClass.java] using annotation processors [com.google.firebase.encoders.processor.EncodableProcessor@57927bc9]
at app//com.google.firebase.encoders.processor.EncodableProcessorTest.compile_withGenericClass_ShouldWarnAboutPotentialProblems(EncodableProcessorTest.java:135)
Check warning on line 0 in com.google.firebase.encoders.processor.EncodableProcessorTest
github-actions / Unit Test Results
compile_withListOfCustomType_shouldRegisterEncoderForThatType (com.google.firebase.encoders.processor.EncodableProcessorTest) failed
artifacts/unit-test-result-/encoders/firebase-encoders-processor/build/test-results/test/TEST-com.google.firebase.encoders.processor.EncodableProcessorTest.xml
Raw output
value of:
compilation.generatedFile(/AutoTypeWithListEncoder.java)
for file:
/SOURCE_OUTPUT/AutoTypeWithListEncoder.java
expected to be equivalent to:
/home/runner/work/firebase-android-sdk/firebase-android-sdk/encoders/firebase-encoders-processor/build/resources/test/ExpectedTypeWithListEncoder.java
diff:
Found 1 unmatched nodes in the actual tree.
> Extra node in actual tree.
Line 7 COMPILATION_UNIT->IMPORT(non-static)
Node contents: <import java.lang.Override;>.
expected:
// Copyright 2019 Google LLC
//
// Licensed 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.
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
/**
* @hide */
@SuppressWarnings("KotlinInternal")
public final class AutoTypeWithListEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoTypeWithListEncoder();
private AutoTypeWithListEncoder() {}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(TypeWithList.class, TypeWithListEncoder.INSTANCE);
cfg.registerEncoder(Member.class, MemberEncoder.INSTANCE);
}
private static final class TypeWithListEncoder implements ObjectEncoder<TypeWithList> {
static final TypeWithListEncoder INSTANCE = new TypeWithListEncoder();
private static final FieldDescriptor MEMBER_DESCRIPTOR = FieldDescriptor.of("member");
@Override
public void encode(TypeWithList value, ObjectEncoderContext ctx) throws IOException {
ctx.add(MEMBER_DESCRIPTOR, value.getMember());
}
}
private static final class MemberEncoder implements ObjectEncoder<Member> {
static final MemberEncoder INSTANCE = new MemberEncoder();
@Override
public void encode(Member value, ObjectEncoderContext ctx) throws IOException {}
}
}
but was:
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
import java.lang.Override;
import java.lang.SuppressWarnings;
@SuppressWarnings("KotlinInternal")
public final class AutoTypeWithListEncoder implements Configurator {
public static final int CODEGEN_VERSION = 2;
public static final Configurator CONFIG = new AutoTypeWithListEncoder();
private AutoTypeWithListEncoder() {
}
@Override
public void configure(EncoderConfig<?> cfg) {
cfg.registerEncoder(TypeWithList.class, TypeWithListEncoder.INSTANCE);
cfg.registerEncoder(Member.class, MemberEncoder.INSTANCE);
}
private static final class TypeWithListEncoder implements ObjectEncoder<TypeWithList> {
static final TypeWithListEncoder INSTANCE = new TypeWithListEncoder();
private static final FieldDescriptor MEMBER_DESCRIPTOR = FieldDescriptor.of("member");
@Override
public void encode(TypeWithList value, ObjectEncoderContext ctx) throws IOException {
ctx.add(MEMBER_DESCRIPTOR, value.getMember());
}
}
private static final class MemberEncoder implements ObjectEncoder<Member> {
static final MemberEncoder INSTANCE = new MemberEncoder();
@Override
public void encode(Member value, ObjectEncoderContext ctx) throws IOException {
}
}
}
compilation was:
compilation of [TypeWithList.java, Member.java] using annotation processors [com.google.firebase.encoders.processor.EncodableProcessor@49665f92]
at app//com.google.firebase.encoders.processor.EncodableProcessorTest.compile_withListOfCustomType_shouldRegisterEncoderForThatType(EncodableProcessorTest.java:385)
Check warning on line 0 in com.google.firebase.encoders.processor.ExtraPropertyProcessorTest
github-actions / Unit Test Results
test (com.google.firebase.encoders.processor.ExtraPropertyProcessorTest) failed
artifacts/unit-test-result-/encoders/firebase-encoders-processor/build/test-results/test/TEST-com.google.firebase.encoders.processor.ExtraPropertyProcessorTest.xml
Raw output
value of:
compilation.generatedFile(/com/example/AtEmptyAnnotation.java)
for file:
/SOURCE_OUTPUT/com/example/AtEmptyAnnotation.java
expected to be equivalent to:
/home/runner/work/firebase-android-sdk/firebase-android-sdk/encoders/firebase-encoders-processor/build/resources/test/ExpectedAtEmptyAnnotation.java
diff:
Found 1 unmatched nodes in the actual tree.
> Extra node in actual tree.
Line 4 COMPILATION_UNIT->IMPORT(non-static)
Node contents: <import java.lang.Object;>.
Found 3 nodes that differed in expected and actual trees.
> Difference in expected tree and actual tree.
Expected node: Line 17 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Annotation)
Actual node: Line 3 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Class)
Expected member identifier to be <Annotation> but was <Class>.
> Difference in expected tree and actual tree.
Expected node: Line 17 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Annotation)->MEMBER_SELECT(annotation)
Actual node: Line 3 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Class)->MEMBER_SELECT(lang)
Expected member identifier to be <annotation> but was <lang>.
> Difference in expected tree and actual tree.
Expected node: Line 17 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Annotation)->MEMBER_SELECT(annotation)->MEMBER_SELECT(lang)->MEMBER_SELECT(lang)
Actual node: Line 3 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Class)->MEMBER_SELECT(lang)->IDENTIFIER(java)->IDENTIFIER(java)
Expected node kind to be <MEMBER_SELECT> but was <IDENTIFIER>.
expected:
// Copyright 2020 Google LLC
//
// Licensed 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 com.example;
import java.lang.annotation.Annotation;
public final class AtEmptyAnnotation {
private static final AtEmptyAnnotation BUILDER = new AtEmptyAnnotation();
private static final EmptyAnnotation INSTANCE = new EmptyAnnotationImpl();
private AtEmptyAnnotation() {}
public static AtEmptyAnnotation builder() {
return BUILDER;
}
public EmptyAnnotation build() {
return INSTANCE;
}
private static final class EmptyAnnotationImpl implements EmptyAnnotation {
EmptyAnnotationImpl() {}
@Override
public Class<? extends Annotation> annotationType() {
return EmptyAnnotation.class;
}
@Override
public boolean equals(Object other) {
if (this == other) return true;
if (!(other instanceof EmptyAnnotation)) return false;
EmptyAnnotation that = (EmptyAnnotation) other;
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("@com.example.EmptyAnnotation");
return sb.toString();
}
}
}
but was:
package com.example;
import java.lang.Class;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.annotation.Annotation;
public final class AtEmptyAnnotation {
private static final AtEmptyAnnotation BUILDER = new AtEmptyAnnotation();
private static final EmptyAnnotation INSTANCE = new EmptyAnnotationImpl();
private AtEmptyAnnotation() {
}
public static AtEmptyAnnotation builder() {
return BUILDER;
}
public EmptyAnnotation build() {
return INSTANCE;
}
private static final class EmptyAnnotationImpl implements EmptyAnnotation {
EmptyAnnotationImpl() {
}
@Override
public Class<? extends Annotation> annotationType() {
return EmptyAnnotation.class;
}
@Override
public boolean equals(Object other) {
if (this == other) return true;
if (!(other instanceof EmptyAnnotation)) return false;
EmptyAnnotation that = (EmptyAnnotation) other;
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("@com.example.EmptyAnnotation");
return sb.toString();
}
}
}
compilation was:
compilation of [com/example/EmptyAnnotation.java] using annotation processors [com.google.firebase.encoders.processor.ExtraPropertyProcessor@7bf94e91]
at app//com.google.firebase.encoders.processor.ExtraPropertyProcessorTest.test(ExtraPropertyProcessorTest.java:44)
Check warning on line 0 in com.google.firebase.encoders.processor.ExtraPropertyProcessorTest
github-actions / Unit Test Results
test2 (com.google.firebase.encoders.processor.ExtraPropertyProcessorTest) failed
artifacts/unit-test-result-/encoders/firebase-encoders-processor/build/test-results/test/TEST-com.google.firebase.encoders.processor.ExtraPropertyProcessorTest.xml
Raw output
value of:
compilation.generatedFile(/com/example/AtMyAnnotation.java)
for file:
/SOURCE_OUTPUT/com/example/AtMyAnnotation.java
expected to be equivalent to:
/home/runner/work/firebase-android-sdk/firebase-android-sdk/encoders/firebase-encoders-processor/build/resources/test/ExpectedAtMyAnnotation.java
diff:
Found 1 unmatched nodes in the actual tree.
> Extra node in actual tree.
Line 5 COMPILATION_UNIT->IMPORT(non-static)
Node contents: <import java.lang.Override;>.
Found 5 nodes that differed in expected and actual trees.
> Difference in expected tree and actual tree.
Expected node: Line 17 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Annotation)
Actual node: Line 3 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Class)
Expected member identifier to be <Annotation> but was <Class>.
> Difference in expected tree and actual tree.
Expected node: Line 17 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Annotation)->MEMBER_SELECT(annotation)
Actual node: Line 3 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Class)->MEMBER_SELECT(lang)
Expected member identifier to be <annotation> but was <lang>.
> Difference in expected tree and actual tree.
Expected node: Line 17 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Annotation)->MEMBER_SELECT(annotation)->MEMBER_SELECT(lang)->MEMBER_SELECT(lang)
Actual node: Line 3 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Class)->MEMBER_SELECT(lang)->IDENTIFIER(java)->IDENTIFIER(java)
Expected node kind to be <MEMBER_SELECT> but was <IDENTIFIER>.
> Difference in expected tree and actual tree.
Expected node: Line 18 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Arrays)
Actual node: Line 4 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Object)
Expected member identifier to be <Arrays> but was <Object>.
> Difference in expected tree and actual tree.
Expected node: Line 18 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Arrays)->MEMBER_SELECT(util)
Actual node: Line 4 COMPILATION_UNIT->IMPORT(non-static)->MEMBER_SELECT(Object)->MEMBER_SELECT(lang)
Expected member identifier to be <util> but was <lang>.
expected:
// Copyright 2020 Google LLC
//
// Licensed 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 com.example;
import java.lang.annotation.Annotation;
import java.util.Arrays;
public final class AtMyAnnotation {
private int intVal;
private long longVal;
private boolean boolVal;
private short shortVal;
private float floatVal;
private double doubleVal;
private double[] doubleArrayVal;
private String strVal = "default";
private MyAnnotation.MyEnum enumVal = MyAnnotation.MyEnum.VALUE1;
public AtMyAnnotation intVal(int intVal) {
this.intVal = intVal;
return this;
}
public AtMyAnnotation longVal(long longVal) {
this.longVal = longVal;
return this;
}
public AtMyAnnotation boolVal(boolean boolVal) {
this.boolVal = boolVal;
return this;
}
public AtMyAnnotation shortVal(short shortVal) {
this.shortVal = shortVal;
return this;
}
public AtMyAnnotation floatVal(float floatVal) {
this.floatVal = floatVal;
return this;
}
public AtMyAnnotation doubleVal(double doubleVal) {
this.doubleVal = doubleVal;
return this;
}
public AtMyAnnotation doubleArrayVal(double[] doubleArrayVal) {
this.doubleArrayVal = doubleArrayVal;
return this;
}
public AtMyAnnotation strVal(String strVal) {
this.strVal = strVal;
return this;
}
public AtMyAnnotation enumVal(MyAnnotation.MyEnum enumVal) {
this.enumVal = enumVal;
return this;
}
public static AtMyAnnotation builder() {
return new AtMyAnnotation();
}
public MyAnnotation build() {
return new MyAnnotationImpl(
intVal, longVal, boolVal, shortVal, floatVal, doubleVal, doubleArrayVal, strVal, enumVal);
}
private static final class MyAnnotationImpl implements MyAnnotation {
private final int intVal;
private final long longVal;
private final boolean boolVal;
private final short shortVal;
private final float floatVal;
private final double doubleVal;
private final double[] doubleArrayVal;
private final String strVal;
private final MyAnnotation.MyEnum enumVal;
MyAnnotationImpl(
int intVal,
long longVal,
boolean boolVal,
short shortVal,
float floatVal,
double doubleVal,
double[] doubleArrayVal,
String strVal,
MyAnnotation.MyEnum enumVal) {
this.intVal = intVal;
this.longVal = longVal;
this.boolVal = boolVal;
this.shortVal = shortVal;
this.floatVal = floatVal;
this.doubleVal = doubleVal;
this.doubleArrayVal = doubleArrayVal;
this.strVal = strVal;
this.enumVal = enumVal;
}
@Override
public Class<? extends Annotation> annotationType() {
return MyAnnotation.class;
}
@Override
public int intVal() {
return intVal;
}
@Override
public long longVal() {
return longVal;
}
@Override
public boolean boolVal() {
return boolVal;
}
@Override
public short shortVal() {
return shortVal;
}
@Override
public float floatVal() {
return floatVal;
}
@Override
public double doubleVal() {
return doubleVal;
}
@Override
public double[] doubleArrayVal() {
return doubleArrayVal;
}
@Override
public String strVal() {
return strVal;
}
@Override
public MyAnnotation.MyEnum enumVal() {
return enumVal;
}
@Override
public boolean equals(Object other) {
if (this == other) return true;
if (!(other instanceof MyAnnotation)) return false;
MyAnnotation that = (MyAnnotation) other;
return (intVal == that.intVal())
&& (longVal == that.longVal())
&& (boolVal == that.boolVal())
&& (shortVal == that.shortVal())
&& (Float.floatToIntBits(floatVal) == Float.floatToIntBits(that.floatVal()))
&& (Double.doubleToLongBits(doubleVal) == Double.doubleToLongBits(that.doubleVal()))
&& (Arrays.equals(doubleArrayVal, that.doubleArrayVal()))
&& (doubleArrayVal.equals(that.doubleArrayVal()))
&& (strVal.equals(that.strVal()))
&& (enumVal.equals(that.enumVal()));
}
@Override
public int hashCode() {
return +(-15901618 ^ ((int) intVal))
+ (1338661755 ^ ((int) (longVal ^ (longVal >>> 32))))
+ (-373377111 ^ (boolVal ? 1231 : 1237))
+ (-549529221 ^ ((int) shortVal))
+ (1880085339 ^ (Float.floatToIntBits(floatVal)))
+ (696767088
^ ((int)
((Double.doubleToLongBits(doubleVal) >>> 32)
^ Double.doubleToLongBits(doubleVal))))
+ (-1932334201 ^ Arrays.hashCode(doubleArrayVal))
+ (-1615429424 ^ strVal.hashCode())
+ (-170319456 ^ enumVal.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("@com.example.MyAnnotation");
sb.append('(');
sb.append("intVal=").append(intVal);
sb.append("longVal=").append(longVal);
sb.append("boolVal=").append(boolVal);
sb.append("shortVal=").append(shortVal);
sb.append("floatVal=").append(floatVal);
sb.append("doubleVal=").append(doubleVal);
sb.append("doubleArrayVal=").append(doubleArrayVal);
sb.append("strVal=").append(strVal);
sb.append("enumVal=").append(enumVal);
sb.append(')');
return sb.toString();
}
}
}
but was:
package com.example;
import java.lang.Class;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.annotation.Annotation;
import java.util.Arrays;
public final class AtMyAnnotation {
private int intVal;
private long longVal;
private boolean boolVal;
private short shortVal;
private float floatVal;
private double doubleVal;
private double[] doubleArrayVal;
private String strVal = "default";
private MyAnnotation.MyEnum enumVal = MyAnnotation.MyEnum.VALUE1;
public AtMyAnnotation intVal(int intVal) {
this.intVal = intVal;
return this;
}
public AtMyAnnotation longVal(long longVal) {
this.longVal = longVal;
return this;
}
public AtMyAnnotation boolVal(boolean boolVal) {
this.boolVal = boolVal;
return this;
}
public AtMyAnnotation shortVal(short shortVal) {
this.shortVal = shortVal;
return this;
}
public AtMyAnnotation floatVal(float floatVal) {
this.floatVal = floatVal;
return this;
}
public AtMyAnnotation doubleVal(double doubleVal) {
this.doubleVal = doubleVal;
return this;
}
public AtMyAnnotation doubleArrayVal(double[] doubleArrayVal) {
this.doubleArrayVal = doubleArrayVal;
return this;
}
public AtMyAnnotation strVal(String strVal) {
this.strVal = strVal;
return this;
}
public AtMyAnnotation enumVal(MyAnnotation.MyEnum enumVal) {
this.enumVal = enumVal;
return this;
}
public static AtMyAnnotation builder() {
return new AtMyAnnotation();
}
public MyAnnotation build() {
return new MyAnnotationImpl(intVal, longVal, boolVal, shortVal, floatVal, doubleVal, doubleArrayVal, strVal, enumVal);
}
private static final class MyAnnotationImpl implements MyAnnotation {
private final int intVal;
private final long longVal;
private final boolean boolVal;
private final short shortVal;
private final float floatVal;
private final double doubleVal;
private final double[] doubleArrayVal;
private final String strVal;
private final MyAnnotation.MyEnum enumVal;
MyAnnotationImpl(int intVal, long longVal, boolean boolVal, short shortVal, float floatVal,
double doubleVal, double[] doubleArrayVal, String strVal, MyAnnotation.MyEnum enumVal) {
this.intVal = intVal;
this.longVal = longVal;
this.boolVal = boolVal;
this.shortVal = shortVal;
this.floatVal = floatVal;
this.doubleVal = doubleVal;
this.doubleArrayVal = doubleArrayVal;
this.strVal = strVal;
this.enumVal = enumVal;
}
@Override
public Class<? extends Annotation> annotationType() {
return MyAnnotation.class;
}
@Override
public int intVal() {
return intVal;
}
@Override
public long longVal() {
return longVal;
}
@Override
public boolean boolVal() {
return boolVal;
}
@Override
public short shortVal() {
return shortVal;
}
@Override
public float floatVal() {
return floatVal;
}
@Override
public double doubleVal() {
return doubleVal;
}
@Override
public double[] doubleArrayVal() {
return doubleArrayVal;
}
@Override
public String strVal() {
return strVal;
}
@Override
public MyAnnotation.MyEnum enumVal() {
return enumVal;
}
@Override
public boolean equals(Object other) {
if (this == other) return true;
if (!(other instanceof MyAnnotation)) return false;
MyAnnotation that = (MyAnnotation) other;
return (intVal == that.intVal())
&& (longVal == that.longVal())
&& (boolVal == that.boolVal())
&& (shortVal == that.shortVal())
&& (Float.floatToIntBits(floatVal) == Float.floatToIntBits(that.floatVal()))
&& (Double.doubleToLongBits(doubleVal) == Double.doubleToLongBits(that.doubleVal()))
&& (Arrays.equals(doubleArrayVal, that.doubleArrayVal()))
&& (doubleArrayVal.equals(that.doubleArrayVal()))
&& (strVal.equals(that.strVal()))
&& (enumVal.equals(that.enumVal()));
}
@Override
public int hashCode() {
return + (-15901618 ^ ((int)intVal))
+ (1338661755 ^ ((int)(longVal ^ (longVal >>> 32))))
+ (-373377111 ^ (boolVal ? 1231 : 1237))
+ (-549529221 ^ ((int)shortVal))
+ (1880085339 ^ (Float.floatToIntBits(floatVal)))
+ (696767088 ^ ((int) ((Double.doubleToLongBits(doubleVal) >>> 32) ^ Double.doubleToLongBits(doubleVal))))
+ (-1932334201 ^ Arrays.hashCode(doubleArrayVal))
+ (-1615429424 ^ strVal.hashCode())
+ (-170319456 ^ enumVal.hashCode())
;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("@com.example.MyAnnotation");
sb.append('(');
sb.append("intVal=").append(intVal);
sb.append("longVal=").append(longVal);
sb.append("boolVal=").append(boolVal);
sb.append("shortVal=").append(shortVal);
sb.append("floatVal=").append(floatVal);
sb.append("doubleVal=").append(doubleVal);
sb.append("doubleArrayVal=").append(doubleArrayVal);
sb.append("strVal=").append(strVal);
sb.append("enumVal=").append(enumVal);
sb.append(')');
return sb.toString();
}
}
}
compilation was:
compilation of [com/example/MyAnnotation.java] using annotation processors [com.google.firebase.encoders.processor.ExtraPropertyProcessor@63d14dbf]
at app//com.google.firebase.encoders.processor.ExtraPropertyProcessorTest.test2(ExtraPropertyProcessorTest.java:74)