target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void testFieldMethodProperty() { ParcelableDescriptor analysis = analyze(FieldMethodProperty.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(1, analysis.getFieldPairs().size()); assertEquals(1, analysis.getMethodPairs().size()); ... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testAbstractParcelWitFactory() { ParcelableDescriptor analysis = analyze(AbstractParcelWithFactory.class); assertNull(analysis.getParcelConverterType()); assertNotNull(analysis.getConstructorPair()); assertNotNull(analysis.getConstructorPair().getFactoryMethod()); assertNull(analysis.getConstructorPai... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testNonBeanMethodProperty() { ParcelableDescriptor analysis = analyze(NonBeanMethodProperty.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(1, analysis.getMethodPairs().size(... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testCollidingConstructorProperty() { ParcelableDescriptor analysis = analyze(CollidingConstructorProperty.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMetho... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testCollidingMethodProperty() { ParcelableDescriptor analysis = analyze(CollidingMethodProperty.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(1, analysis.getMethodPairs().s... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testConstructorConverterSerialization() { ParcelableDescriptor analysis = analyze(ConstructorConverterSerialization.class); ASTParameter parameter = analysis.getConstructorPair().getConstructor().getParameters().get(0); Map<ASTParameter,ASTType> converters = analysis.getConstructorPair().getConverters... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testUnnamedConstructorConverterSerialization() { ParcelableDescriptor analysis = analyze(UnnamedConstructorConverterSerialization.class); ASTParameter parameter = analysis.getConstructorPair().getConstructor().getParameters().get(0); Map<ASTParameter,ASTType> converters = analysis.getConstructorPair()... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testFieldInheritance() { ParcelableDescriptor analysis = analyze(FieldSubClass.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(2, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMethodPairs().size()); assertNot... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testMethodOverrideInheritance() { ParcelableDescriptor analysis = analyze(MethodSubClass.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(1, analysis.getMethodPairs().size());... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testConstructorWithSuperClassParameter() { ParcelableDescriptor analysis = analyze(ConstructorSubclass.class); assertNull(analysis.getParcelConverterType()); assertNotNull(analysis.getConstructorPair()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMethodPairs().size()... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testDefaultToEmptyBeanConstructor() { ParcelableDescriptor analysis = analyze(DefaultToEmptyBeanConstructor.class); assertNull(analysis.getParcelConverterType()); assertNotNull(analysis.getConstructorPair()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMethodPairs().s... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testFactoryMethod() { ParcelableDescriptor analysis = analyze(FactoryMethod.class); assertNull(analysis.getParcelConverterType()); assertFalse(messager.getMessage(), messager.isErrored()); assertNotNull(analysis.getConstructorPair()); assertNotNull(analysis.getConstructorPair().getFactoryMethod()); as... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testDescribeContents() { ParcelableDescriptor analysis = analyze(DescribedContents.class); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMethodPairs().size()); assertNotNull(analysis.getConstructorPair()); assertEquals(0, a... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testConverterSubType() { ParcelableDescriptor analysis = analyze(ConverterSubType.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertNotNull(analysis.getConstructorPair()); assertEquals(1, analysis.getFieldPairs().size()); assertEqual... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testAnalysisLimit() { ParcelableDescriptor analysis = analyze(ParcelExtension.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertNotNull(analysis.getConstructorPair()); assertEquals(1, analysis.getFieldPairs().size()); assertEquals(0,... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testSkipAnalysis() { ParcelableDescriptor analysis = analyze(C.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertNotNull(analysis.getConstructorPair()); assertEquals(2, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMe... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testValueClassAnalysis() { ParcelableDescriptor analysis = analyze(ValueClass.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertNotNull(analysis.getConstructorPair()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(1,... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testGenericDeclaredType() { ParcelableDescriptor analysis = analyze(Concrete.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertNotNull(analysis.getConstructorPair()); assertEquals(1, analysis.getFieldPairs().size()); assertEquals(0, ... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testGenericMethodDeclaredType() { ParcelableDescriptor analysis = analyze(ConcreteBean.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertNotNull(analysis.getConstructorPair()); assertEquals(0, analysis.getFieldPairs().size()); assert... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testCallbackAnalysis() { ParcelableDescriptor analysis = analyze(CallbackExample.class); assertNull(analysis.getParcelConverterType()); assertNotNull(analysis.getConstructorPair()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMethodPairs().size()); assertEquals(0, ana... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testCallbackInheritanceAnalysis() { ParcelableDescriptor analysis = analyze(CallbackInheritanceExample.class); assertNull(analysis.getParcelConverterType()); assertNotNull(analysis.getConstructorPair()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMethodPairs().size()... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testmismatchedPrimitiveBeanTypes2() { analyze(MismatchedPrimitiveBeanTypes2.class); assertFalse(messager.getMessage(), messager.isErrored()); } | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testUndefinedGeneric() { analyze(UndefinedGeneric.class); assertTrue(messager.getMessage(), messager.isErrored()); } | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testFieldSerialization(){ ParcelableDescriptor analysis = analyze(FieldSerialization.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(1, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMethodPairs().size()); ass... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testTransientFieldSerialization(){ ParcelableDescriptor analysis = analyze(TransientFieldSerialization.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMethodPa... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testStaticFieldExclusion() { ParcelableDescriptor analysis = analyze(StaticFieldExcluded.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMethodPairs().size());... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testStaticMethodExclusion() { ParcelableDescriptor analysis = analyze(StaticMethodsExcluded.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMethodPairs().size(... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testConstructor(){ ParcelableDescriptor analysis = analyze(ConstructorSerialization.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMethodPairs().size()); asse... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testUnnamedConstructorSerialization() { ParcelableDescriptor analysis = analyze(UnnamedConstructorSerialization.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysis.ge... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testConstructorMethod() { ParcelableDescriptor analysis = analyze(ConstructorMethod.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMethodPairs().size()); asse... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void shouldAutoConfigureSpringSkills() { this.contextRunner.withUserConfiguration(EmptyConfiguration.class) .run( context -> { assertThat(context).hasSingleBean(SpeechRequestDispatcher.class); assertThat(context.getBean(SpeechRequestDispatcher.class)) .isSameAs(context.getBean(SpringSkillsAutoConfiguration... | @Bean @ConditionalOnMissingBean(value=SpeechRequestDispatcher.class) public SpeechRequestDispatcher dispatcher() { return new BeanNameSpeechRequestDispatcher( (request) -> { Speech speech = new Speech(); speech.setSsml("<speak>I don't know what you're doing...</speak>"); SpeechCard card = new SpeechCard("Unknown", "Unk... | SpringSkillsAutoConfiguration { @Bean @ConditionalOnMissingBean(value=SpeechRequestDispatcher.class) public SpeechRequestDispatcher dispatcher() { return new BeanNameSpeechRequestDispatcher( (request) -> { Speech speech = new Speech(); speech.setSsml("<speak>I don't know what you're doing...</speak>"); SpeechCard card ... | SpringSkillsAutoConfiguration { @Bean @ConditionalOnMissingBean(value=SpeechRequestDispatcher.class) public SpeechRequestDispatcher dispatcher() { return new BeanNameSpeechRequestDispatcher( (request) -> { Speech speech = new Speech(); speech.setSsml("<speak>I don't know what you're doing...</speak>"); SpeechCard card ... | SpringSkillsAutoConfiguration { @Bean @ConditionalOnMissingBean(value=SpeechRequestDispatcher.class) public SpeechRequestDispatcher dispatcher() { return new BeanNameSpeechRequestDispatcher( (request) -> { Speech speech = new Speech(); speech.setSsml("<speak>I don't know what you're doing...</speak>"); SpeechCard card ... | SpringSkillsAutoConfiguration { @Bean @ConditionalOnMissingBean(value=SpeechRequestDispatcher.class) public SpeechRequestDispatcher dispatcher() { return new BeanNameSpeechRequestDispatcher( (request) -> { Speech speech = new Speech(); speech.setSsml("<speak>I don't know what you're doing...</speak>"); SpeechCard card ... |
@Test public void shouldBackoffOnSpeechRequestDispatcherConfiguration() { this.contextRunner.withUserConfiguration(SpeechRequestDispatcherConfiguration.class) .run( context -> { assertThat(context).hasSingleBean(SpeechRequestDispatcher.class); assertThat(context.getBean(SpeechRequestDispatcher.class)) .isSameAs(context... | @Bean @ConditionalOnMissingBean(value=SpeechRequestDispatcher.class) public SpeechRequestDispatcher dispatcher() { return new BeanNameSpeechRequestDispatcher( (request) -> { Speech speech = new Speech(); speech.setSsml("<speak>I don't know what you're doing...</speak>"); SpeechCard card = new SpeechCard("Unknown", "Unk... | SpringSkillsAutoConfiguration { @Bean @ConditionalOnMissingBean(value=SpeechRequestDispatcher.class) public SpeechRequestDispatcher dispatcher() { return new BeanNameSpeechRequestDispatcher( (request) -> { Speech speech = new Speech(); speech.setSsml("<speak>I don't know what you're doing...</speak>"); SpeechCard card ... | SpringSkillsAutoConfiguration { @Bean @ConditionalOnMissingBean(value=SpeechRequestDispatcher.class) public SpeechRequestDispatcher dispatcher() { return new BeanNameSpeechRequestDispatcher( (request) -> { Speech speech = new Speech(); speech.setSsml("<speak>I don't know what you're doing...</speak>"); SpeechCard card ... | SpringSkillsAutoConfiguration { @Bean @ConditionalOnMissingBean(value=SpeechRequestDispatcher.class) public SpeechRequestDispatcher dispatcher() { return new BeanNameSpeechRequestDispatcher( (request) -> { Speech speech = new Speech(); speech.setSsml("<speak>I don't know what you're doing...</speak>"); SpeechCard card ... | SpringSkillsAutoConfiguration { @Bean @ConditionalOnMissingBean(value=SpeechRequestDispatcher.class) public SpeechRequestDispatcher dispatcher() { return new BeanNameSpeechRequestDispatcher( (request) -> { Speech speech = new Speech(); speech.setSsml("<speak>I don't know what you're doing...</speak>"); SpeechCard card ... |
@Test public void shouldAutoConfigureAlexaBeans() { this.contextRunner.withUserConfiguration(EmptyConfiguration.class) .run( context -> { SpeechRequestDispatcher dispatcher = context.getBean(SpeechRequestDispatcher.class); assertThat(context).hasSingleBean(WebhookController.class); assertThat(context.getBean(WebhookCon... | @Bean @ConditionalOnMissingBean(WebhookController.class) public WebhookController webhookController(SpeechRequestDispatcher dispatcher) { return new WebhookController(dispatcher); } | GoogleAssistantAutoConfiguration { @Bean @ConditionalOnMissingBean(WebhookController.class) public WebhookController webhookController(SpeechRequestDispatcher dispatcher) { return new WebhookController(dispatcher); } } | GoogleAssistantAutoConfiguration { @Bean @ConditionalOnMissingBean(WebhookController.class) public WebhookController webhookController(SpeechRequestDispatcher dispatcher) { return new WebhookController(dispatcher); } } | GoogleAssistantAutoConfiguration { @Bean @ConditionalOnMissingBean(WebhookController.class) public WebhookController webhookController(SpeechRequestDispatcher dispatcher) { return new WebhookController(dispatcher); } @Bean @ConditionalOnMissingBean(WebhookController.class) WebhookController webhookController(SpeechReq... | GoogleAssistantAutoConfiguration { @Bean @ConditionalOnMissingBean(WebhookController.class) public WebhookController webhookController(SpeechRequestDispatcher dispatcher) { return new WebhookController(dispatcher); } @Bean @ConditionalOnMissingBean(WebhookController.class) WebhookController webhookController(SpeechReq... |
@Test public void shouldBackOffOnAutoConfiguredAlexaBeans() { this.contextRunner.withUserConfiguration(GoogleConfiguration.class) .run( context -> { SpeechRequestDispatcher dispatcher = context.getBean(SpeechRequestDispatcher.class); assertThat(context).hasSingleBean(WebhookController.class); assertThat(context.getBean... | @Bean @ConditionalOnMissingBean(WebhookController.class) public WebhookController webhookController(SpeechRequestDispatcher dispatcher) { return new WebhookController(dispatcher); } | GoogleAssistantAutoConfiguration { @Bean @ConditionalOnMissingBean(WebhookController.class) public WebhookController webhookController(SpeechRequestDispatcher dispatcher) { return new WebhookController(dispatcher); } } | GoogleAssistantAutoConfiguration { @Bean @ConditionalOnMissingBean(WebhookController.class) public WebhookController webhookController(SpeechRequestDispatcher dispatcher) { return new WebhookController(dispatcher); } } | GoogleAssistantAutoConfiguration { @Bean @ConditionalOnMissingBean(WebhookController.class) public WebhookController webhookController(SpeechRequestDispatcher dispatcher) { return new WebhookController(dispatcher); } @Bean @ConditionalOnMissingBean(WebhookController.class) WebhookController webhookController(SpeechReq... | GoogleAssistantAutoConfiguration { @Bean @ConditionalOnMissingBean(WebhookController.class) public WebhookController webhookController(SpeechRequestDispatcher dispatcher) { return new WebhookController(dispatcher); } @Bean @ConditionalOnMissingBean(WebhookController.class) WebhookController webhookController(SpeechReq... |
@Test public void shouldSayHello() throws InterruptedException { assertEquals("hi", new Hello("hi").say()); Thread.sleep(1000); } | public String say() { return hello; } | Hello { public String say() { return hello; } } | Hello { public String say() { return hello; } Hello(String s); } | Hello { public String say() { return hello; } Hello(String s); String say(); } | Hello { public String say() { return hello; } Hello(String s); String say(); } |
@Test public void testOverrides() { Assert.assertEquals("value1", AppConfiguration.INSTANCE.getString("property_a")); Assert.assertEquals("value2", AppConfiguration.INSTANCE.getString("property_b")); Assert.assertEquals("value3", AppConfiguration.INSTANCE.getString("property_c")); Assert.assertEquals("value4", AppConfi... | public String getString(final String propertyName) { if(this.javaSystemConfig.containsKey(propertyName)) { return this.javaSystemConfig.getString(propertyName); } List<String> propertiesToAttempt = getOrderedPropertyList(propertyName); for (String propertyToAttempt : propertiesToAttempt) { if (this.serviceConfig.contai... | AppConfiguration { public String getString(final String propertyName) { if(this.javaSystemConfig.containsKey(propertyName)) { return this.javaSystemConfig.getString(propertyName); } List<String> propertiesToAttempt = getOrderedPropertyList(propertyName); for (String propertyToAttempt : propertiesToAttempt) { if (this.s... | AppConfiguration { public String getString(final String propertyName) { if(this.javaSystemConfig.containsKey(propertyName)) { return this.javaSystemConfig.getString(propertyName); } List<String> propertiesToAttempt = getOrderedPropertyList(propertyName); for (String propertyToAttempt : propertiesToAttempt) { if (this.s... | AppConfiguration { public String getString(final String propertyName) { if(this.javaSystemConfig.containsKey(propertyName)) { return this.javaSystemConfig.getString(propertyName); } List<String> propertiesToAttempt = getOrderedPropertyList(propertyName); for (String propertyToAttempt : propertiesToAttempt) { if (this.s... | AppConfiguration { public String getString(final String propertyName) { if(this.javaSystemConfig.containsKey(propertyName)) { return this.javaSystemConfig.getString(propertyName); } List<String> propertiesToAttempt = getOrderedPropertyList(propertyName); for (String propertyToAttempt : propertiesToAttempt) { if (this.s... |
@Test public void testHexToByte() { Assert.assertEquals("00", HexUtil.toHexFromByte((byte)0x00)); Assert.assertEquals("01", HexUtil.toHexFromByte((byte)0x01)); Assert.assertEquals("02", HexUtil.toHexFromByte((byte)0x02)); Assert.assertEquals("03", HexUtil.toHexFromByte((byte)0x03)); Assert.assertEquals("04", HexUtil.to... | public static String toHexFromByte(final byte b) { byte leftSymbol = (byte) ((b >>> BITS_PER_HEX_DIGIT) & 0x0f); byte rightSymbol = (byte) (b & 0x0f); return (hexSymbols[leftSymbol] + hexSymbols[rightSymbol]); } | HexUtil { public static String toHexFromByte(final byte b) { byte leftSymbol = (byte) ((b >>> BITS_PER_HEX_DIGIT) & 0x0f); byte rightSymbol = (byte) (b & 0x0f); return (hexSymbols[leftSymbol] + hexSymbols[rightSymbol]); } } | HexUtil { public static String toHexFromByte(final byte b) { byte leftSymbol = (byte) ((b >>> BITS_PER_HEX_DIGIT) & 0x0f); byte rightSymbol = (byte) (b & 0x0f); return (hexSymbols[leftSymbol] + hexSymbols[rightSymbol]); } } | HexUtil { public static String toHexFromByte(final byte b) { byte leftSymbol = (byte) ((b >>> BITS_PER_HEX_DIGIT) & 0x0f); byte rightSymbol = (byte) (b & 0x0f); return (hexSymbols[leftSymbol] + hexSymbols[rightSymbol]); } static String toHexFromByte(final byte b); static byte toByteFromHex(char upperChar, char lowerCh... | HexUtil { public static String toHexFromByte(final byte b) { byte leftSymbol = (byte) ((b >>> BITS_PER_HEX_DIGIT) & 0x0f); byte rightSymbol = (byte) (b & 0x0f); return (hexSymbols[leftSymbol] + hexSymbols[rightSymbol]); } static String toHexFromByte(final byte b); static byte toByteFromHex(char upperChar, char lowerCh... |
@Test public void testByteToHex() { Assert.assertEquals((byte)0x00, HexUtil.toByteFromHex('0','0')); Assert.assertEquals((byte)0x01, HexUtil.toByteFromHex('0','1')); Assert.assertEquals((byte)0x02, HexUtil.toByteFromHex('0','2')); Assert.assertEquals((byte)0x03, HexUtil.toByteFromHex('0','3')); Assert.assertEquals((byt... | public static byte toByteFromHex(char upperChar, char lowerChar) { byte upper = HEX_TO_BYTE_MAP.get(Character.toLowerCase(upperChar)); byte lower = HEX_TO_BYTE_MAP.get(Character.toLowerCase(lowerChar)); return (byte) ((upper << BITS_PER_HEX_DIGIT) + lower); } | HexUtil { public static byte toByteFromHex(char upperChar, char lowerChar) { byte upper = HEX_TO_BYTE_MAP.get(Character.toLowerCase(upperChar)); byte lower = HEX_TO_BYTE_MAP.get(Character.toLowerCase(lowerChar)); return (byte) ((upper << BITS_PER_HEX_DIGIT) + lower); } } | HexUtil { public static byte toByteFromHex(char upperChar, char lowerChar) { byte upper = HEX_TO_BYTE_MAP.get(Character.toLowerCase(upperChar)); byte lower = HEX_TO_BYTE_MAP.get(Character.toLowerCase(lowerChar)); return (byte) ((upper << BITS_PER_HEX_DIGIT) + lower); } } | HexUtil { public static byte toByteFromHex(char upperChar, char lowerChar) { byte upper = HEX_TO_BYTE_MAP.get(Character.toLowerCase(upperChar)); byte lower = HEX_TO_BYTE_MAP.get(Character.toLowerCase(lowerChar)); return (byte) ((upper << BITS_PER_HEX_DIGIT) + lower); } static String toHexFromByte(final byte b); static... | HexUtil { public static byte toByteFromHex(char upperChar, char lowerChar) { byte upper = HEX_TO_BYTE_MAP.get(Character.toLowerCase(upperChar)); byte lower = HEX_TO_BYTE_MAP.get(Character.toLowerCase(lowerChar)); return (byte) ((upper << BITS_PER_HEX_DIGIT) + lower); } static String toHexFromByte(final byte b); static... |
@Test public void testHexToBytes() { byte[] bytes = { (byte)0x0a, (byte)0xff, (byte)0x12, (byte)0x38, (byte)0xde, (byte)0xad, (byte)0xbe, (byte)0xef, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xde, (byte)0xad, (byte)0xc0, (byte)0xde }; Assert.assertEquals("0aff1238deadbeef00000000deadc0de", HexUtil.toHexFro... | public static String toHexFromBytes(final ByteBuffer bytes) { if (bytes == null) { return ""; } StringBuilder hexBuffer = new StringBuilder(); while (bytes.hasRemaining()) { hexBuffer.append(toHexFromByte(bytes.get())); } return hexBuffer.toString(); } | HexUtil { public static String toHexFromBytes(final ByteBuffer bytes) { if (bytes == null) { return ""; } StringBuilder hexBuffer = new StringBuilder(); while (bytes.hasRemaining()) { hexBuffer.append(toHexFromByte(bytes.get())); } return hexBuffer.toString(); } } | HexUtil { public static String toHexFromBytes(final ByteBuffer bytes) { if (bytes == null) { return ""; } StringBuilder hexBuffer = new StringBuilder(); while (bytes.hasRemaining()) { hexBuffer.append(toHexFromByte(bytes.get())); } return hexBuffer.toString(); } } | HexUtil { public static String toHexFromBytes(final ByteBuffer bytes) { if (bytes == null) { return ""; } StringBuilder hexBuffer = new StringBuilder(); while (bytes.hasRemaining()) { hexBuffer.append(toHexFromByte(bytes.get())); } return hexBuffer.toString(); } static String toHexFromByte(final byte b); static byte t... | HexUtil { public static String toHexFromBytes(final ByteBuffer bytes) { if (bytes == null) { return ""; } StringBuilder hexBuffer = new StringBuilder(); while (bytes.hasRemaining()) { hexBuffer.append(toHexFromByte(bytes.get())); } return hexBuffer.toString(); } static String toHexFromByte(final byte b); static byte t... |
@Test public void testBytesToHex() { byte[] bytes = { (byte)0x0a, (byte)0xff, (byte)0x12, (byte)0x38, (byte)0xde, (byte)0xad, (byte)0xbe, (byte)0xef, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xde, (byte)0xad, (byte)0xc0, (byte)0xde }; String hex = "0aff1238deadbeef00000000deadc0de"; Assert.assertTrue(Array... | public static byte[] toBytesFromHex(String hexStr) { if (hexStr == null || hexStr.length() == 0) { return new byte[] {}; } if (hexStr.length() % 2 != 0) { hexStr += '0'; } int byteIndex = 0; final byte[] bytes = new byte[hexStr.length() / 2]; for (int i = 0; i < hexStr.length(); i += 2) { char upper = hexStr.charAt(i);... | HexUtil { public static byte[] toBytesFromHex(String hexStr) { if (hexStr == null || hexStr.length() == 0) { return new byte[] {}; } if (hexStr.length() % 2 != 0) { hexStr += '0'; } int byteIndex = 0; final byte[] bytes = new byte[hexStr.length() / 2]; for (int i = 0; i < hexStr.length(); i += 2) { char upper = hexStr.... | HexUtil { public static byte[] toBytesFromHex(String hexStr) { if (hexStr == null || hexStr.length() == 0) { return new byte[] {}; } if (hexStr.length() % 2 != 0) { hexStr += '0'; } int byteIndex = 0; final byte[] bytes = new byte[hexStr.length() / 2]; for (int i = 0; i < hexStr.length(); i += 2) { char upper = hexStr.... | HexUtil { public static byte[] toBytesFromHex(String hexStr) { if (hexStr == null || hexStr.length() == 0) { return new byte[] {}; } if (hexStr.length() % 2 != 0) { hexStr += '0'; } int byteIndex = 0; final byte[] bytes = new byte[hexStr.length() / 2]; for (int i = 0; i < hexStr.length(); i += 2) { char upper = hexStr.... | HexUtil { public static byte[] toBytesFromHex(String hexStr) { if (hexStr == null || hexStr.length() == 0) { return new byte[] {}; } if (hexStr.length() % 2 != 0) { hexStr += '0'; } int byteIndex = 0; final byte[] bytes = new byte[hexStr.length() / 2]; for (int i = 0; i < hexStr.length(); i += 2) { char upper = hexStr.... |
@Test public void testDecode() { String testString = "asdlkfjajo3wjaf3o8ajlfija3lfijaslijfl83auj"; byte[] encodedBytes = testString.getBytes(StandardCharsets.UTF_8); ByteBuffer bb = ByteBuffer.wrap(encodedBytes); String decodedString = DecoderUtil.getUtf8FromByteBuffer(bb); Assert.assertEquals(testString, decodedString... | public static String getUtf8FromByteBuffer(final ByteBuffer bb) { bb.rewind(); byte[] bytes; if (bb.hasArray()) { bytes = bb.array(); } else { bytes = new byte[bb.remaining()]; bb.get(bytes); } return new String(bytes, StandardCharsets.UTF_8); } | DecoderUtil { public static String getUtf8FromByteBuffer(final ByteBuffer bb) { bb.rewind(); byte[] bytes; if (bb.hasArray()) { bytes = bb.array(); } else { bytes = new byte[bb.remaining()]; bb.get(bytes); } return new String(bytes, StandardCharsets.UTF_8); } } | DecoderUtil { public static String getUtf8FromByteBuffer(final ByteBuffer bb) { bb.rewind(); byte[] bytes; if (bb.hasArray()) { bytes = bb.array(); } else { bytes = new byte[bb.remaining()]; bb.get(bytes); } return new String(bytes, StandardCharsets.UTF_8); } } | DecoderUtil { public static String getUtf8FromByteBuffer(final ByteBuffer bb) { bb.rewind(); byte[] bytes; if (bb.hasArray()) { bytes = bb.array(); } else { bytes = new byte[bb.remaining()]; bb.get(bytes); } return new String(bytes, StandardCharsets.UTF_8); } static String getUtf8FromByteBuffer(final ByteBuffer bb); } | DecoderUtil { public static String getUtf8FromByteBuffer(final ByteBuffer bb) { bb.rewind(); byte[] bytes; if (bb.hasArray()) { bytes = bb.array(); } else { bytes = new byte[bb.remaining()]; bb.get(bytes); } return new String(bytes, StandardCharsets.UTF_8); } static String getUtf8FromByteBuffer(final ByteBuffer bb); ... |
@Test public void testEnrichment() { String sampleEvent = "{\"event_version\":\"1.0\"," + "\"position_x\":556," + "\"app_name\":\"SampleGame\"," + "\"client_id\":\"d57faa2b-9bfd-4502-a7b7-a43cb365f8f2\"," + "\"position_y\":521," + "\"event_id\":\"91650ce5-825a-4e90-ab22-174a4fb2da79\"," + "\"level_id\":\"test_level\","... | public Long getServerTimestamp() { return serverTimestamp; } | KinesisEvent { public Long getServerTimestamp() { return serverTimestamp; } } | KinesisEvent { public Long getServerTimestamp() { return serverTimestamp; } KinesisEvent(); } | KinesisEvent { public Long getServerTimestamp() { return serverTimestamp; } KinesisEvent(); void parseFromJson(final ObjectMapper jsonParser, final String rawJson); String getRawJson(); String getProcessedJson(); @Override String toString(); boolean isRequiredSanitization(); List<String> getSanitizedFields(); String ge... | KinesisEvent { public Long getServerTimestamp() { return serverTimestamp; } KinesisEvent(); void parseFromJson(final ObjectMapper jsonParser, final String rawJson); String getRawJson(); String getProcessedJson(); @Override String toString(); boolean isRequiredSanitization(); List<String> getSanitizedFields(); String ge... |
@Test public void testAdd() { QueueBuffer queueBuffer = new QueueBuffer(10, 0, messageReader); for (int i = 0; i < 10; i++) { Message message = new Message(i + 1, mockMetadata); queueBuffer.add(message); Assert.assertNotNull(message.getMetadata(), "Message data should not be cleared until the in-memory " + "limit is re... | public synchronized void add(Message message) { linkLast(message); postProcessDeliverableNode(); } | QueueBuffer { public synchronized void add(Message message) { linkLast(message); postProcessDeliverableNode(); } } | QueueBuffer { public synchronized void add(Message message) { linkLast(message); postProcessDeliverableNode(); } QueueBuffer(int inMemoryLimit, int indelibleMessageLimit, MessageReader messageReader); } | QueueBuffer { public synchronized void add(Message message) { linkLast(message); postProcessDeliverableNode(); } QueueBuffer(int inMemoryLimit, int indelibleMessageLimit, MessageReader messageReader); synchronized void add(Message message); synchronized void addAllBareMessages(Collection<Message> messages); synchronize... | QueueBuffer { public synchronized void add(Message message) { linkLast(message); postProcessDeliverableNode(); } QueueBuffer(int inMemoryLimit, int indelibleMessageLimit, MessageReader messageReader); synchronized void add(Message message); synchronized void addAllBareMessages(Collection<Message> messages); synchronize... |
@Test(priority = 1) public void testReadAllByGroups() throws AuthServerException { List<AuthResource> exchanges = authResourceDao.readAll(ResourceType.EXCHANGE.toString(), "bind", "customer", Collections.singletonList("developer")); List<AuthResource> queues = authResourceDao.readAll(ResourceType.QUEUE.toString(), "bin... | @Override public List<AuthResource> readAll(String resourceType, String ownerId) { Map<String, AuthResource> resourceMap = inMemoryResourceMap.row(resourceType); if (Objects.nonNull(resourceMap)) { Collection<AuthResource> authResources = resourceMap.values(); return authResources.stream() .filter(authResource -> authR... | AuthResourceInMemoryDao implements AuthResourceDao { @Override public List<AuthResource> readAll(String resourceType, String ownerId) { Map<String, AuthResource> resourceMap = inMemoryResourceMap.row(resourceType); if (Objects.nonNull(resourceMap)) { Collection<AuthResource> authResources = resourceMap.values(); return... | AuthResourceInMemoryDao implements AuthResourceDao { @Override public List<AuthResource> readAll(String resourceType, String ownerId) { Map<String, AuthResource> resourceMap = inMemoryResourceMap.row(resourceType); if (Objects.nonNull(resourceMap)) { Collection<AuthResource> authResources = resourceMap.values(); return... | AuthResourceInMemoryDao implements AuthResourceDao { @Override public List<AuthResource> readAll(String resourceType, String ownerId) { Map<String, AuthResource> resourceMap = inMemoryResourceMap.row(resourceType); if (Objects.nonNull(resourceMap)) { Collection<AuthResource> authResources = resourceMap.values(); return... | AuthResourceInMemoryDao implements AuthResourceDao { @Override public List<AuthResource> readAll(String resourceType, String ownerId) { Map<String, AuthResource> resourceMap = inMemoryResourceMap.row(resourceType); if (Objects.nonNull(resourceMap)) { Collection<AuthResource> authResources = resourceMap.values(); return... |
@Test(priority = 1) public void testIsExists() throws AuthServerException { boolean queue1 = authResourceDao.isExists(ResourceType.QUEUE.toString(), "queue1"); boolean queue11 = authResourceDao.isExists(ResourceType.QUEUE.toString(), "queue11"); Assert.assertEquals(queue1, true); Assert.assertEquals(queue11, false); } | @Override public boolean isExists(String resourceType, String resourceName) { return inMemoryResourceMap.contains(resourceType, resourceName); } | AuthResourceInMemoryDao implements AuthResourceDao { @Override public boolean isExists(String resourceType, String resourceName) { return inMemoryResourceMap.contains(resourceType, resourceName); } } | AuthResourceInMemoryDao implements AuthResourceDao { @Override public boolean isExists(String resourceType, String resourceName) { return inMemoryResourceMap.contains(resourceType, resourceName); } } | AuthResourceInMemoryDao implements AuthResourceDao { @Override public boolean isExists(String resourceType, String resourceName) { return inMemoryResourceMap.contains(resourceType, resourceName); } @Override void persist(AuthResource authResource); @Override void update(AuthResource authResource); @Override boolean de... | AuthResourceInMemoryDao implements AuthResourceDao { @Override public boolean isExists(String resourceType, String resourceName) { return inMemoryResourceMap.contains(resourceType, resourceName); } @Override void persist(AuthResource authResource); @Override void update(AuthResource authResource); @Override boolean de... |
@Test(priority = 2) public void testUpdate() throws AuthServerException { Map<String, Set<String>> actionsUserGroupsMap = new HashMap<>(); actionsUserGroupsMap.put("publish", new HashSet<>(Arrays.asList("architect", "customer", "manager"))); AuthResource exchange = new AuthResource(ResourceType.EXCHANGE.toString(), "ex... | @Override public void update(AuthResource authResource) { inMemoryResourceMap.put(authResource.getResourceType(), authResource.getResourceName(), authResource); } | AuthResourceInMemoryDao implements AuthResourceDao { @Override public void update(AuthResource authResource) { inMemoryResourceMap.put(authResource.getResourceType(), authResource.getResourceName(), authResource); } } | AuthResourceInMemoryDao implements AuthResourceDao { @Override public void update(AuthResource authResource) { inMemoryResourceMap.put(authResource.getResourceType(), authResource.getResourceName(), authResource); } } | AuthResourceInMemoryDao implements AuthResourceDao { @Override public void update(AuthResource authResource) { inMemoryResourceMap.put(authResource.getResourceType(), authResource.getResourceName(), authResource); } @Override void persist(AuthResource authResource); @Override void update(AuthResource authResource); @O... | AuthResourceInMemoryDao implements AuthResourceDao { @Override public void update(AuthResource authResource) { inMemoryResourceMap.put(authResource.getResourceType(), authResource.getResourceName(), authResource); } @Override void persist(AuthResource authResource); @Override void update(AuthResource authResource); @O... |
@Test(priority = 3) public void testDelete() throws AuthServerException { authResourceDao.delete(ResourceType.EXCHANGE.toString(), "exchange1"); authResourceDao.delete(ResourceType.EXCHANGE.toString(), "exchange1"); List<AuthResource> manager = authResourceDao.readAll(ResourceType.EXCHANGE.toString(), "manager"); List<... | @Override public boolean delete(String resourceType, String resource) { AuthResource removedItem = inMemoryResourceMap.remove(resourceType, resource); return removedItem != null; } | AuthResourceInMemoryDao implements AuthResourceDao { @Override public boolean delete(String resourceType, String resource) { AuthResource removedItem = inMemoryResourceMap.remove(resourceType, resource); return removedItem != null; } } | AuthResourceInMemoryDao implements AuthResourceDao { @Override public boolean delete(String resourceType, String resource) { AuthResource removedItem = inMemoryResourceMap.remove(resourceType, resource); return removedItem != null; } } | AuthResourceInMemoryDao implements AuthResourceDao { @Override public boolean delete(String resourceType, String resource) { AuthResource removedItem = inMemoryResourceMap.remove(resourceType, resource); return removedItem != null; } @Override void persist(AuthResource authResource); @Override void update(AuthResource... | AuthResourceInMemoryDao implements AuthResourceDao { @Override public boolean delete(String resourceType, String resource) { AuthResource removedItem = inMemoryResourceMap.remove(resourceType, resource); return removedItem != null; } @Override void persist(AuthResource authResource); @Override void update(AuthResource... |
@Test public void testRead() throws AuthServerException { AuthScope authScope = authScopeDao.read("exchanges:test"); Assert.assertEquals(authScope.getScopeName(), "exchanges:test"); Assert.assertEquals(authScope.getUserGroups().size(), 1); } | @Override public AuthScope read(String scopeName) throws AuthServerException { Set<String> userGroups = new HashSet<>(); String scopeId = null; Connection connection = null; PreparedStatement statement = null; ResultSet resultSet = null; try { connection = getConnection(); statement = connection.prepareStatement(RdbmsC... | AuthScopeRdbmsDao extends AuthScopeDao { @Override public AuthScope read(String scopeName) throws AuthServerException { Set<String> userGroups = new HashSet<>(); String scopeId = null; Connection connection = null; PreparedStatement statement = null; ResultSet resultSet = null; try { connection = getConnection(); state... | AuthScopeRdbmsDao extends AuthScopeDao { @Override public AuthScope read(String scopeName) throws AuthServerException { Set<String> userGroups = new HashSet<>(); String scopeId = null; Connection connection = null; PreparedStatement statement = null; ResultSet resultSet = null; try { connection = getConnection(); state... | AuthScopeRdbmsDao extends AuthScopeDao { @Override public AuthScope read(String scopeName) throws AuthServerException { Set<String> userGroups = new HashSet<>(); String scopeId = null; Connection connection = null; PreparedStatement statement = null; ResultSet resultSet = null; try { connection = getConnection(); state... | AuthScopeRdbmsDao extends AuthScopeDao { @Override public AuthScope read(String scopeName) throws AuthServerException { Set<String> userGroups = new HashSet<>(); String scopeId = null; Connection connection = null; PreparedStatement statement = null; ResultSet resultSet = null; try { connection = getConnection(); state... |
@Test public void testReadAll() throws AuthServerException { List<AuthScope> authScopes = authScopeDao.readAll(); Assert.assertEquals(authScopes.size(), 19); } | @Override public List<AuthScope> readAll() throws AuthServerException { Map<String, AuthScope> authScopes = new HashMap<>(); Connection connection = null; PreparedStatement statement = null; ResultSet resultSet = null; try { connection = getConnection(); statement = connection.prepareStatement(RdbmsConstants.PS_SELECT_... | AuthScopeRdbmsDao extends AuthScopeDao { @Override public List<AuthScope> readAll() throws AuthServerException { Map<String, AuthScope> authScopes = new HashMap<>(); Connection connection = null; PreparedStatement statement = null; ResultSet resultSet = null; try { connection = getConnection(); statement = connection.p... | AuthScopeRdbmsDao extends AuthScopeDao { @Override public List<AuthScope> readAll() throws AuthServerException { Map<String, AuthScope> authScopes = new HashMap<>(); Connection connection = null; PreparedStatement statement = null; ResultSet resultSet = null; try { connection = getConnection(); statement = connection.p... | AuthScopeRdbmsDao extends AuthScopeDao { @Override public List<AuthScope> readAll() throws AuthServerException { Map<String, AuthScope> authScopes = new HashMap<>(); Connection connection = null; PreparedStatement statement = null; ResultSet resultSet = null; try { connection = getConnection(); statement = connection.p... | AuthScopeRdbmsDao extends AuthScopeDao { @Override public List<AuthScope> readAll() throws AuthServerException { Map<String, AuthScope> authScopes = new HashMap<>(); Connection connection = null; PreparedStatement statement = null; ResultSet resultSet = null; try { connection = getConnection(); statement = connection.p... |
@Test public void testUpdate() throws AuthServerException { AuthScope authScope = authScopeDao.read("queues:test"); Assert.assertEquals(authScope.getScopeName(), "queues:test"); Assert.assertEquals(authScope.getUserGroups().size(), 1); authScopeDao.update("queues:test", Arrays.asList("developer", "manager")); authScope... | @Override public void update(String scopeName, List<String> userGroups) throws AuthServerException { Connection connection = null; try { connection = getConnection(); deleteGroups(scopeName, connection); persistGroups(scopeName, userGroups, connection); connection.commit(); } catch (SQLException e) { throw new AuthServ... | AuthScopeRdbmsDao extends AuthScopeDao { @Override public void update(String scopeName, List<String> userGroups) throws AuthServerException { Connection connection = null; try { connection = getConnection(); deleteGroups(scopeName, connection); persistGroups(scopeName, userGroups, connection); connection.commit(); } ca... | AuthScopeRdbmsDao extends AuthScopeDao { @Override public void update(String scopeName, List<String> userGroups) throws AuthServerException { Connection connection = null; try { connection = getConnection(); deleteGroups(scopeName, connection); persistGroups(scopeName, userGroups, connection); connection.commit(); } ca... | AuthScopeRdbmsDao extends AuthScopeDao { @Override public void update(String scopeName, List<String> userGroups) throws AuthServerException { Connection connection = null; try { connection = getConnection(); deleteGroups(scopeName, connection); persistGroups(scopeName, userGroups, connection); connection.commit(); } ca... | AuthScopeRdbmsDao extends AuthScopeDao { @Override public void update(String scopeName, List<String> userGroups) throws AuthServerException { Connection connection = null; try { connection = getConnection(); deleteGroups(scopeName, connection); persistGroups(scopeName, userGroups, connection); connection.commit(); } ca... |
@Test public void testCloseConnection() throws Exception { int channelCount = 5; for (int i = 1; i <= channelCount; i++) { connectionHandler.createChannel(i); } try { connectionHandler.closeConnection("something", false, false); Assert.fail("Expected ValidationException not thrown"); } catch (ValidationException e) { A... | public int closeConnection(String reason, boolean force, boolean used) throws ValidationException { int numberOfChannels = channels.size(); if (!used && numberOfChannels > 0) { throw new ValidationException("Cannot close connection. " + numberOfChannels + " active channels exist " + "and used parameter is not set."); }... | AmqpConnectionHandler extends ChannelInboundHandlerAdapter { public int closeConnection(String reason, boolean force, boolean used) throws ValidationException { int numberOfChannels = channels.size(); if (!used && numberOfChannels > 0) { throw new ValidationException("Cannot close connection. " + numberOfChannels + " a... | AmqpConnectionHandler extends ChannelInboundHandlerAdapter { public int closeConnection(String reason, boolean force, boolean used) throws ValidationException { int numberOfChannels = channels.size(); if (!used && numberOfChannels > 0) { throw new ValidationException("Cannot close connection. " + numberOfChannels + " a... | AmqpConnectionHandler extends ChannelInboundHandlerAdapter { public int closeConnection(String reason, boolean force, boolean used) throws ValidationException { int numberOfChannels = channels.size(); if (!used && numberOfChannels > 0) { throw new ValidationException("Cannot close connection. " + numberOfChannels + " a... | AmqpConnectionHandler extends ChannelInboundHandlerAdapter { public int closeConnection(String reason, boolean force, boolean used) throws ValidationException { int numberOfChannels = channels.size(); if (!used && numberOfChannels > 0) { throw new ValidationException("Cannot close connection. " + numberOfChannels + " a... |
@Test public void testCloseChannel() throws Exception { int channelId = 1; int consumerCount = 5; connectionHandler.createChannel(channelId); Mockito.when(amqpChannel.getConsumerCount()).thenReturn(consumerCount); try { connectionHandler.closeChannel(channelId, false, "something"); Assert.fail("Expected ValidationExcep... | public void closeChannel(int channelId) { AmqpChannel channel = channels.remove(channelId); if (Objects.nonNull(channel)) { closeChannel(channel); } } | AmqpConnectionHandler extends ChannelInboundHandlerAdapter { public void closeChannel(int channelId) { AmqpChannel channel = channels.remove(channelId); if (Objects.nonNull(channel)) { closeChannel(channel); } } } | AmqpConnectionHandler extends ChannelInboundHandlerAdapter { public void closeChannel(int channelId) { AmqpChannel channel = channels.remove(channelId); if (Objects.nonNull(channel)) { closeChannel(channel); } } AmqpConnectionHandler(AmqpMetricManager metricManager, AmqpChannelFactory amqpChannelFactory,
... | AmqpConnectionHandler extends ChannelInboundHandlerAdapter { public void closeChannel(int channelId) { AmqpChannel channel = channels.remove(channelId); if (Objects.nonNull(channel)) { closeChannel(channel); } } AmqpConnectionHandler(AmqpMetricManager metricManager, AmqpChannelFactory amqpChannelFactory,
... | AmqpConnectionHandler extends ChannelInboundHandlerAdapter { public void closeChannel(int channelId) { AmqpChannel channel = channels.remove(channelId); if (Objects.nonNull(channel)) { closeChannel(channel); } } AmqpConnectionHandler(AmqpMetricManager metricManager, AmqpChannelFactory amqpChannelFactory,
... |
@Test (dataProvider = "QueueDeleteParams") public void testWriteMethod(String name, boolean ifUnused, boolean ifEmpty, boolean noWait) throws Exception { ShortString queueName = ShortString.parseString(name); QueueDelete frame = new QueueDelete(1, queueName, ifUnused, ifEmpty, noWait); long expectedSize = 2L + queueNam... | @Override protected void writeMethod(ByteBuf buf) { buf.writeShort(0); queue.write(buf); int flags = 0x00; if (ifUnused) { flags |= 0x1; } if (ifEmpty) { flags |= 0x2; } if (noWait) { flags |= 0x4; } buf.writeByte(flags); } | QueueDelete extends MethodFrame { @Override protected void writeMethod(ByteBuf buf) { buf.writeShort(0); queue.write(buf); int flags = 0x00; if (ifUnused) { flags |= 0x1; } if (ifEmpty) { flags |= 0x2; } if (noWait) { flags |= 0x4; } buf.writeByte(flags); } } | QueueDelete extends MethodFrame { @Override protected void writeMethod(ByteBuf buf) { buf.writeShort(0); queue.write(buf); int flags = 0x00; if (ifUnused) { flags |= 0x1; } if (ifEmpty) { flags |= 0x2; } if (noWait) { flags |= 0x4; } buf.writeByte(flags); } QueueDelete(int channel, ShortString queue, boolean ifUnused, ... | QueueDelete extends MethodFrame { @Override protected void writeMethod(ByteBuf buf) { buf.writeShort(0); queue.write(buf); int flags = 0x00; if (ifUnused) { flags |= 0x1; } if (ifEmpty) { flags |= 0x2; } if (noWait) { flags |= 0x4; } buf.writeByte(flags); } QueueDelete(int channel, ShortString queue, boolean ifUnused, ... | QueueDelete extends MethodFrame { @Override protected void writeMethod(ByteBuf buf) { buf.writeShort(0); queue.write(buf); int flags = 0x00; if (ifUnused) { flags |= 0x1; } if (ifEmpty) { flags |= 0x2; } if (noWait) { flags |= 0x4; } buf.writeByte(flags); } QueueDelete(int channel, ShortString queue, boolean ifUnused, ... |
@Test(dataProvider = "testDbOperationData") public void testInsertsCancelOut(TestOperationRequest[] testOperationsArray) { for (int i = 0; i < testOperationsArray.length; i++) { operationsList.add(DbOperation.getFactory().newInstance()); TestOperationRequest request = testOperationsArray[i]; if (request.beforeType == I... | @Override public void onEvent(DbOperation event, long sequence, boolean endOfBatch) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("{} event with message id {} for sequence {}", event.getType(), event.getMessage(), sequence); } eventQueue.add(event.getMessageId()); switch (event.getType()) { case INSERT_MESSAGE: insertM... | DbEventMatcher implements EventHandler<DbOperation> { @Override public void onEvent(DbOperation event, long sequence, boolean endOfBatch) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("{} event with message id {} for sequence {}", event.getType(), event.getMessage(), sequence); } eventQueue.add(event.getMessageId()); s... | DbEventMatcher implements EventHandler<DbOperation> { @Override public void onEvent(DbOperation event, long sequence, boolean endOfBatch) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("{} event with message id {} for sequence {}", event.getType(), event.getMessage(), sequence); } eventQueue.add(event.getMessageId()); s... | DbEventMatcher implements EventHandler<DbOperation> { @Override public void onEvent(DbOperation event, long sequence, boolean endOfBatch) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("{} event with message id {} for sequence {}", event.getType(), event.getMessage(), sequence); } eventQueue.add(event.getMessageId()); s... | DbEventMatcher implements EventHandler<DbOperation> { @Override public void onEvent(DbOperation event, long sequence, boolean endOfBatch) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("{} event with message id {} for sequence {}", event.getType(), event.getMessage(), sequence); } eventQueue.add(event.getMessageId()); s... |
@Test(expectedExceptions = AmqFrameDecodingException.class) public void testInvalidMethodValue() throws Exception { AmqMethodBodyFactory factory = new AmqMethodRegistry(authenticationStrategy).getFactory((short) 12, (short) 12); } | public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP version 0-91" + " (... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... |
@Test(expectedExceptions = AmqFrameDecodingException.class) public void testLargeMethodValue() throws Exception { AmqMethodBodyFactory factory = new AmqMethodRegistry(authenticationStrategy).getFactory((short) 10, (short) 2000); } | public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP version 0-91" + " (... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... |
@Test(expectedExceptions = AmqFrameDecodingException.class) public void testLargeClassValue() throws Exception { AmqMethodBodyFactory factory = new AmqMethodRegistry(authenticationStrategy).getFactory((short) 2000, (short) 10); } | public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP version 0-91" + " (... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... |
@Test(expectedExceptions = AmqFrameDecodingException.class) public void testInvalidMethodValueInValidClass() throws Exception { AmqMethodBodyFactory factory = new AmqMethodRegistry(authenticationStrategy).getFactory((short) 60, (short) 5); } | public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP version 0-91" + " (... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... | AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " unknown in AMQP... |
@Test public void testGetTransactionType() throws Exception { Assert.assertEquals(amqpChannel.getTransactionType(), "AutoCommit"); amqpChannel.setLocalTransactional(); Assert.assertEquals(amqpChannel.getTransactionType(), "LocalTransaction"); amqpChannel.setDistributedTransactional(); Assert.assertEquals(amqpChannel.ge... | @Override public String getTransactionType() { String transactionType = "unidentified"; if (transaction instanceof AutoCommitTransaction) { transactionType = "AutoCommit"; } else if (transaction instanceof LocalTransaction) { transactionType = "LocalTransaction"; } else if (transaction instanceof DistributedTransaction... | AmqpChannel implements AmqpChannelView { @Override public String getTransactionType() { String transactionType = "unidentified"; if (transaction instanceof AutoCommitTransaction) { transactionType = "AutoCommit"; } else if (transaction instanceof LocalTransaction) { transactionType = "LocalTransaction"; } else if (tran... | AmqpChannel implements AmqpChannelView { @Override public String getTransactionType() { String transactionType = "unidentified"; if (transaction instanceof AutoCommitTransaction) { transactionType = "AutoCommit"; } else if (transaction instanceof LocalTransaction) { transactionType = "LocalTransaction"; } else if (tran... | AmqpChannel implements AmqpChannelView { @Override public String getTransactionType() { String transactionType = "unidentified"; if (transaction instanceof AutoCommitTransaction) { transactionType = "AutoCommit"; } else if (transaction instanceof LocalTransaction) { transactionType = "LocalTransaction"; } else if (tran... | AmqpChannel implements AmqpChannelView { @Override public String getTransactionType() { String transactionType = "unidentified"; if (transaction instanceof AutoCommitTransaction) { transactionType = "AutoCommit"; } else if (transaction instanceof LocalTransaction) { transactionType = "LocalTransaction"; } else if (tran... |
@Test public void testFlowNotDisabledWhenHighLevelNotExceeded() throws Exception { IntStream.rangeClosed(1, 10) .forEach(i -> channelFlowManager.notifyMessageAddition(ctx)); Mockito.verify(ctx, Mockito.never()).writeAndFlush(argumentCaptor.capture()); } | public void notifyMessageAddition(ChannelHandlerContext ctx) { messagesInFlight++; if (messagesInFlight > highLimit && inflowEnabled) { inflowEnabled = false; ctx.writeAndFlush(new ChannelFlow(channel.getChannelId(), false)); ctx.channel().config().setAutoRead(false); LOGGER.info("Inflow disabled for channel {}-{}", ch... | ChannelFlowManager { public void notifyMessageAddition(ChannelHandlerContext ctx) { messagesInFlight++; if (messagesInFlight > highLimit && inflowEnabled) { inflowEnabled = false; ctx.writeAndFlush(new ChannelFlow(channel.getChannelId(), false)); ctx.channel().config().setAutoRead(false); LOGGER.info("Inflow disabled f... | ChannelFlowManager { public void notifyMessageAddition(ChannelHandlerContext ctx) { messagesInFlight++; if (messagesInFlight > highLimit && inflowEnabled) { inflowEnabled = false; ctx.writeAndFlush(new ChannelFlow(channel.getChannelId(), false)); ctx.channel().config().setAutoRead(false); LOGGER.info("Inflow disabled f... | ChannelFlowManager { public void notifyMessageAddition(ChannelHandlerContext ctx) { messagesInFlight++; if (messagesInFlight > highLimit && inflowEnabled) { inflowEnabled = false; ctx.writeAndFlush(new ChannelFlow(channel.getChannelId(), false)); ctx.channel().config().setAutoRead(false); LOGGER.info("Inflow disabled f... | ChannelFlowManager { public void notifyMessageAddition(ChannelHandlerContext ctx) { messagesInFlight++; if (messagesInFlight > highLimit && inflowEnabled) { inflowEnabled = false; ctx.writeAndFlush(new ChannelFlow(channel.getChannelId(), false)); ctx.channel().config().setAutoRead(false); LOGGER.info("Inflow disabled f... |
@Test public void testFlowDisabledWhenHighLevelExceeded() throws Exception { IntStream.rangeClosed(1, 11) .forEach(i -> channelFlowManager.notifyMessageAddition(ctx)); Mockito.verify(ctx, Mockito.times(1)).writeAndFlush(argumentCaptor.capture()); } | public void notifyMessageAddition(ChannelHandlerContext ctx) { messagesInFlight++; if (messagesInFlight > highLimit && inflowEnabled) { inflowEnabled = false; ctx.writeAndFlush(new ChannelFlow(channel.getChannelId(), false)); ctx.channel().config().setAutoRead(false); LOGGER.info("Inflow disabled for channel {}-{}", ch... | ChannelFlowManager { public void notifyMessageAddition(ChannelHandlerContext ctx) { messagesInFlight++; if (messagesInFlight > highLimit && inflowEnabled) { inflowEnabled = false; ctx.writeAndFlush(new ChannelFlow(channel.getChannelId(), false)); ctx.channel().config().setAutoRead(false); LOGGER.info("Inflow disabled f... | ChannelFlowManager { public void notifyMessageAddition(ChannelHandlerContext ctx) { messagesInFlight++; if (messagesInFlight > highLimit && inflowEnabled) { inflowEnabled = false; ctx.writeAndFlush(new ChannelFlow(channel.getChannelId(), false)); ctx.channel().config().setAutoRead(false); LOGGER.info("Inflow disabled f... | ChannelFlowManager { public void notifyMessageAddition(ChannelHandlerContext ctx) { messagesInFlight++; if (messagesInFlight > highLimit && inflowEnabled) { inflowEnabled = false; ctx.writeAndFlush(new ChannelFlow(channel.getChannelId(), false)); ctx.channel().config().setAutoRead(false); LOGGER.info("Inflow disabled f... | ChannelFlowManager { public void notifyMessageAddition(ChannelHandlerContext ctx) { messagesInFlight++; if (messagesInFlight > highLimit && inflowEnabled) { inflowEnabled = false; ctx.writeAndFlush(new ChannelFlow(channel.getChannelId(), false)); ctx.channel().config().setAutoRead(false); LOGGER.info("Inflow disabled f... |
@Test public void testGetTransportProperties() throws Exception { AmqpChannel amqpChannel = Mockito.mock(AmqpChannel.class); ChannelHandlerContext context = Mockito.mock(ChannelHandlerContext.class); Broker broker = Mockito.mock(Broker.class); Mockito.when(amqpChannel.getChannelId()).thenReturn(5); Mockito.when(amqpCha... | public Properties getTransportProperties() { return transportProperties; } | AmqpConsumer extends Consumer { public Properties getTransportProperties() { return transportProperties; } } | AmqpConsumer extends Consumer { public Properties getTransportProperties() { return transportProperties; } AmqpConsumer(ChannelHandlerContext ctx,
Broker broker,
AmqpChannel channel,
String queueName,
ShortString consumerTag... | AmqpConsumer extends Consumer { public Properties getTransportProperties() { return transportProperties; } AmqpConsumer(ChannelHandlerContext ctx,
Broker broker,
AmqpChannel channel,
String queueName,
ShortString consumerTag... | AmqpConsumer extends Consumer { public Properties getTransportProperties() { return transportProperties; } AmqpConsumer(ChannelHandlerContext ctx,
Broker broker,
AmqpChannel channel,
String queueName,
ShortString consumerTag... |
@Test public void testConvertLarge() { ChunkConverter converter = new ChunkConverter(10); int chunkLength = 12; String stringData = RandomStringGenerator.randomString(chunkLength); List<ContentChunk> beforeList = createContentChunks(stringData, 1); List<ContentChunk> afterList = converter.convert(beforeList, chunkLengt... | public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader = new ContentRead... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... |
@Test public void testConvertLargeMultiple() { ChunkConverter converter = new ChunkConverter(10); int chunkLength = 30; String stringData = RandomStringGenerator.randomString(chunkLength); List<ContentChunk> beforeList = createContentChunks(stringData, 2); List<ContentChunk> afterList = converter.convert(beforeList, ch... | public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader = new ContentRead... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... |
@Test public void testConvertSmall() { ChunkConverter converter = new ChunkConverter(10); int chunkLength = 8; List<ContentChunk> beforeList = createContentChunk(chunkLength); List<ContentChunk> afterList = converter.convert(beforeList, chunkLength); Assert.assertEquals(afterList, beforeList, "Smaller chunks should not... | public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader = new ContentRead... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... |
@Test public void testConvertEmpty() { ChunkConverter converter = new ChunkConverter(10); int chunkLength = 8; List<ContentChunk> beforeList = new ArrayList<>(); List<ContentChunk> afterList = converter.convert(beforeList, chunkLength); Assert.assertEquals(afterList, beforeList, "Empty chunk list should not be converte... | public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader = new ContentRead... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... | ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader contentReader ... |
@Test(dataProvider = "InvalidBindingData", expectedExceptions = ValidationException.class) public void testMultipleBindCallsWithDifferentSelectors(String queueName, String selectorOne, String selectorTwo) throws Exception { QueueHandler queueHandler = new QueueHandler(new MemQueueImpl(queueName, 2, false), null); regis... | void bind(QueueHandler queueHandler, String bindingKey, FieldTable arguments) throws BrokerException, ValidationException { BindingSet bindingSet = bindingPatternToBindingsMap.computeIfAbsent(bindingKey, k -> new BindingSet()); Queue queue = queueHandler.getUnmodifiableQueue(); Binding binding = new Binding(queue, bind... | BindingsRegistry { void bind(QueueHandler queueHandler, String bindingKey, FieldTable arguments) throws BrokerException, ValidationException { BindingSet bindingSet = bindingPatternToBindingsMap.computeIfAbsent(bindingKey, k -> new BindingSet()); Queue queue = queueHandler.getUnmodifiableQueue(); Binding binding = new ... | BindingsRegistry { void bind(QueueHandler queueHandler, String bindingKey, FieldTable arguments) throws BrokerException, ValidationException { BindingSet bindingSet = bindingPatternToBindingsMap.computeIfAbsent(bindingKey, k -> new BindingSet()); Queue queue = queueHandler.getUnmodifiableQueue(); Binding binding = new ... | BindingsRegistry { void bind(QueueHandler queueHandler, String bindingKey, FieldTable arguments) throws BrokerException, ValidationException { BindingSet bindingSet = bindingPatternToBindingsMap.computeIfAbsent(bindingKey, k -> new BindingSet()); Queue queue = queueHandler.getUnmodifiableQueue(); Binding binding = new ... | BindingsRegistry { void bind(QueueHandler queueHandler, String bindingKey, FieldTable arguments) throws BrokerException, ValidationException { BindingSet bindingSet = bindingPatternToBindingsMap.computeIfAbsent(bindingKey, k -> new BindingSet()); Queue queue = queueHandler.getUnmodifiableQueue(); Binding binding = new ... |
@Test(dataProvider = "positiveTopicPairs", description = "Test positive topic matching") public void testPositiveSingleTopicMatching(String subscribedPattern, String publishedTopic) throws BrokerException, ValidationException { DbBackedQueueHandlerFactory factory = new DbBackedQueueHandlerFactory(null, new NullBrokerMe... | @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBindings(routingKey, subscribedPattern -> { BindingSet bindingSet = getBindingsRegistry... | TopicExchange extends Exchange implements BindingsRegistryListener { @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBindings(routingKe... | TopicExchange extends Exchange implements BindingsRegistryListener { @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBindings(routingKe... | TopicExchange extends Exchange implements BindingsRegistryListener { @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBindings(routingKe... | TopicExchange extends Exchange implements BindingsRegistryListener { @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBindings(routingKe... |
@Test(dataProvider = "negativeTopicPairs", description = "Test negative topic matching") public void testNegativeSingleTopicMatching(String subscribedPattern, String publishedTopic) throws BrokerException, ValidationException { DbBackedQueueHandlerFactory factory = new DbBackedQueueHandlerFactory(null, new NullBrokerMe... | @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBindings(routingKey, subscribedPattern -> { BindingSet bindingSet = getBindingsRegistry... | TopicExchange extends Exchange implements BindingsRegistryListener { @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBindings(routingKe... | TopicExchange extends Exchange implements BindingsRegistryListener { @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBindings(routingKe... | TopicExchange extends Exchange implements BindingsRegistryListener { @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBindings(routingKe... | TopicExchange extends Exchange implements BindingsRegistryListener { @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBindings(routingKe... |
@Test(dataProvider = "positiveTopicPairs", description = "Test topic removal") public void testTopicRemoval(String subscribedPattern, String publishedTopic) throws BrokerException, ValidationException { DbBackedQueueHandlerFactory factory = new DbBackedQueueHandlerFactory(null, new NullBrokerMetricManager(), new Broker... | @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBindings(routingKey, subscribedPattern -> { BindingSet bindingSet = getBindingsRegistry... | TopicExchange extends Exchange implements BindingsRegistryListener { @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBindings(routingKe... | TopicExchange extends Exchange implements BindingsRegistryListener { @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBindings(routingKe... | TopicExchange extends Exchange implements BindingsRegistryListener { @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBindings(routingKe... | TopicExchange extends Exchange implements BindingsRegistryListener { @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBindings(routingKe... |
@Test(expectedExceptions = {CipherToolRuntimeException.class}) public void testExecuteTestEncryptSecretsWithOddParameters() { String[] toolArgs = new String[]{"-customLibPath", "/tmp", "xyz"}; CipherToolInitializer.execute(toolArgs); } | public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader urlClassLoader = Utils.getC... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... |
@Test public void testSize() { QueueBuffer queueBuffer = new QueueBuffer(10, 0, messageReader); for (int i = 0; i < 12; i++) { Message message = new Message(i + 1, mockMetadata); queueBuffer.add(message); } Assert.assertEquals(queueBuffer.size(), 12, "Message size should match the number of added items"); } | public int size() { return size.get(); } | QueueBuffer { public int size() { return size.get(); } } | QueueBuffer { public int size() { return size.get(); } QueueBuffer(int inMemoryLimit, int indelibleMessageLimit, MessageReader messageReader); } | QueueBuffer { public int size() { return size.get(); } QueueBuffer(int inMemoryLimit, int indelibleMessageLimit, MessageReader messageReader); synchronized void add(Message message); synchronized void addAllBareMessages(Collection<Message> messages); synchronized void addBareMessage(Message message); synchronized boole... | QueueBuffer { public int size() { return size.get(); } QueueBuffer(int inMemoryLimit, int indelibleMessageLimit, MessageReader messageReader); synchronized void add(Message message); synchronized void addAllBareMessages(Collection<Message> messages); synchronized void addBareMessage(Message message); synchronized boole... |
@Test(expectedExceptions = {CipherToolRuntimeException.class}) public void testExecuteTestEncryptSecretsWithWrongCommand() { String[] toolArgs = new String[]{"-ENCRYPTTEXT", "Ballerina@WSO2"}; CipherToolInitializer.execute(toolArgs); } | public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader urlClassLoader = Utils.getC... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... |
@Test public void testExecuteTestEncryptText() { String[] toolArgs = new String[]{"-encryptText", "Ballerina@WSO2", "-configPath", secureVaultYAMLPath.toString()}; CipherToolInitializer.execute(toolArgs); } | public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader urlClassLoader = Utils.getC... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... |
@Test public void testExecuteTestDecryptText() { String[] toolArgs = new String[]{"-decryptText", "lDaF2UWOEK7NNS3Sbu1jk4OJtGjTD88LWHTUNBiAAEnW/mWGyOZ4wu8xL4B5oVZH1n7oFTac6YBl8Q96VJMfZo0PJ8fAm0ALIEhd" + "qXMOe6e2sUISnrPOf4xqdrRN+N1arEgzmNOZ+51OjznyIL3hiCJ9boYeJX1DufIDpqL0Q/M0g5Tglu4w15bhzCgwzI" + "yL7u3qs5eDwsL+GfV5kRt... | public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader urlClassLoader = Utils.getC... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... | CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLClassLoader url... |
@Test public void testGetConfigurationObject() throws Exception { CarbonConfigAdapter carbonConfigAdapter = new CarbonConfigAdapter(configProvider); TestConfig configurationObject = (TestConfig) carbonConfigAdapter.getConfigurationObject(TEST_CONFIG_NAMESPACE); Assert.assertEquals(configurationObject.getTestField(), NA... | @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } } | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } CarbonConfigAdapter(BrokerConfigProvider configProvider); } | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } CarbonConfigAdapter(BrokerConfigProvider configProvider); @Override T getConfigurationObject(Class<T> aClass); @Override O... | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } CarbonConfigAdapter(BrokerConfigProvider configProvider); @Override T getConfigurationObject(Class<T> aClass); @Override O... |
@Test public void testGetConfigurationObject1() throws Exception { CarbonConfigAdapter carbonConfigAdapter = new CarbonConfigAdapter(configProvider); TestConfig configurationObject = carbonConfigAdapter.getConfigurationObject(TestConfig.class); Assert.assertEquals(configurationObject.getTestField(), CLASS_KEY); } | @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } } | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } CarbonConfigAdapter(BrokerConfigProvider configProvider); } | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } CarbonConfigAdapter(BrokerConfigProvider configProvider); @Override T getConfigurationObject(Class<T> aClass); @Override O... | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } CarbonConfigAdapter(BrokerConfigProvider configProvider); @Override T getConfigurationObject(Class<T> aClass); @Override O... |
@Test public void testGetConfigurationObject2() throws Exception { CarbonConfigAdapter carbonConfigAdapter = new CarbonConfigAdapter(configProvider); TestConfig configurationObject = carbonConfigAdapter.getConfigurationObject(TEST_CONFIG_NAMESPACE, TestConfig.class); Assert.assertEquals(configurationObject.getTestField... | @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } } | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } CarbonConfigAdapter(BrokerConfigProvider configProvider); } | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } CarbonConfigAdapter(BrokerConfigProvider configProvider); @Override T getConfigurationObject(Class<T> aClass); @Override O... | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } CarbonConfigAdapter(BrokerConfigProvider configProvider); @Override T getConfigurationObject(Class<T> aClass); @Override O... |
@Test(expectedExceptions = ConfigurationException.class) public void testGetInvalidConfigurationObject() throws Exception { CarbonConfigAdapter carbonConfigAdapter = new CarbonConfigAdapter(configProvider); TestConfig configurationObject = carbonConfigAdapter.getConfigurationObject("invalid.namespace", TestConfig.class... | @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } } | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } CarbonConfigAdapter(BrokerConfigProvider configProvider); } | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } CarbonConfigAdapter(BrokerConfigProvider configProvider); @Override T getConfigurationObject(Class<T> aClass); @Override O... | CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } CarbonConfigAdapter(BrokerConfigProvider configProvider); @Override T getConfigurationObject(Class<T> aClass); @Override O... |
@Test public void testGetSize() throws Exception { Assert.assertEquals(DEFAULT_TEST_OBJECT.getSize(), DEFAULT_DATA_STRING.length() + 4, "getSize should return " + "required byte array size"); } | @Override public long getSize() { return 4 + length; } | LongString implements EncodableData { @Override public long getSize() { return 4 + length; } } | LongString implements EncodableData { @Override public long getSize() { return 4 + length; } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); } | LongString implements EncodableData { @Override public long getSize() { return 4 + length; } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); static LongString parseString(String data); @Override long getSize(); @Override void write(ByteBuf buf); static LongString parse(ByteBuf buf); stat... | LongString implements EncodableData { @Override public long getSize() { return 4 + length; } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); static LongString parseString(String data); @Override long getSize(); @Override void write(ByteBuf buf); static LongString parse(ByteBuf buf); stat... |
@Test public void testParse() throws Exception { ByteBuf buf = Unpooled.buffer(DEFAULT_DATA_STRING.length() + 4); DEFAULT_TEST_OBJECT.write(buf); LongString parsedObject = LongString.parse(buf); Assert.assertEquals(parsedObject, DEFAULT_TEST_OBJECT, "Encoding and decoding should match to same object"); } | public static LongString parse(ByteBuf buf) throws Exception { int size = (int) buf.readUnsignedInt(); if (size < 0) { throw new Exception("Invalid string length"); } byte[] data = new byte[size]; buf.readBytes(data); return new LongString(size, data); } | LongString implements EncodableData { public static LongString parse(ByteBuf buf) throws Exception { int size = (int) buf.readUnsignedInt(); if (size < 0) { throw new Exception("Invalid string length"); } byte[] data = new byte[size]; buf.readBytes(data); return new LongString(size, data); } } | LongString implements EncodableData { public static LongString parse(ByteBuf buf) throws Exception { int size = (int) buf.readUnsignedInt(); if (size < 0) { throw new Exception("Invalid string length"); } byte[] data = new byte[size]; buf.readBytes(data); return new LongString(size, data); } @SuppressFBWarnings("EI_EXP... | LongString implements EncodableData { public static LongString parse(ByteBuf buf) throws Exception { int size = (int) buf.readUnsignedInt(); if (size < 0) { throw new Exception("Invalid string length"); } byte[] data = new byte[size]; buf.readBytes(data); return new LongString(size, data); } @SuppressFBWarnings("EI_EXP... | LongString implements EncodableData { public static LongString parse(ByteBuf buf) throws Exception { int size = (int) buf.readUnsignedInt(); if (size < 0) { throw new Exception("Invalid string length"); } byte[] data = new byte[size]; buf.readBytes(data); return new LongString(size, data); } @SuppressFBWarnings("EI_EXP... |
@Test public void testToString() throws Exception { Assert.assertEquals(DEFAULT_TEST_OBJECT.toString(), DEFAULT_DATA_STRING, "toString() should match the data " + "string used to create it"); } | @Override public String toString() { return new String(content, StandardCharsets.UTF_8); } | LongString implements EncodableData { @Override public String toString() { return new String(content, StandardCharsets.UTF_8); } } | LongString implements EncodableData { @Override public String toString() { return new String(content, StandardCharsets.UTF_8); } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); } | LongString implements EncodableData { @Override public String toString() { return new String(content, StandardCharsets.UTF_8); } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); static LongString parseString(String data); @Override long getSize(); @Override void write(ByteBuf buf); static... | LongString implements EncodableData { @Override public String toString() { return new String(content, StandardCharsets.UTF_8); } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); static LongString parseString(String data); @Override long getSize(); @Override void write(ByteBuf buf); static... |
@Test public void testGetFirstDeliverable() { QueueBuffer queueBuffer = new QueueBuffer(10, 0, messageReader); for (int i = 0; i < 12; i++) { Message message = new Message(i + 1, mockMetadata); queueBuffer.add(message); } for (int i = 0; i < 12; i++) { Message message = queueBuffer.getFirstDeliverable(); Assert.assertN... | public synchronized Message getFirstDeliverable() { submitMessageReads(); Node deliverableCandidate = firstDeliverableCandidate; if (deliverableCandidate != firstUndeliverable) { if (!deliverableCandidate.hasContent()) { return null; } firstDeliverableCandidate = deliverableCandidate.next; recordRemovingMessageForDeliv... | QueueBuffer { public synchronized Message getFirstDeliverable() { submitMessageReads(); Node deliverableCandidate = firstDeliverableCandidate; if (deliverableCandidate != firstUndeliverable) { if (!deliverableCandidate.hasContent()) { return null; } firstDeliverableCandidate = deliverableCandidate.next; recordRemovingM... | QueueBuffer { public synchronized Message getFirstDeliverable() { submitMessageReads(); Node deliverableCandidate = firstDeliverableCandidate; if (deliverableCandidate != firstUndeliverable) { if (!deliverableCandidate.hasContent()) { return null; } firstDeliverableCandidate = deliverableCandidate.next; recordRemovingM... | QueueBuffer { public synchronized Message getFirstDeliverable() { submitMessageReads(); Node deliverableCandidate = firstDeliverableCandidate; if (deliverableCandidate != firstUndeliverable) { if (!deliverableCandidate.hasContent()) { return null; } firstDeliverableCandidate = deliverableCandidate.next; recordRemovingM... | QueueBuffer { public synchronized Message getFirstDeliverable() { submitMessageReads(); Node deliverableCandidate = firstDeliverableCandidate; if (deliverableCandidate != firstUndeliverable) { if (!deliverableCandidate.hasContent()) { return null; } firstDeliverableCandidate = deliverableCandidate.next; recordRemovingM... |
@Test public void testEquals() throws Exception { LongString other = LongString.parseString("different string"); LongString similar = LongString.parseString(DEFAULT_DATA_STRING); Assert.assertTrue(DEFAULT_TEST_OBJECT.equals(DEFAULT_TEST_OBJECT), "equals() should return true for similar objects"); Assert.assertTrue(DEFA... | @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof LongString) && (Arrays.equals(content, ((LongString) obj).content)); } | LongString implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof LongString) && (Arrays.equals(content, ((LongString) obj).content)); } } | LongString implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof LongString) && (Arrays.equals(content, ((LongString) obj).content)); } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); } | LongString implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof LongString) && (Arrays.equals(content, ((LongString) obj).content)); } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); static LongString parseStrin... | LongString implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof LongString) && (Arrays.equals(content, ((LongString) obj).content)); } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); static LongString parseStrin... |
@Test public void testHashCode() throws Exception { LongString similar = LongString.parseString(DEFAULT_DATA_STRING); Assert.assertEquals(similar.hashCode(), DEFAULT_TEST_OBJECT.hashCode(), "Hashcode should match for similar " + "data"); } | @Override public int hashCode() { return Arrays.hashCode(content); } | LongString implements EncodableData { @Override public int hashCode() { return Arrays.hashCode(content); } } | LongString implements EncodableData { @Override public int hashCode() { return Arrays.hashCode(content); } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); } | LongString implements EncodableData { @Override public int hashCode() { return Arrays.hashCode(content); } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); static LongString parseString(String data); @Override long getSize(); @Override void write(ByteBuf buf); static LongString parse(Byte... | LongString implements EncodableData { @Override public int hashCode() { return Arrays.hashCode(content); } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); static LongString parseString(String data); @Override long getSize(); @Override void write(ByteBuf buf); static LongString parse(Byte... |
@Test(expectedExceptions = Exception.class) public void testInvalidBuffer() throws Exception { ByteBuf buf = Unpooled.buffer(DEFAULT_DATA_STRING.length() + 4); buf.writeLong(-2); LongString.parse(buf); } | public static LongString parse(ByteBuf buf) throws Exception { int size = (int) buf.readUnsignedInt(); if (size < 0) { throw new Exception("Invalid string length"); } byte[] data = new byte[size]; buf.readBytes(data); return new LongString(size, data); } | LongString implements EncodableData { public static LongString parse(ByteBuf buf) throws Exception { int size = (int) buf.readUnsignedInt(); if (size < 0) { throw new Exception("Invalid string length"); } byte[] data = new byte[size]; buf.readBytes(data); return new LongString(size, data); } } | LongString implements EncodableData { public static LongString parse(ByteBuf buf) throws Exception { int size = (int) buf.readUnsignedInt(); if (size < 0) { throw new Exception("Invalid string length"); } byte[] data = new byte[size]; buf.readBytes(data); return new LongString(size, data); } @SuppressFBWarnings("EI_EXP... | LongString implements EncodableData { public static LongString parse(ByteBuf buf) throws Exception { int size = (int) buf.readUnsignedInt(); if (size < 0) { throw new Exception("Invalid string length"); } byte[] data = new byte[size]; buf.readBytes(data); return new LongString(size, data); } @SuppressFBWarnings("EI_EXP... | LongString implements EncodableData { public static LongString parse(ByteBuf buf) throws Exception { int size = (int) buf.readUnsignedInt(); if (size < 0) { throw new Exception("Invalid string length"); } byte[] data = new byte[size]; buf.readBytes(data); return new LongString(size, data); } @SuppressFBWarnings("EI_EXP... |
@Test public void testGetSize() { Assert.assertEquals(TEST_OBJECT.getSize(), 4, "Size of long-uint should be 4"); } | @Override public long getSize() { return 4L; } | LongUint implements EncodableData { @Override public long getSize() { return 4L; } } | LongUint implements EncodableData { @Override public long getSize() { return 4L; } private LongUint(long value); } | LongUint implements EncodableData { @Override public long getSize() { return 4L; } private LongUint(long value); @Override long getSize(); @Override void write(ByteBuf buf); long getInt(); @Override int hashCode(); @Override boolean equals(Object obj); static LongUint parse(ByteBuf buf); static LongUint parse(long val... | LongUint implements EncodableData { @Override public long getSize() { return 4L; } private LongUint(long value); @Override long getSize(); @Override void write(ByteBuf buf); long getInt(); @Override int hashCode(); @Override boolean equals(Object obj); static LongUint parse(ByteBuf buf); static LongUint parse(long val... |
@Test public void testEquals() { LongUint other = LongUint.parse(3); LongUint similar = LongUint.parse(DATA_VALUE); Assert.assertTrue(TEST_OBJECT.equals(TEST_OBJECT), "equals() should return true for similar objects"); Assert.assertTrue(TEST_OBJECT.equals(similar), "equals() should return true for similar objects"); As... | @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof LongUint) && (value == ((LongUint) obj).value); } | LongUint implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof LongUint) && (value == ((LongUint) obj).value); } } | LongUint implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof LongUint) && (value == ((LongUint) obj).value); } private LongUint(long value); } | LongUint implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof LongUint) && (value == ((LongUint) obj).value); } private LongUint(long value); @Override long getSize(); @Override void write(ByteBuf buf); long getInt(); @Override int hashCode()... | LongUint implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof LongUint) && (value == ((LongUint) obj).value); } private LongUint(long value); @Override long getSize(); @Override void write(ByteBuf buf); long getInt(); @Override int hashCode()... |
@Test public void testHashCode() { LongUint similar = LongUint.parse(DATA_VALUE); Assert.assertEquals(similar.hashCode(), TEST_OBJECT.hashCode(), "Hashcode should match for similar data"); } | @Override public int hashCode() { return Objects.hash(value); } | LongUint implements EncodableData { @Override public int hashCode() { return Objects.hash(value); } } | LongUint implements EncodableData { @Override public int hashCode() { return Objects.hash(value); } private LongUint(long value); } | LongUint implements EncodableData { @Override public int hashCode() { return Objects.hash(value); } private LongUint(long value); @Override long getSize(); @Override void write(ByteBuf buf); long getInt(); @Override int hashCode(); @Override boolean equals(Object obj); static LongUint parse(ByteBuf buf); static LongUi... | LongUint implements EncodableData { @Override public int hashCode() { return Objects.hash(value); } private LongUint(long value); @Override long getSize(); @Override void write(ByteBuf buf); long getInt(); @Override int hashCode(); @Override boolean equals(Object obj); static LongUint parse(ByteBuf buf); static LongUi... |
@Test public void testParse() { ByteBuf buf = Unpooled.buffer(4); TEST_OBJECT.write(buf); LongUint parsedObject = LongUint.parse(buf); Assert.assertEquals(parsedObject, TEST_OBJECT, "Encoding and decoding should result in the same object"); } | public static LongUint parse(ByteBuf buf) { return new LongUint(buf.readUnsignedInt()); } | LongUint implements EncodableData { public static LongUint parse(ByteBuf buf) { return new LongUint(buf.readUnsignedInt()); } } | LongUint implements EncodableData { public static LongUint parse(ByteBuf buf) { return new LongUint(buf.readUnsignedInt()); } private LongUint(long value); } | LongUint implements EncodableData { public static LongUint parse(ByteBuf buf) { return new LongUint(buf.readUnsignedInt()); } private LongUint(long value); @Override long getSize(); @Override void write(ByteBuf buf); long getInt(); @Override int hashCode(); @Override boolean equals(Object obj); static LongUint parse(B... | LongUint implements EncodableData { public static LongUint parse(ByteBuf buf) { return new LongUint(buf.readUnsignedInt()); } private LongUint(long value); @Override long getSize(); @Override void write(ByteBuf buf); long getInt(); @Override int hashCode(); @Override boolean equals(Object obj); static LongUint parse(B... |
@Test public void testGetSize() { Assert.assertEquals(TEST_OBJECT.getSize(), 1, "Size of short-short-uint should be 1"); } | @Override public long getSize() { return 1L; } | ShortShortUint implements EncodableData { @Override public long getSize() { return 1L; } } | ShortShortUint implements EncodableData { @Override public long getSize() { return 1L; } private ShortShortUint(short value); } | ShortShortUint implements EncodableData { @Override public long getSize() { return 1L; } private ShortShortUint(short value); @Override long getSize(); @Override void write(ByteBuf buf); static ShortShortUint parse(ByteBuf buf); static ShortShortUint parse(short value); short getByte(); @Override int hashCode(); @Over... | ShortShortUint implements EncodableData { @Override public long getSize() { return 1L; } private ShortShortUint(short value); @Override long getSize(); @Override void write(ByteBuf buf); static ShortShortUint parse(ByteBuf buf); static ShortShortUint parse(short value); short getByte(); @Override int hashCode(); @Over... |
@Test public void testEquals() { ShortShortUint other = ShortShortUint.parse((short) 3); ShortShortUint similar = ShortShortUint.parse(DATA_VALUE); Assert.assertTrue(TEST_OBJECT.equals(TEST_OBJECT), "equals() should return true for similar objects"); Assert.assertTrue(TEST_OBJECT.equals(similar), "equals() should retur... | @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof ShortShortUint) && (value == ((ShortShortUint) obj).value); } | ShortShortUint implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof ShortShortUint) && (value == ((ShortShortUint) obj).value); } } | ShortShortUint implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof ShortShortUint) && (value == ((ShortShortUint) obj).value); } private ShortShortUint(short value); } | ShortShortUint implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof ShortShortUint) && (value == ((ShortShortUint) obj).value); } private ShortShortUint(short value); @Override long getSize(); @Override void write(ByteBuf buf); static ShortSh... | ShortShortUint implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof ShortShortUint) && (value == ((ShortShortUint) obj).value); } private ShortShortUint(short value); @Override long getSize(); @Override void write(ByteBuf buf); static ShortSh... |
@Test public void testHashCode() { ShortShortUint similar = ShortShortUint.parse(DATA_VALUE); Assert.assertEquals(similar.hashCode(), TEST_OBJECT.hashCode(), "Hashcode should match for similar data"); } | @Override public int hashCode() { return (int) value; } | ShortShortUint implements EncodableData { @Override public int hashCode() { return (int) value; } } | ShortShortUint implements EncodableData { @Override public int hashCode() { return (int) value; } private ShortShortUint(short value); } | ShortShortUint implements EncodableData { @Override public int hashCode() { return (int) value; } private ShortShortUint(short value); @Override long getSize(); @Override void write(ByteBuf buf); static ShortShortUint parse(ByteBuf buf); static ShortShortUint parse(short value); short getByte(); @Override int hashCode... | ShortShortUint implements EncodableData { @Override public int hashCode() { return (int) value; } private ShortShortUint(short value); @Override long getSize(); @Override void write(ByteBuf buf); static ShortShortUint parse(ByteBuf buf); static ShortShortUint parse(short value); short getByte(); @Override int hashCode... |
@Test(dataProvider = "exchangeNames", description = "test frequently used exchanges types are defined") public void testGetExchanges(String exchangeName) { Exchange exchange = exchangeRegistry.getExchange(exchangeName); Assert.assertNotNull(exchange, "unable to find the exchange"); Assert.assertEquals(exchange.getName(... | Exchange getExchange(String exchangeName) { return exchangeMap.get(exchangeName); } | ExchangeRegistry { Exchange getExchange(String exchangeName) { return exchangeMap.get(exchangeName); } } | ExchangeRegistry { Exchange getExchange(String exchangeName) { return exchangeMap.get(exchangeName); } ExchangeRegistry(ExchangeDao exchangeDao, BindingDao bindingDao); } | ExchangeRegistry { Exchange getExchange(String exchangeName) { return exchangeMap.get(exchangeName); } ExchangeRegistry(ExchangeDao exchangeDao, BindingDao bindingDao); void createExchange(String exchangeName, Exchange.Type type, boolean durable); Exchange getDefaultExchange(); void retrieveFromStore(QueueRegistry queu... | ExchangeRegistry { Exchange getExchange(String exchangeName) { return exchangeMap.get(exchangeName); } ExchangeRegistry(ExchangeDao exchangeDao, BindingDao bindingDao); void createExchange(String exchangeName, Exchange.Type type, boolean durable); Exchange getDefaultExchange(); void retrieveFromStore(QueueRegistry queu... |
@Test public void testParse() { ByteBuf buf = Unpooled.buffer(1); TEST_OBJECT.write(buf); ShortShortUint parsedObject = ShortShortUint.parse(buf); Assert.assertEquals(parsedObject, TEST_OBJECT, "Encoding and decoding should result in the same object"); } | public static ShortShortUint parse(ByteBuf buf) { return new ShortShortUint(buf.readUnsignedByte()); } | ShortShortUint implements EncodableData { public static ShortShortUint parse(ByteBuf buf) { return new ShortShortUint(buf.readUnsignedByte()); } } | ShortShortUint implements EncodableData { public static ShortShortUint parse(ByteBuf buf) { return new ShortShortUint(buf.readUnsignedByte()); } private ShortShortUint(short value); } | ShortShortUint implements EncodableData { public static ShortShortUint parse(ByteBuf buf) { return new ShortShortUint(buf.readUnsignedByte()); } private ShortShortUint(short value); @Override long getSize(); @Override void write(ByteBuf buf); static ShortShortUint parse(ByteBuf buf); static ShortShortUint parse(short ... | ShortShortUint implements EncodableData { public static ShortShortUint parse(ByteBuf buf) { return new ShortShortUint(buf.readUnsignedByte()); } private ShortShortUint(short value); @Override long getSize(); @Override void write(ByteBuf buf); static ShortShortUint parse(ByteBuf buf); static ShortShortUint parse(short ... |
@Test public void testGetSize() throws Exception { Assert.assertEquals(DEFAULT_TEST_OBJECT.getSize(), DEFAULT_DATA_STRING.length() + 1, "getSize should return " + "required byte array size"); } | public long getSize() { return length + 1; } | ShortString implements EncodableData { public long getSize() { return length + 1; } } | ShortString implements EncodableData { public long getSize() { return length + 1; } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); } | ShortString implements EncodableData { public long getSize() { return length + 1; } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); long getSize(); void write(ByteBuf buf); static ShortString parse(ByteBuf buf); static ShortString parseString(String data); @Override String toString(); @... | ShortString implements EncodableData { public long getSize() { return length + 1; } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); long getSize(); void write(ByteBuf buf); static ShortString parse(ByteBuf buf); static ShortString parseString(String data); @Override String toString(); @... |
@Test public void testParse() throws Exception { ByteBuf buf = Unpooled.buffer(DEFAULT_DATA_STRING.length() + 1); DEFAULT_TEST_OBJECT.write(buf); ShortString parsedObject = ShortString.parse(buf); Assert.assertEquals(parsedObject, DEFAULT_TEST_OBJECT, "Encoding and decoding should match to same object"); } | public static ShortString parse(ByteBuf buf) { int size = buf.readUnsignedByte(); byte[] data = new byte[size]; buf.readBytes(data); return new ShortString(size, data); } | ShortString implements EncodableData { public static ShortString parse(ByteBuf buf) { int size = buf.readUnsignedByte(); byte[] data = new byte[size]; buf.readBytes(data); return new ShortString(size, data); } } | ShortString implements EncodableData { public static ShortString parse(ByteBuf buf) { int size = buf.readUnsignedByte(); byte[] data = new byte[size]; buf.readBytes(data); return new ShortString(size, data); } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); } | ShortString implements EncodableData { public static ShortString parse(ByteBuf buf) { int size = buf.readUnsignedByte(); byte[] data = new byte[size]; buf.readBytes(data); return new ShortString(size, data); } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); long getSize(); void write(By... | ShortString implements EncodableData { public static ShortString parse(ByteBuf buf) { int size = buf.readUnsignedByte(); byte[] data = new byte[size]; buf.readBytes(data); return new ShortString(size, data); } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); long getSize(); void write(By... |
@Test public void testToString() throws Exception { Assert.assertEquals(DEFAULT_TEST_OBJECT.toString(), DEFAULT_DATA_STRING, "toString() should match the data " + "string used to create it"); } | @Override public String toString() { return new String(content, StandardCharsets.UTF_8); } | ShortString implements EncodableData { @Override public String toString() { return new String(content, StandardCharsets.UTF_8); } } | ShortString implements EncodableData { @Override public String toString() { return new String(content, StandardCharsets.UTF_8); } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); } | ShortString implements EncodableData { @Override public String toString() { return new String(content, StandardCharsets.UTF_8); } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); long getSize(); void write(ByteBuf buf); static ShortString parse(ByteBuf buf); static ShortString parseStrin... | ShortString implements EncodableData { @Override public String toString() { return new String(content, StandardCharsets.UTF_8); } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); long getSize(); void write(ByteBuf buf); static ShortString parse(ByteBuf buf); static ShortString parseStrin... |
@Test public void testEquals() throws Exception { ShortString other = ShortString.parseString("different string"); ShortString similar = ShortString.parseString(DEFAULT_DATA_STRING); Assert.assertTrue(DEFAULT_TEST_OBJECT.equals(DEFAULT_TEST_OBJECT), "equals() should return true for similar objects"); Assert.assertTrue(... | @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof ShortString) && (Arrays.equals(content, ((ShortString) obj).content)); } | ShortString implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof ShortString) && (Arrays.equals(content, ((ShortString) obj).content)); } } | ShortString implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof ShortString) && (Arrays.equals(content, ((ShortString) obj).content)); } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); } | ShortString implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof ShortString) && (Arrays.equals(content, ((ShortString) obj).content)); } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); long getSize(); void wri... | ShortString implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof ShortString) && (Arrays.equals(content, ((ShortString) obj).content)); } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); long getSize(); void wri... |
@Test public void testHashCode() throws Exception { ShortString similar = ShortString.parseString(DEFAULT_DATA_STRING); Assert.assertEquals(similar.hashCode(), DEFAULT_TEST_OBJECT.hashCode(), "Hashcode should match for similar " + "data"); } | @Override public int hashCode() { return Arrays.hashCode(content); } | ShortString implements EncodableData { @Override public int hashCode() { return Arrays.hashCode(content); } } | ShortString implements EncodableData { @Override public int hashCode() { return Arrays.hashCode(content); } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); } | ShortString implements EncodableData { @Override public int hashCode() { return Arrays.hashCode(content); } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); long getSize(); void write(ByteBuf buf); static ShortString parse(ByteBuf buf); static ShortString parseString(String data); @Overr... | ShortString implements EncodableData { @Override public int hashCode() { return Arrays.hashCode(content); } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); long getSize(); void write(ByteBuf buf); static ShortString parse(ByteBuf buf); static ShortString parseString(String data); @Overr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.