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( expected = AssertionError.class ) public void testEncode_fail_value() throws Exception { Scope scope = CoreModule.getInstance().createScope(); Type type = UniversalType.UTC_TIME.ref().resolve( scope ); Value value = BooleanValue.TRUE; try( AbstractBerWriter writer = mock( AbstractBerWriter.class ) ) { new UTCTim... | @Override public void encode( @NotNull WriterContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.UTC_TIME; assert context.getValue().getKind() == Kind.TIME; String content = TimeUtils.formatInstant( context.getValue().toDateValue().asInstant(), TimeUtils.UTC_TIME_FORMAT,... | UTCTimeBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.UTC_TIME; assert context.getValue().getKind() == Kind.TIME; String content = TimeUtils.formatInstant( context.getValue().toDateValue... | UTCTimeBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.UTC_TIME; assert context.getValue().getKind() == Kind.TIME; String content = TimeUtils.formatInstant( context.getValue().toDateValue... | UTCTimeBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.UTC_TIME; assert context.getValue().getKind() == Kind.TIME; String content = TimeUtils.formatInstant( context.getValue().toDateValue... | UTCTimeBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.UTC_TIME; assert context.getValue().getKind() == Kind.TIME; String content = TimeUtils.formatInstant( context.getValue().toDateValue... |
@Test public void testEncode_0() throws Exception { Scope scope = CoreModule.getInstance().createScope(); Enumerated type = new EnumeratedType(); type.addItem( ItemKind.PRIMARY, "a", new IntegerValueInt( 0 ) ); type.validate( scope ); Value value = type.optimize( scope, new IntegerValueInt( 0 ) ); try( AbstractBerWrite... | @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEGER; IntegerBerEncoder.writeLong( context.getWriter(), conte... | EnumeratedBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEGER; IntegerBer... | EnumeratedBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEGER; IntegerBer... | EnumeratedBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEGER; IntegerBer... | EnumeratedBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEGER; IntegerBer... |
@Test( expected = AssertionError.class ) public void testEncode_fail_type() throws Exception { Scope scope = CoreModule.getInstance().createScope(); Type type = UniversalType.INTEGER.ref().resolve( scope ); Value value = new NamedValueImpl( "abc", new IntegerValueInt( 0 ) ); try( AbstractBerWriter writer = mock( Abstra... | @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEGER; IntegerBerEncoder.writeLong( context.getWriter(), conte... | EnumeratedBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEGER; IntegerBer... | EnumeratedBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEGER; IntegerBer... | EnumeratedBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEGER; IntegerBer... | EnumeratedBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEGER; IntegerBer... |
@Test( expected = AssertionError.class ) public void testDecode_fail_type() throws Exception { Scope scope = CoreModule.getInstance().createScope(); Type type = UniversalType.INTEGER.ref().resolve( scope ); try( AbstractBerReader reader = mock( DefaultBerReader.class ) ) { Tag tag = ( (TagEncoding)type.getEncoding( Enc... | @Override public Value decode( @NotNull ReaderContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.RESTRICTED_STRING; Type type = context.getType(); while( !( type instanceof StringType ) ) { assert type != null; type = type.getSibling(); } byte[] content = BerDecoderUtil... | StringBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.RESTRICTED_STRING; Type type = context.getType(); while( !( type instanceof StringType ) ) { assert type != null; type = type.getSib... | StringBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.RESTRICTED_STRING; Type type = context.getType(); while( !( type instanceof StringType ) ) { assert type != null; type = type.getSib... | StringBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.RESTRICTED_STRING; Type type = context.getType(); while( !( type instanceof StringType ) ) { assert type != null; type = type.getSib... | StringBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.RESTRICTED_STRING; Type type = context.getType(); while( !( type instanceof StringType ) ) { assert type != null; type = type.getSib... |
@Test( expected = AssertionError.class ) public void testEncode_fail_value() throws Exception { Scope scope = CoreModule.getInstance().createScope(); Enumerated type = new EnumeratedType(); type.addItem( ItemKind.PRIMARY, "a", new IntegerValueInt( 0 ) ); type.validate( scope ); Value value = BooleanValue.TRUE; try( Abs... | @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEGER; IntegerBerEncoder.writeLong( context.getWriter(), conte... | EnumeratedBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEGER; IntegerBer... | EnumeratedBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEGER; IntegerBer... | EnumeratedBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEGER; IntegerBer... | EnumeratedBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEGER; IntegerBer... |
@Test( expected = UnsupportedOperationException.class ) public void testGetTextFail() { new GroupSyntaxObject().getText(); Assert.fail( "Exception was not thrown" ); } | @Override public String getText() { throw new UnsupportedOperationException(); } | GroupSyntaxObject implements SyntaxObject { @Override public String getText() { throw new UnsupportedOperationException(); } } | GroupSyntaxObject implements SyntaxObject { @Override public String getText() { throw new UnsupportedOperationException(); } } | GroupSyntaxObject implements SyntaxObject { @Override public String getText() { throw new UnsupportedOperationException(); } @Override Kind getKind(); @Override String getText(); void addObject( SyntaxObject object ); List<SyntaxObject> getObjects(); } | GroupSyntaxObject implements SyntaxObject { @Override public String getText() { throw new UnsupportedOperationException(); } @Override Kind getKind(); @Override String getText(); void addObject( SyntaxObject object ); List<SyntaxObject> getObjects(); } |
@Test public void testAddObject() { GroupSyntaxObject group = new GroupSyntaxObject(); Assert.assertEquals( "Kind is not GROUP", Kind.GROUP, group.getKind() ); Assert.assertTrue( "Collection is not empty", group.getObjects().isEmpty() ); group.addObject( new SimpleSyntaxObject( Kind.KEYWORD, "VALUE" ) ); Assert.assertE... | public void addObject( SyntaxObject object ) { objects.add( object ); } | GroupSyntaxObject implements SyntaxObject { public void addObject( SyntaxObject object ) { objects.add( object ); } } | GroupSyntaxObject implements SyntaxObject { public void addObject( SyntaxObject object ) { objects.add( object ); } } | GroupSyntaxObject implements SyntaxObject { public void addObject( SyntaxObject object ) { objects.add( object ); } @Override Kind getKind(); @Override String getText(); void addObject( SyntaxObject object ); List<SyntaxObject> getObjects(); } | GroupSyntaxObject implements SyntaxObject { public void addObject( SyntaxObject object ) { objects.add( object ); } @Override Kind getKind(); @Override String getText(); void addObject( SyntaxObject object ); List<SyntaxObject> getObjects(); } |
@Test( expected = ResolutionException.class ) public void testParserFail() throws Exception { ModuleImpl module = ModuleImpl.newDummy( new ModuleSet() ); AbstractSyntaxObjectRef ref = new AbstractSyntaxObjectRef( "{ ID &id }" ); ClassType classType = new ClassTypeImpl(); Scope scope = classType.getScope( module.createS... | @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Unable to find ClassType" ); Module module = scope.... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... |
@Test public void testParser() throws Exception { ModuleImpl module = ModuleImpl.newDummy( new ModuleSet() ); ClassTypeImpl classType = new ClassTypeImpl(); classType.setSyntaxList( Arrays.asList( "&Type", "IDENTIFIED", "BY", "&id", "[", "CONSTRAINED", "BY", "&TypeConstraint", "]" ) ); classType.add( new ValueFieldType... | @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Unable to find ClassType" ); Module module = scope.... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... |
@Test( expected = ResolutionException.class ) public void testNoClassType() throws Exception { AbstractSyntaxObjectRef ref = new AbstractSyntaxObjectRef( "{ ID &id }" ); ModuleImpl module = ModuleImpl.newDummy( new ModuleSet() ); DefinedTypeImpl myInt = new DefinedTypeImpl( module, "MyInt", UniversalType.INTEGER.ref() ... | @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Unable to find ClassType" ); Module module = scope.... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... |
@Test( expected = ResolutionException.class ) public void testParserValueFail() throws Exception { ModuleImpl module = ModuleImpl.newDummy( new ModuleSet() ); ClassTypeImpl classType = new ClassTypeImpl(); classType.setSyntaxList( Arrays.asList( "&Type", "IDENTIFIED", "BY", "&id", "[", "CONSTRAINED", "BY", "&TypeConstr... | @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Unable to find ClassType" ); Module module = scope.... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... |
@Test public void testParserValueSequence() throws Exception { ModuleImpl module = ModuleImpl.newDummy( new ModuleSet() ); ClassTypeImpl classType = new ClassTypeImpl(); classType.setSyntaxList( Arrays.asList( "&Type", "IDENTIFIED", "BY", "&id", "[", "CONSTRAINED", "BY", "&TypeConstraint", "]" ) ); classType.add( new V... | @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Unable to find ClassType" ); Module module = scope.... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... |
@Test( expected = ResolutionException.class ) public void testParserFailTypeExpected() throws Exception { ModuleImpl module = ModuleImpl.newDummy( new ModuleSet() ); ClassTypeImpl classType = new ClassTypeImpl(); classType.setSyntaxList( Arrays.asList( "&Type", "IDENTIFIED", "BY", "&id", "[", "CONSTRAINED", "BY", "&Typ... | @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Unable to find ClassType" ); Module module = scope.... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... |
@Test public void testParserExternalRef() throws Exception { ModuleImpl module = ModuleImpl.newDummy( new ModuleSet() ); ClassTypeImpl classType = new ClassTypeImpl(); classType.setSyntaxList( Arrays.asList( "&Type", "IDENTIFIED", "BY", "&id", "[", "CONSTRAINED", "BY", "&TypeConstraint", "]" ) ); classType.add( new Val... | @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Unable to find ClassType" ); Module module = scope.... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... | AbstractSyntaxObjectRef implements Ref<Value> { @Override public Value resolve( Scope scope ) throws ResolutionException { Type type = scope.getTypeOrDie(); while( type != null && !( type instanceof ClassType ) ) type = type.hasSibling() ? type.getSibling() : null; if( type == null ) throw new ResolutionException( "Una... |
@Test( expected = AssertionError.class ) public void testDecode_fail_type() throws Exception { Scope scope = CoreModule.getInstance().createScope(); Type type = UniversalType.INTEGER.ref().resolve( scope ); try( AbstractBerReader reader = mock( DefaultBerReader.class ) ) { Tag tag = ( (TagEncoding)type.getEncoding( Enc... | @Override public Value decode( @NotNull ReaderContext context ) { assert context.getType().getFamily() == Family.NULL; assert context.getLength() == 0; return NullValue.INSTANCE; } | NullBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) { assert context.getType().getFamily() == Family.NULL; assert context.getLength() == 0; return NullValue.INSTANCE; } } | NullBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) { assert context.getType().getFamily() == Family.NULL; assert context.getLength() == 0; return NullValue.INSTANCE; } } | NullBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) { assert context.getType().getFamily() == Family.NULL; assert context.getLength() == 0; return NullValue.INSTANCE; } @Override Value decode( @NotNull ReaderContext context ); } | NullBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) { assert context.getType().getFamily() == Family.NULL; assert context.getLength() == 0; return NullValue.INSTANCE; } @Override Value decode( @NotNull ReaderContext context ); } |
@Test public void testFileQueue() throws IOException { FileQueueService fileQueueService = new FileQueueService(getTempFilePath()); fileQueueService.getQueueFile().add("test".getBytes()); assertThat(fileQueueService.getQueueFile().peek(), is("test".getBytes())); } | public QueueFile getQueueFile() { return this.queueFile; } | FileQueueService { public QueueFile getQueueFile() { return this.queueFile; } } | FileQueueService { public QueueFile getQueueFile() { return this.queueFile; } @Autowired FileQueueService(@Value("${modum.tokenapp.email.queue-file-path}") String queueFilePath,
@Autowired ObjectMapper objectMapper); FileQueueService(String queueFilePath); FileQueueService(); } | FileQueueService { public QueueFile getQueueFile() { return this.queueFile; } @Autowired FileQueueService(@Value("${modum.tokenapp.email.queue-file-path}") String queueFilePath,
@Autowired ObjectMapper objectMapper); FileQueueService(String queueFilePath); FileQueueService(); QueueFile ge... | FileQueueService { public QueueFile getQueueFile() { return this.queueFile; } @Autowired FileQueueService(@Value("${modum.tokenapp.email.queue-file-path}") String queueFilePath,
@Autowired ObjectMapper objectMapper); FileQueueService(String queueFilePath); FileQueueService(); QueueFile ge... |
@Test public void testMintingLarge() throws ExecutionException, InterruptedException { dataBtc(1).dataBtc(2); rateBtc(101, 1_050_000); rateBtc(102, 7); int current = 0; current = minting.mint(current, 100, 0, 1 * 100_000_000, 0, "w1"); Assert.assertEquals(2_100_000, current); current = minting.mint(current, 102, 0, 1 *... | public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount())); receip... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... |
@Test public void testMintingLarge2() throws ExecutionException, InterruptedException { dataBtc(1).dataBtc(2); rateBtc(101, 1_050_001); rateBtc(102, 7); int current = 0; current = minting.mint(current, 100, 0, 1 * 100_000_000, 0, "w1"); Assert.assertEquals(0, current); current = minting.mint(current, 102, 0, 1 * 100_00... | public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount())); receip... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... |
@Test public void testMinting() throws ExecutionException, InterruptedException { dataBtc(1).dataBtc(2); rateBtc(101, 1_050_000); rateBtc(102, 1_470_000); rateBtc(103, 1_785_000); rateBtc(104, 2_100_000); rateBtc(105, 1); int current = 0; current = minting.mint(current, 100, 0, 1 * 100_000_000, 0, "w1"); Assert.assertE... | public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount())); receip... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... |
@Test public void testFileQueueRecovering() throws IOException { String tempFile = getTempFilePath(); FileQueueService fileQueueService1 = new FileQueueService(tempFile); fileQueueService1.getQueueFile().add("test".getBytes()); FileQueueService fileQueueService2 = new FileQueueService(tempFile); assertThat(fileQueueSer... | public QueueFile getQueueFile() { return this.queueFile; } | FileQueueService { public QueueFile getQueueFile() { return this.queueFile; } } | FileQueueService { public QueueFile getQueueFile() { return this.queueFile; } @Autowired FileQueueService(@Value("${modum.tokenapp.email.queue-file-path}") String queueFilePath,
@Autowired ObjectMapper objectMapper); FileQueueService(String queueFilePath); FileQueueService(); } | FileQueueService { public QueueFile getQueueFile() { return this.queueFile; } @Autowired FileQueueService(@Value("${modum.tokenapp.email.queue-file-path}") String queueFilePath,
@Autowired ObjectMapper objectMapper); FileQueueService(String queueFilePath); FileQueueService(); QueueFile ge... | FileQueueService { public QueueFile getQueueFile() { return this.queueFile; } @Autowired FileQueueService(@Value("${modum.tokenapp.email.queue-file-path}") String queueFilePath,
@Autowired ObjectMapper objectMapper); FileQueueService(String queueFilePath); FileQueueService(); QueueFile ge... |
@Test public void testSendEmailTask() throws IOException, URISyntaxException { FileQueueService fileQueueService = new FileQueueService(getTempFilePath(), objectMapper); fileQueueService.addConfirmationEmail(new Investor().setEmail(INVESTOR_EMAIL), new URI(CONFIRMATION_EMAIL_URI)); Email email = fileQueueService.peekEm... | public SendEmailTask() { } | SendEmailTask { public SendEmailTask() { } } | SendEmailTask { public SendEmailTask() { } SendEmailTask(); } | SendEmailTask { public SendEmailTask() { } SendEmailTask(); @Scheduled(initialDelay = 10000, fixedRateString = "${modum.tokenapp.email.send-email-interval}") void sendEmail(); } | SendEmailTask { public SendEmailTask() { } SendEmailTask(); @Scheduled(initialDelay = 10000, fixedRateString = "${modum.tokenapp.email.send-email-interval}") void sendEmail(); } |
@Test public void testConnect1() throws IOException { String balance = etherscan.getBalance("0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae").toString(); System.out.println("balance: "+balance); } | public BigInteger getBalance(String address) throws IOException { String s = "https: "?module=account" + "&action=balance" + "&address=" + address + "&tag=latest" + "&apikey="+apiKey; HttpHeaders headers = new HttpHeaders(); headers.set("User-Agent", options.getUserAgent()); ResponseEntity<String> res = restTemplate.ex... | Etherscan { public BigInteger getBalance(String address) throws IOException { String s = "https: "?module=account" + "&action=balance" + "&address=" + address + "&tag=latest" + "&apikey="+apiKey; HttpHeaders headers = new HttpHeaders(); headers.set("User-Agent", options.getUserAgent()); ResponseEntity<String> res = res... | Etherscan { public BigInteger getBalance(String address) throws IOException { String s = "https: "?module=account" + "&action=balance" + "&address=" + address + "&tag=latest" + "&apikey="+apiKey; HttpHeaders headers = new HttpHeaders(); headers.set("User-Agent", options.getUserAgent()); ResponseEntity<String> res = res... | Etherscan { public BigInteger getBalance(String address) throws IOException { String s = "https: "?module=account" + "&action=balance" + "&address=" + address + "&tag=latest" + "&apikey="+apiKey; HttpHeaders headers = new HttpHeaders(); headers.set("User-Agent", options.getUserAgent()); ResponseEntity<String> res = res... | Etherscan { public BigInteger getBalance(String address) throws IOException { String s = "https: "?module=account" + "&action=balance" + "&address=" + address + "&tag=latest" + "&apikey="+apiKey; HttpHeaders headers = new HttpHeaders(); headers.set("User-Agent", options.getUserAgent()); ResponseEntity<String> res = res... |
@Test public void testConnect2() throws IOException { String balance = etherscan.get20Balances("0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae", "0x25d96310cd6694d88b9c6803be09511597c0a630").toString(); System.out.println("balance: "+balance); } | public BigInteger get20Balances(String... contract) throws IOException { return get20Balances(Arrays.asList(contract)); } | Etherscan { public BigInteger get20Balances(String... contract) throws IOException { return get20Balances(Arrays.asList(contract)); } } | Etherscan { public BigInteger get20Balances(String... contract) throws IOException { return get20Balances(Arrays.asList(contract)); } } | Etherscan { public BigInteger get20Balances(String... contract) throws IOException { return get20Balances(Arrays.asList(contract)); } BigInteger getBalance(String address); List<Triple<Date,Long,Long>> getTxEth(String address); BigInteger get20Balances(String... contract); BigInteger get20Balances(List<String> contrac... | Etherscan { public BigInteger get20Balances(String... contract) throws IOException { return get20Balances(Arrays.asList(contract)); } BigInteger getBalance(String address); List<Triple<Date,Long,Long>> getTxEth(String address); BigInteger get20Balances(String... contract); BigInteger get20Balances(List<String> contrac... |
@Test public void testBlockNr() throws IOException { long bl1 = blockr.getCurrentBlockNr(); long bl2 = etherscan.getCurrentBlockNr(); System.out.println("ret: "+bl1 +"/"+bl2); } | public long getCurrentBlockNr() throws IOException { String s = "https: "?module=proxy" + "&action=eth_blockNumber" + "&apikey="+apiKey; HttpHeaders headers = new HttpHeaders(); headers.set("User-Agent", options.getUserAgent()); ResponseEntity<String> res = restTemplate.exchange(s, HttpMethod.GET, new HttpEntity<>(null... | Etherscan { public long getCurrentBlockNr() throws IOException { String s = "https: "?module=proxy" + "&action=eth_blockNumber" + "&apikey="+apiKey; HttpHeaders headers = new HttpHeaders(); headers.set("User-Agent", options.getUserAgent()); ResponseEntity<String> res = restTemplate.exchange(s, HttpMethod.GET, new HttpE... | Etherscan { public long getCurrentBlockNr() throws IOException { String s = "https: "?module=proxy" + "&action=eth_blockNumber" + "&apikey="+apiKey; HttpHeaders headers = new HttpHeaders(); headers.set("User-Agent", options.getUserAgent()); ResponseEntity<String> res = restTemplate.exchange(s, HttpMethod.GET, new HttpE... | Etherscan { public long getCurrentBlockNr() throws IOException { String s = "https: "?module=proxy" + "&action=eth_blockNumber" + "&apikey="+apiKey; HttpHeaders headers = new HttpHeaders(); headers.set("User-Agent", options.getUserAgent()); ResponseEntity<String> res = restTemplate.exchange(s, HttpMethod.GET, new HttpE... | Etherscan { public long getCurrentBlockNr() throws IOException { String s = "https: "?module=proxy" + "&action=eth_blockNumber" + "&apikey="+apiKey; HttpHeaders headers = new HttpHeaders(); headers.set("User-Agent", options.getUserAgent()); ResponseEntity<String> res = restTemplate.exchange(s, HttpMethod.GET, new HttpE... |
@Test public void testMintingRate() throws ExecutionException, InterruptedException { dataBtc(1); rateBtc(99, 1); rateBtc(100, 1000); rateBtc(101, 3000); int current = 0; current = minting.mint(current, 100, 0, 1 * 100_000_000, 0, "w1"); Assert.assertEquals(2000, current); Token token = tokenRepository.findAllByOrderBy... | public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount())); receip... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... |
@Test public void testMintingRateMissing() throws ExecutionException, InterruptedException { dataBtc(1); rateBtc(99, 1); rateBtc(101, 3000); int current = 0; current = minting.mint(current, 100, 0, 1 * 100_000_000, 0, "w1"); Assert.assertEquals(6000, current); Token token = tokenRepository.findAllByOrderByWalletAddress... | public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount())); receip... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... |
@Test public void testMintingBoundary() throws ExecutionException, InterruptedException { dataBtc(1).dataBtc(2); rateBtc(101, 1_049_999); rateBtc(102, 3); int current = 0; current = minting.mint(current, 100, 0, 1 * 100_000_000, 0, "w1"); Assert.assertEquals(2_099_998, current); current = minting.mint(current, 102, 0, ... | public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount())); receip... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... |
@Test public void testMintingBoundary2() throws ExecutionException, InterruptedException { dataBtc(1).dataBtc(2); rateBtc(101, 1_049_999); rateBtc(102, 8); int current = 0; current = minting.mint(current, 100, 0, 1 * 100_000_000, 0, "w1"); Assert.assertEquals(2_099_998, current); current = minting.mint(current, 102, 0,... | public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount())); receip... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... | Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToken.mint(new Address(token.getWalletAddress()), new Uint256(token.getAmount()... |
@Test public void twoByteEncoding() throws IOException { BerByteArrayOutputStream berBAOStream = new BerByteArrayOutputStream(50); BerIdentifier berIdentifier = new BerIdentifier(BerIdentifier.APPLICATION_CLASS, BerIdentifier.PRIMITIVE, 31); int length = berIdentifier.encode(berBAOStream); Assert.assertEquals(2, length... | public int encode(BerByteArrayOutputStream berOStream) throws IOException { for (int i = (identifier.length - 1); i >= 0; i--) { berOStream.write(identifier[i]); } return identifier.length; } | BerIdentifier { public int encode(BerByteArrayOutputStream berOStream) throws IOException { for (int i = (identifier.length - 1); i >= 0; i--) { berOStream.write(identifier[i]); } return identifier.length; } } | BerIdentifier { public int encode(BerByteArrayOutputStream berOStream) throws IOException { for (int i = (identifier.length - 1); i >= 0; i--) { berOStream.write(identifier[i]); } return identifier.length; } BerIdentifier(int identifierClass, int primitive, int tagNumber); BerIdentifier(); } | BerIdentifier { public int encode(BerByteArrayOutputStream berOStream) throws IOException { for (int i = (identifier.length - 1); i >= 0; i--) { berOStream.write(identifier[i]); } return identifier.length; } BerIdentifier(int identifierClass, int primitive, int tagNumber); BerIdentifier(); int encode(BerByteArrayOutpu... | BerIdentifier { public int encode(BerByteArrayOutputStream berOStream) throws IOException { for (int i = (identifier.length - 1); i >= 0; i--) { berOStream.write(identifier[i]); } return identifier.length; } BerIdentifier(int identifierClass, int primitive, int tagNumber); BerIdentifier(); int encode(BerByteArrayOutpu... |
@Test public void implicitEncoding7() throws IOException { BerByteArrayOutputStream berBAOStream = new BerByteArrayOutputStream(50); IntegerUnivPrim testInteger = new IntegerUnivPrim(-129); int length = testInteger.encode(berBAOStream, false); Assert.assertEquals(3, length); byte[] expectedBytes = new byte[] { 0x02, (b... | public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1) || val < Mat... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... |
@Test public void explicitEncoding() throws IOException { BerByteArrayOutputStream berStream = new BerByteArrayOutputStream(50); BerInteger testInteger = new BerInteger(51); int length = testInteger.encode(berStream, true); Assert.assertEquals(3, length); byte[] expectedBytes = new byte[] { 0x02, 0x01, 0x33 }; Assert.a... | public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1) || val < Mat... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... |
@Test public void explicitDecoding() throws IOException { byte[] byteCode = new byte[] { 0x02, 0x01, 0x33 }; ByteArrayInputStream berInputStream = new ByteArrayInputStream(byteCode); BerInteger asn1Integer = new BerInteger(); asn1Integer.decode(berInputStream, true); Assert.assertEquals(51, asn1Integer.val); } | public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded length of BerInte... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... |
@Test public void explicitEncoding2() throws IOException { BerByteArrayOutputStream berStream = new BerByteArrayOutputStream(50); BerInteger testInteger = new BerInteger(5555); int length = testInteger.encode(berStream, true); Assert.assertEquals(4, length); byte[] expectedBytes = new byte[] { 0x02, 0x02, 0x15, (byte) ... | public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1) || val < Mat... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... |
@Test public void explicitDecoding2() throws IOException { byte[] byteCode = new byte[] { 0x02, 0x02, 0x15, (byte) 0xb3 }; ByteArrayInputStream berInputStream = new ByteArrayInputStream(byteCode); BerInteger asn1Integer = new BerInteger(); asn1Integer.decode(berInputStream, true); Assert.assertEquals(5555, asn1Integer.... | public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded length of BerInte... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... |
@Test public void explicitDecoding3() throws IOException { byte[] byteCode = new byte[] { 0x02, 0x01, (byte) 0xc0 }; ByteArrayInputStream berInputStream = new ByteArrayInputStream(byteCode); BerInteger asn1Integer = new BerInteger(); asn1Integer.decode(berInputStream, true); Assert.assertEquals(-64, asn1Integer.val); } | public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded length of BerInte... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... |
@Test public void explicitDecoding4() throws IOException { byte[] byteCode = new byte[] { 0x02, 0x02, (byte) 0xff, 0x01 }; ByteArrayInputStream berInputStream = new ByteArrayInputStream(byteCode); BerInteger asn1Integer = new BerInteger(); asn1Integer.decode(berInputStream, true); Assert.assertEquals(-255, asn1Integer.... | public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded length of BerInte... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... | BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException("Decoded leng... |
@Test public void explicitEncoding() throws IOException { BerByteArrayOutputStream berStream = new BerByteArrayOutputStream(50); byte[] byteArray = new byte[] { 0x01, 0x02, 0x03 }; BerOctetString asn1OctetString = new BerOctetString(byteArray); int length = asn1OctetString.encode(berStream, true); Assert.assertEquals(5... | public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { berOStream.write(octetString); int codeLength = octetString.length; codeLength += BerLength.encodeLength(berOStream, codeLength); if (explicit) { codeLength += id.encode(berOStream); } return codeLength; } | BerOctetString { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { berOStream.write(octetString); int codeLength = octetString.length; codeLength += BerLength.encodeLength(berOStream, codeLength); if (explicit) { codeLength += id.encode(berOStream); } return codeLength; } } | BerOctetString { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { berOStream.write(octetString); int codeLength = octetString.length; codeLength += BerLength.encodeLength(berOStream, codeLength); if (explicit) { codeLength += id.encode(berOStream); } return codeLength; } Ber... | BerOctetString { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { berOStream.write(octetString); int codeLength = octetString.length; codeLength += BerLength.encodeLength(berOStream, codeLength); if (explicit) { codeLength += id.encode(berOStream); } return codeLength; } Ber... | BerOctetString { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { berOStream.write(octetString); int codeLength = octetString.length; codeLength += BerLength.encodeLength(berOStream, codeLength); if (explicit) { codeLength += id.encode(berOStream); } return codeLength; } Ber... |
@Test public void explicitDecoding() throws IOException { byte[] byteCode = new byte[] { 0x04, 0x00 }; ByteArrayInputStream berInputStream = new ByteArrayInputStream(byteCode); BerOctetString asn1OctetString = new BerOctetString(); asn1OctetString.decode(berInputStream, true); Assert.assertEquals(0, asn1OctetString.oct... | public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); octetString = new byte[length.val]; if (length.val != 0) { if (iStream.read(octetString,... | BerOctetString { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); octetString = new byte[length.val]; if (length.val != 0) { if (iStream.... | BerOctetString { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); octetString = new byte[length.val]; if (length.val != 0) { if (iStream.... | BerOctetString { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); octetString = new byte[length.val]; if (length.val != 0) { if (iStream.... | BerOctetString { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); octetString = new byte[length.val]; if (length.val != 0) { if (iStream.... |
@Test public void explicitEncoding() throws IOException { BerByteArrayOutputStream berBAOStream = new BerByteArrayOutputStream(50); BerObjectIdentifier oi = new BerObjectIdentifier(objectIdentifierComponents); int length = oi.encode(berBAOStream, true); Assert.assertEquals(7, length); Assert.assertArrayEquals(expectedB... | public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { int firstSubidentifier = 40 * objectIdentifierComponents[0] + objectIdentifierCom... | BerObjectIdentifier { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { int firstSubidentifier = 40 * objectIdentifierComponents[0]... | BerObjectIdentifier { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { int firstSubidentifier = 40 * objectIdentifierComponents[0]... | BerObjectIdentifier { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { int firstSubidentifier = 40 * objectIdentifierComponents[0]... | BerObjectIdentifier { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { int firstSubidentifier = 40 * objectIdentifierComponents[0]... |
@Test public void encodeLength() throws IOException { BerByteArrayOutputStream berOStream = new BerByteArrayOutputStream(50); int codedLength = BerLength.encodeLength(berOStream, 128); Assert.assertEquals(2, codedLength); byte[] expectedBytes = new byte[] { (byte) 0x81, (byte) 128 }; Assert.assertArrayEquals(expectedBy... | public static int encodeLength(BerByteArrayOutputStream berOStream, int length) throws IOException { if (length <= 127) { berOStream.write((byte) length); return 1; } else { int numLengthBytes = 1; while (((int) (Math.pow(2, 8 * numLengthBytes) - 1)) < length) { numLengthBytes++; } for (int i = 0; i < numLengthBytes; i... | BerLength { public static int encodeLength(BerByteArrayOutputStream berOStream, int length) throws IOException { if (length <= 127) { berOStream.write((byte) length); return 1; } else { int numLengthBytes = 1; while (((int) (Math.pow(2, 8 * numLengthBytes) - 1)) < length) { numLengthBytes++; } for (int i = 0; i < numLe... | BerLength { public static int encodeLength(BerByteArrayOutputStream berOStream, int length) throws IOException { if (length <= 127) { berOStream.write((byte) length); return 1; } else { int numLengthBytes = 1; while (((int) (Math.pow(2, 8 * numLengthBytes) - 1)) < length) { numLengthBytes++; } for (int i = 0; i < numLe... | BerLength { public static int encodeLength(BerByteArrayOutputStream berOStream, int length) throws IOException { if (length <= 127) { berOStream.write((byte) length); return 1; } else { int numLengthBytes = 1; while (((int) (Math.pow(2, 8 * numLengthBytes) - 1)) < length) { numLengthBytes++; } for (int i = 0; i < numLe... | BerLength { public static int encodeLength(BerByteArrayOutputStream berOStream, int length) throws IOException { if (length <= 127) { berOStream.write((byte) length); return 1; } else { int numLengthBytes = 1; while (((int) (Math.pow(2, 8 * numLengthBytes) - 1)) < length) { numLengthBytes++; } for (int i = 0; i < numLe... |
@Test public void explicitDecoding() throws IOException { ByteArrayInputStream berInputStream = new ByteArrayInputStream(expectedBytes); BerObjectIdentifier oi = new BerObjectIdentifier(); oi.decode(berInputStream, true); Assert.assertArrayEquals(objectIdentifierComponents, oi.objectIdentifierComponents); ByteArrayInpu... | public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val == 0) { objectIdentifierComponents = new int[0]; return codeLength; } byt... | BerObjectIdentifier { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val == 0) { objectIdentifierComponents = new int[0]; re... | BerObjectIdentifier { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val == 0) { objectIdentifierComponents = new int[0]; re... | BerObjectIdentifier { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val == 0) { objectIdentifierComponents = new int[0]; re... | BerObjectIdentifier { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val == 0) { objectIdentifierComponents = new int[0]; re... |
@Test public void encodeLength2() throws IOException { BerByteArrayOutputStream berOStream = new BerByteArrayOutputStream(50); int codedLength = BerLength.encodeLength(berOStream, 128); Assert.assertEquals(2, codedLength); byte[] expectedBytes = new byte[] { (byte) 0x81, (byte) 128 }; Assert.assertArrayEquals(expectedB... | public static int encodeLength(BerByteArrayOutputStream berOStream, int length) throws IOException { if (length <= 127) { berOStream.write((byte) length); return 1; } else { int numLengthBytes = 1; while (((int) (Math.pow(2, 8 * numLengthBytes) - 1)) < length) { numLengthBytes++; } for (int i = 0; i < numLengthBytes; i... | BerLength { public static int encodeLength(BerByteArrayOutputStream berOStream, int length) throws IOException { if (length <= 127) { berOStream.write((byte) length); return 1; } else { int numLengthBytes = 1; while (((int) (Math.pow(2, 8 * numLengthBytes) - 1)) < length) { numLengthBytes++; } for (int i = 0; i < numLe... | BerLength { public static int encodeLength(BerByteArrayOutputStream berOStream, int length) throws IOException { if (length <= 127) { berOStream.write((byte) length); return 1; } else { int numLengthBytes = 1; while (((int) (Math.pow(2, 8 * numLengthBytes) - 1)) < length) { numLengthBytes++; } for (int i = 0; i < numLe... | BerLength { public static int encodeLength(BerByteArrayOutputStream berOStream, int length) throws IOException { if (length <= 127) { berOStream.write((byte) length); return 1; } else { int numLengthBytes = 1; while (((int) (Math.pow(2, 8 * numLengthBytes) - 1)) < length) { numLengthBytes++; } for (int i = 0; i < numLe... | BerLength { public static int encodeLength(BerByteArrayOutputStream berOStream, int length) throws IOException { if (length <= 127) { berOStream.write((byte) length); return 1; } else { int numLengthBytes = 1; while (((int) (Math.pow(2, 8 * numLengthBytes) - 1)) < length) { numLengthBytes++; } for (int i = 0; i < numLe... |
@Test public void explicitDecoding() throws IOException { byte[] byteCode = new byte[] { (byte) 0x81, (byte) 128 }; ByteArrayInputStream berInputStream = new ByteArrayInputStream(byteCode); BerLength berLength = new BerLength(); berLength.decode(berInputStream); Assert.assertEquals(128, berLength.val); } | public int decode(InputStream iStream) throws IOException { val = iStream.read(); int length = 1; if ((val & 0x80) != 0) { int lengthLength = val & 0x7f; if (lengthLength == 0) { val = -1; return 1; } if (lengthLength > 4) { throw new IOException("Length is out of bound!"); } val = 0; byte[] byteCode = new byte[lengthL... | BerLength { public int decode(InputStream iStream) throws IOException { val = iStream.read(); int length = 1; if ((val & 0x80) != 0) { int lengthLength = val & 0x7f; if (lengthLength == 0) { val = -1; return 1; } if (lengthLength > 4) { throw new IOException("Length is out of bound!"); } val = 0; byte[] byteCode = new ... | BerLength { public int decode(InputStream iStream) throws IOException { val = iStream.read(); int length = 1; if ((val & 0x80) != 0) { int lengthLength = val & 0x7f; if (lengthLength == 0) { val = -1; return 1; } if (lengthLength > 4) { throw new IOException("Length is out of bound!"); } val = 0; byte[] byteCode = new ... | BerLength { public int decode(InputStream iStream) throws IOException { val = iStream.read(); int length = 1; if ((val & 0x80) != 0) { int lengthLength = val & 0x7f; if (lengthLength == 0) { val = -1; return 1; } if (lengthLength > 4) { throw new IOException("Length is out of bound!"); } val = 0; byte[] byteCode = new ... | BerLength { public int decode(InputStream iStream) throws IOException { val = iStream.read(); int length = 1; if ((val & 0x80) != 0) { int lengthLength = val & 0x7f; if (lengthLength == 0) { val = -1; return 1; } if (lengthLength > 4) { throw new IOException("Length is out of bound!"); } val = 0; byte[] byteCode = new ... |
@Test public void implicitEncoding1() throws IOException { BerByteArrayOutputStream berBAOStream = new BerByteArrayOutputStream(50); IntegerUnivPrim testInteger = new IntegerUnivPrim(51); int length = testInteger.encode(berBAOStream, false); Assert.assertEquals(2, length); byte[] expectedBytes = new byte[] { 0x01, 0x33... | public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1) || val < Mat... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... |
@Test public void implicitEncoding2() throws IOException { BerByteArrayOutputStream berBAOStream = new BerByteArrayOutputStream(50); IntegerUnivPrim testInteger = new IntegerUnivPrim(256); int length = testInteger.encode(berBAOStream, false); Assert.assertEquals(3, length); byte[] expectedBytes = new byte[] { 0x02, 0x0... | public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1) || val < Mat... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... |
@Test public void implicitEncoding3() throws IOException { BerByteArrayOutputStream berBAOStream = new BerByteArrayOutputStream(50); IntegerUnivPrim testInteger = new IntegerUnivPrim(0); int length = testInteger.encode(berBAOStream, false); Assert.assertEquals(2, length); byte[] expectedBytes = new byte[] { 0x01, 0x00 ... | public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1) || val < Mat... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... |
@Test public void implicitEncoding4() throws IOException { BerByteArrayOutputStream berBAOStream = new BerByteArrayOutputStream(50); IntegerUnivPrim testInteger = new IntegerUnivPrim(127); int length = testInteger.encode(berBAOStream, false); Assert.assertEquals(2, length); byte[] expectedBytes = new byte[] { 0x01, 0x7... | public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1) || val < Mat... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... |
@Test public void implicitEncoding5() throws IOException { BerByteArrayOutputStream berBAOStream = new BerByteArrayOutputStream(50); IntegerUnivPrim testInteger = new IntegerUnivPrim(128); int length = testInteger.encode(berBAOStream, false); Assert.assertEquals(3, length); byte[] expectedBytes = new byte[] { 0x02, 0x0... | public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1) || val < Mat... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... |
@Test public void implicitEncoding6() throws IOException { BerByteArrayOutputStream berBAOStream = new BerByteArrayOutputStream(50); IntegerUnivPrim testInteger = new IntegerUnivPrim(-128); int length = testInteger.encode(berBAOStream, false); Assert.assertEquals(2, length); byte[] expectedBytes = new byte[] { 0x01, (b... | public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1) || val < Mat... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... | BerInteger { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { codeLength = 1; while (val > (Math.pow(2, (8 * codeLength) - 1) - 1)... |
@Test public void testMyFilter() { List<Integer> numbers = Arrays.asList(4, 5, 7, 8, 10, 11, 14, 15); List<Integer> result = Functions.myFilter(numbers, item -> item % 2 == 0); assertEquals(Arrays.asList(4, 8, 10, 14), result); } | public static <T> List<T> myFilter(List<T> list, MyPredicate<T> myPredicate) { ArrayList<T> result = new ArrayList<>(); for (T t : list) { if (myPredicate.test(t)) result.add(t); } return result; } | Functions { public static <T> List<T> myFilter(List<T> list, MyPredicate<T> myPredicate) { ArrayList<T> result = new ArrayList<>(); for (T t : list) { if (myPredicate.test(t)) result.add(t); } return result; } } | Functions { public static <T> List<T> myFilter(List<T> list, MyPredicate<T> myPredicate) { ArrayList<T> result = new ArrayList<>(); for (T t : list) { if (myPredicate.test(t)) result.add(t); } return result; } } | Functions { public static <T> List<T> myFilter(List<T> list, MyPredicate<T> myPredicate) { ArrayList<T> result = new ArrayList<>(); for (T t : list) { if (myPredicate.test(t)) result.add(t); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunct... | Functions { public static <T> List<T> myFilter(List<T> list, MyPredicate<T> myPredicate) { ArrayList<T> result = new ArrayList<>(); for (T t : list) { if (myPredicate.test(t)) result.add(t); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunct... |
@Test public void testMyGenerate() { List<LocalDateTime> localDateTimes = Functions.myGenerate(() -> { try { Thread.sleep(1000); } catch (InterruptedException e) { } return LocalDateTime.now(); }, 10); System.out.println(localDateTimes); } | public static <T> List<T> myGenerate(MySupplier<T> supplier, int count) { List<T> result = new ArrayList<>(); for (int i = 0; i < count; i++) { result.add(supplier.get()); } return result; } | Functions { public static <T> List<T> myGenerate(MySupplier<T> supplier, int count) { List<T> result = new ArrayList<>(); for (int i = 0; i < count; i++) { result.add(supplier.get()); } return result; } } | Functions { public static <T> List<T> myGenerate(MySupplier<T> supplier, int count) { List<T> result = new ArrayList<>(); for (int i = 0; i < count; i++) { result.add(supplier.get()); } return result; } } | Functions { public static <T> List<T> myGenerate(MySupplier<T> supplier, int count) { List<T> result = new ArrayList<>(); for (int i = 0; i < count; i++) { result.add(supplier.get()); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T, ... | Functions { public static <T> List<T> myGenerate(MySupplier<T> supplier, int count) { List<T> result = new ArrayList<>(); for (int i = 0; i < count; i++) { result.add(supplier.get()); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T, ... |
@Test public void testClosuresAvoidRepeats() { List<String> names = Arrays.asList("Foo", "Ramen", "Naan", "Ravioli"); System.out.println(Functions.myFilter(names, stringHasSizeOf(4))); System.out.println(Functions.myFilter(names, stringHasSizeOf(2))); } | public static <T> List<T> myFilter(List<T> list, MyPredicate<T> myPredicate) { ArrayList<T> result = new ArrayList<>(); for (T t : list) { if (myPredicate.test(t)) result.add(t); } return result; } | Functions { public static <T> List<T> myFilter(List<T> list, MyPredicate<T> myPredicate) { ArrayList<T> result = new ArrayList<>(); for (T t : list) { if (myPredicate.test(t)) result.add(t); } return result; } } | Functions { public static <T> List<T> myFilter(List<T> list, MyPredicate<T> myPredicate) { ArrayList<T> result = new ArrayList<>(); for (T t : list) { if (myPredicate.test(t)) result.add(t); } return result; } } | Functions { public static <T> List<T> myFilter(List<T> list, MyPredicate<T> myPredicate) { ArrayList<T> result = new ArrayList<>(); for (T t : list) { if (myPredicate.test(t)) result.add(t); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunct... | Functions { public static <T> List<T> myFilter(List<T> list, MyPredicate<T> myPredicate) { ArrayList<T> result = new ArrayList<>(); for (T t : list) { if (myPredicate.test(t)) result.add(t); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunct... |
@Test public void testMyMap() { List<Integer> numbers = Arrays.asList(4, 5, 7, 8); List<Integer> mapped = Functions.myMap(numbers, t -> t + 2); assertEquals(Arrays.asList(6, 7, 9, 10), mapped); } | public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T,... | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T,... |
@Test public void testMyFlatMap() { List<Integer> numbers = Arrays.asList(4, 5, 7, 8); List<Integer> mapped = Functions.myFlatMap(numbers, t -> List.of(t - 1, t, t + 1)); assertEquals(Arrays.asList(3, 4, 5, 4, 5, 6, 6, 7, 8, 7, 8, 9), mapped); } | public static <T, R> List<R> myFlatMap(List<T> list, MyFunction<T, List<R>> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { List<R> application = myFunction.apply(t); result.addAll(application); } return result; } | Functions { public static <T, R> List<R> myFlatMap(List<T> list, MyFunction<T, List<R>> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { List<R> application = myFunction.apply(t); result.addAll(application); } return result; } } | Functions { public static <T, R> List<R> myFlatMap(List<T> list, MyFunction<T, List<R>> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { List<R> application = myFunction.apply(t); result.addAll(application); } return result; } } | Functions { public static <T, R> List<R> myFlatMap(List<T> list, MyFunction<T, List<R>> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { List<R> application = myFunction.apply(t); result.addAll(application); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); ... | Functions { public static <T, R> List<R> myFlatMap(List<T> list, MyFunction<T, List<R>> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { List<R> application = myFunction.apply(t); result.addAll(application); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); ... |
@Test public void testMyForEach() { List<Integer> numbers = Arrays.asList(4, 5, 7, 8); Functions.myForEach(numbers, new MyConsumer<Integer>() { @Override public void accept(Integer x) { System.out.println(x); } }); } | public static <T> void myForEach(List<T> list, MyConsumer<T> myConsumer) { for (T t : list) { myConsumer.accept(t); } } | Functions { public static <T> void myForEach(List<T> list, MyConsumer<T> myConsumer) { for (T t : list) { myConsumer.accept(t); } } } | Functions { public static <T> void myForEach(List<T> list, MyConsumer<T> myConsumer) { for (T t : list) { myConsumer.accept(t); } } } | Functions { public static <T> void myForEach(List<T> list, MyConsumer<T> myConsumer) { for (T t : list) { myConsumer.accept(t); } } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T, R> myFunction); static List<R> myFlatMap(List<T> list, MyFunction<T, Li... | Functions { public static <T> void myForEach(List<T> list, MyConsumer<T> myConsumer) { for (T t : list) { myConsumer.accept(t); } } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T, R> myFunction); static List<R> myFlatMap(List<T> list, MyFunction<T, Li... |
@Test public void testMethodReferenceAStaticMethod() { List<Integer> numbers = Arrays.asList(2, 4, 5, 1, 9, 15, 19, 21, 33, 78, 93, 10); System.out.println(Functions.myMap(numbers, Math::abs)); } | public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T,... | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T,... |
@Test public void testMethodReferenceAContainingType() { List<String> words = Arrays.asList("One", "Two", "Three", "Four"); List<Integer> result = Functions.myMap(words, String::length); System.out.println(result); } | public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T,... | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T,... |
@Test public void testMethodReferenceAContainingTypeTrickQuestion() { List<Integer> numbers = Arrays.asList(2, 4, 5, 1, 9, 15, 19, 21, 33, 78, 93, 10); System.out.println(Functions.myMap(numbers, Object::toString)); } | public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T,... | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T,... |
@Test public void testTwoOrMoreItemsInALambda() { List<Integer> numbers = Arrays.asList(2, 4, 5, 1, 9, 15, 19, 21, 33, 78, 93, 10); System.out.println(Functions.myMap(numbers, x -> { int y = 100; int z = 10; return y + z + x; })); } | public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T,... | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T,... |
@Test public void testMethodReferenceAnInstance() { List<Integer> numbers = Arrays.asList(2, 4, 5, 1, 9, 15, 19, 21, 33, 78, 93, 10); TaxRate taxRate2016 = new TaxRate(2016, .085); System.out.println(Functions.myMap(numbers, taxRate2016::apply)); } | public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T,... | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T,... |
@Test public void testMethodReferenceANewType() { List<Integer> numbers = Arrays.asList(2, 4, 5, 1, 9, 15, 19, 21, 33, 78, 93, 10); System.out.println(Functions.myMap(numbers, Double::new)); } | public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } } | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T,... | Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T,... |
@Test public void joinPath() { assertEquals("http: assertEquals("http: assertEquals("http: assertEquals("http: assertEquals("http: assertEquals("http: } | public static String joinPath(final String firstPath, final String secondPath) { Validate.notEmpty(firstPath); Validate.notEmpty(secondPath); final String tmp1 = firstPath.endsWith("/") ? firstPath.substring(0, firstPath.length() - 1) : firstPath; final String tmp2 = secondPath.startsWith("/") ? (tmp1 + secondPath) : (... | WeChatUtils { public static String joinPath(final String firstPath, final String secondPath) { Validate.notEmpty(firstPath); Validate.notEmpty(secondPath); final String tmp1 = firstPath.endsWith("/") ? firstPath.substring(0, firstPath.length() - 1) : firstPath; final String tmp2 = secondPath.startsWith("/") ? (tmp1 + s... | WeChatUtils { public static String joinPath(final String firstPath, final String secondPath) { Validate.notEmpty(firstPath); Validate.notEmpty(secondPath); final String tmp1 = firstPath.endsWith("/") ? firstPath.substring(0, firstPath.length() - 1) : firstPath; final String tmp2 = secondPath.startsWith("/") ? (tmp1 + s... | WeChatUtils { public static String joinPath(final String firstPath, final String secondPath) { Validate.notEmpty(firstPath); Validate.notEmpty(secondPath); final String tmp1 = firstPath.endsWith("/") ? firstPath.substring(0, firstPath.length() - 1) : firstPath; final String tmp2 = secondPath.startsWith("/") ? (tmp1 + s... | WeChatUtils { public static String joinPath(final String firstPath, final String secondPath) { Validate.notEmpty(firstPath); Validate.notEmpty(secondPath); final String tmp1 = firstPath.endsWith("/") ? firstPath.substring(0, firstPath.length() - 1) : firstPath; final String tmp2 = secondPath.startsWith("/") ? (tmp1 + s... |
@Test public void unifiedOrder() { stubFor(post(urlEqualTo(WeChatPayClient.UNIFIED_ORDER_PATH)) .willReturn(aResponse() .withStatus(200) .withHeader("Content-Type", MediaType.APPLICATION_XML_VALUE) .withBody("<xml><return_code>SUCCESS</return_code><result_code>SUCCESS</result_code></xml>"))); WeChatPayConfigurator.DEFA... | @Override public UnifiedOrderResponse unifiedOrder( final UnifiedOrderRequest request) throws WeChatPayException { Objects.requireNonNull(request); return postForEntity( WeChatPayClient.UNIFIED_ORDER_PATH, request, UnifiedOrderResponse.class) .getBody(); } | WeChatPayRestTemplateClient implements WeChatPayClient { @Override public UnifiedOrderResponse unifiedOrder( final UnifiedOrderRequest request) throws WeChatPayException { Objects.requireNonNull(request); return postForEntity( WeChatPayClient.UNIFIED_ORDER_PATH, request, UnifiedOrderResponse.class) .getBody(); } } | WeChatPayRestTemplateClient implements WeChatPayClient { @Override public UnifiedOrderResponse unifiedOrder( final UnifiedOrderRequest request) throws WeChatPayException { Objects.requireNonNull(request); return postForEntity( WeChatPayClient.UNIFIED_ORDER_PATH, request, UnifiedOrderResponse.class) .getBody(); } WeChat... | WeChatPayRestTemplateClient implements WeChatPayClient { @Override public UnifiedOrderResponse unifiedOrder( final UnifiedOrderRequest request) throws WeChatPayException { Objects.requireNonNull(request); return postForEntity( WeChatPayClient.UNIFIED_ORDER_PATH, request, UnifiedOrderResponse.class) .getBody(); } WeChat... | WeChatPayRestTemplateClient implements WeChatPayClient { @Override public UnifiedOrderResponse unifiedOrder( final UnifiedOrderRequest request) throws WeChatPayException { Objects.requireNonNull(request); return postForEntity( WeChatPayClient.UNIFIED_ORDER_PATH, request, UnifiedOrderResponse.class) .getBody(); } WeChat... |
@Test public void orderQuery() { } | @Override public OrderQueryResponse orderQuery( final OrderQueryRequest request) throws WeChatPayException { Objects.requireNonNull(request); return postForEntity( WeChatPayClient.ORDER_QUERY_PATH, request, OrderQueryResponse.class) .getBody(); } | WeChatPayRestTemplateClient implements WeChatPayClient { @Override public OrderQueryResponse orderQuery( final OrderQueryRequest request) throws WeChatPayException { Objects.requireNonNull(request); return postForEntity( WeChatPayClient.ORDER_QUERY_PATH, request, OrderQueryResponse.class) .getBody(); } } | WeChatPayRestTemplateClient implements WeChatPayClient { @Override public OrderQueryResponse orderQuery( final OrderQueryRequest request) throws WeChatPayException { Objects.requireNonNull(request); return postForEntity( WeChatPayClient.ORDER_QUERY_PATH, request, OrderQueryResponse.class) .getBody(); } WeChatPayRestTem... | WeChatPayRestTemplateClient implements WeChatPayClient { @Override public OrderQueryResponse orderQuery( final OrderQueryRequest request) throws WeChatPayException { Objects.requireNonNull(request); return postForEntity( WeChatPayClient.ORDER_QUERY_PATH, request, OrderQueryResponse.class) .getBody(); } WeChatPayRestTem... | WeChatPayRestTemplateClient implements WeChatPayClient { @Override public OrderQueryResponse orderQuery( final OrderQueryRequest request) throws WeChatPayException { Objects.requireNonNull(request); return postForEntity( WeChatPayClient.ORDER_QUERY_PATH, request, OrderQueryResponse.class) .getBody(); } WeChatPayRestTem... |
@Test public void authorizeCode() throws Exception { final WeChatMpAccessTokenResponse accessTokenResponse = new WeChatMpAccessTokenResponse(); accessTokenResponse.setErrCode("0"); given(this.weChatMpClient.accessToken("code")).willReturn(accessTokenResponse); this.mvc.perform(get(WeChatMpProperties.AUTHORIZE_CODE_PATH... | @GetMapping(path = "${wechat.mp.authorize-code-path:" + WeChatMpProperties.AUTHORIZE_CODE_PATH + '}') public void authorizeCode( @RequestParam("code") final String code) { final WeChatMpAccessTokenResponse accessTokenResponse = this.weChatMpClient.accessToken(code); if (accessTokenResponse.isSuccessful()) { this.publis... | WeChatMpController { @GetMapping(path = "${wechat.mp.authorize-code-path:" + WeChatMpProperties.AUTHORIZE_CODE_PATH + '}') public void authorizeCode( @RequestParam("code") final String code) { final WeChatMpAccessTokenResponse accessTokenResponse = this.weChatMpClient.accessToken(code); if (accessTokenResponse.isSucces... | WeChatMpController { @GetMapping(path = "${wechat.mp.authorize-code-path:" + WeChatMpProperties.AUTHORIZE_CODE_PATH + '}') public void authorizeCode( @RequestParam("code") final String code) { final WeChatMpAccessTokenResponse accessTokenResponse = this.weChatMpClient.accessToken(code); if (accessTokenResponse.isSucces... | WeChatMpController { @GetMapping(path = "${wechat.mp.authorize-code-path:" + WeChatMpProperties.AUTHORIZE_CODE_PATH + '}') public void authorizeCode( @RequestParam("code") final String code) { final WeChatMpAccessTokenResponse accessTokenResponse = this.weChatMpClient.accessToken(code); if (accessTokenResponse.isSucces... | WeChatMpController { @GetMapping(path = "${wechat.mp.authorize-code-path:" + WeChatMpProperties.AUTHORIZE_CODE_PATH + '}') public void authorizeCode( @RequestParam("code") final String code) { final WeChatMpAccessTokenResponse accessTokenResponse = this.weChatMpClient.accessToken(code); if (accessTokenResponse.isSucces... |
@Test public void weChatMpController() throws Exception { ClassPool.getDefault().makeClass("cn.javaer.wechat.spring.boot.starter.mp.ConditionalOnClassTrigger").toClass(); try (AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext()) { context.register(WeChatMpAutoConfiguration.class)... | @Bean @ConditionalOnMissingBean public WeChatMpController weChatMpController(final WeChatMpClient weChatMpClient, final ApplicationEventPublisher publisher) { return new WeChatMpController(this.weChatMpProperties, weChatMpClient, publisher); } | WeChatMpAutoConfiguration { @Bean @ConditionalOnMissingBean public WeChatMpController weChatMpController(final WeChatMpClient weChatMpClient, final ApplicationEventPublisher publisher) { return new WeChatMpController(this.weChatMpProperties, weChatMpClient, publisher); } } | WeChatMpAutoConfiguration { @Bean @ConditionalOnMissingBean public WeChatMpController weChatMpController(final WeChatMpClient weChatMpClient, final ApplicationEventPublisher publisher) { return new WeChatMpController(this.weChatMpProperties, weChatMpClient, publisher); } WeChatMpAutoConfiguration(final WeChatMpProperti... | WeChatMpAutoConfiguration { @Bean @ConditionalOnMissingBean public WeChatMpController weChatMpController(final WeChatMpClient weChatMpClient, final ApplicationEventPublisher publisher) { return new WeChatMpController(this.weChatMpProperties, weChatMpClient, publisher); } WeChatMpAutoConfiguration(final WeChatMpProperti... | WeChatMpAutoConfiguration { @Bean @ConditionalOnMissingBean public WeChatMpController weChatMpController(final WeChatMpClient weChatMpClient, final ApplicationEventPublisher publisher) { return new WeChatMpController(this.weChatMpProperties, weChatMpClient, publisher); } WeChatMpAutoConfiguration(final WeChatMpProperti... |
@Test public void sign() { final UnifiedOrderResponse response = new UnifiedOrderResponse(); response.setReturnCode("SUCCESS"); response.setReturnMsg("OK"); response.setAppid("wx2421b1c4370ec43b"); response.setMchId("10000100"); response.setNonceStr("IITRi8Iabbblz1Jc"); response.setResultCode("SUCCESS"); response.setPr... | @NotNull public static String generateSign( @NotNull final BasePayRequest request, @NotNull final String mchKey) { return generateSign(signParamsFrom(request), mchKey); } | WeChatPayUtils { @NotNull public static String generateSign( @NotNull final BasePayRequest request, @NotNull final String mchKey) { return generateSign(signParamsFrom(request), mchKey); } } | WeChatPayUtils { @NotNull public static String generateSign( @NotNull final BasePayRequest request, @NotNull final String mchKey) { return generateSign(signParamsFrom(request), mchKey); } } | WeChatPayUtils { @NotNull public static String generateSign( @NotNull final BasePayRequest request, @NotNull final String mchKey) { return generateSign(signParamsFrom(request), mchKey); } @NotNull static String generateSign(
@NotNull final BasePayRequest request, @NotNull final String mchKey); @NotNull sta... | WeChatPayUtils { @NotNull public static String generateSign( @NotNull final BasePayRequest request, @NotNull final String mchKey) { return generateSign(signParamsFrom(request), mchKey); } @NotNull static String generateSign(
@NotNull final BasePayRequest request, @NotNull final String mchKey); @NotNull sta... |
@Test public void sign4Cache() throws Exception { final UnifiedOrderResponse response = new UnifiedOrderResponse(); response.setReturnCode("SUCCESS"); response.setReturnMsg("OK"); response.setAppid("wx2421b1c4370ec43b"); response.setMchId("10000100"); response.setNonceStr("IITRi8Iabbblz1Jc"); response.setResultCode("SU... | @NotNull public static String generateSign( @NotNull final BasePayRequest request, @NotNull final String mchKey) { return generateSign(signParamsFrom(request), mchKey); } | WeChatPayUtils { @NotNull public static String generateSign( @NotNull final BasePayRequest request, @NotNull final String mchKey) { return generateSign(signParamsFrom(request), mchKey); } } | WeChatPayUtils { @NotNull public static String generateSign( @NotNull final BasePayRequest request, @NotNull final String mchKey) { return generateSign(signParamsFrom(request), mchKey); } } | WeChatPayUtils { @NotNull public static String generateSign( @NotNull final BasePayRequest request, @NotNull final String mchKey) { return generateSign(signParamsFrom(request), mchKey); } @NotNull static String generateSign(
@NotNull final BasePayRequest request, @NotNull final String mchKey); @NotNull sta... | WeChatPayUtils { @NotNull public static String generateSign( @NotNull final BasePayRequest request, @NotNull final String mchKey) { return generateSign(signParamsFrom(request), mchKey); } @NotNull static String generateSign(
@NotNull final BasePayRequest request, @NotNull final String mchKey); @NotNull sta... |
@Test public void beansMapFrom() { final SortedMap<String, String> params = new TreeMap<>(); params.put("coupon_refund_id_0", "BC884153761883FE608EA956BD05A6F5"); params.put("coupon_type_0", "CASH"); params.put("coupon_refund_fee_0", "100"); params.put("coupon_refund_id_1", "16BE80B8FD1044069950ADAEDEB812C5"); params.p... | public static <T> Map<String, T> beansMapFrom( @NotNull final SortedMap<String, String> params, @NotNull final Map<String, BiConsumer<String, T>> mapping, @NotNull final Supplier<T> newT) { final Map<String, T> rtMap = new HashMap<>(); for (final Map.Entry<String, String> entry : params.entrySet()) { final String key =... | WeChatPayUtils { public static <T> Map<String, T> beansMapFrom( @NotNull final SortedMap<String, String> params, @NotNull final Map<String, BiConsumer<String, T>> mapping, @NotNull final Supplier<T> newT) { final Map<String, T> rtMap = new HashMap<>(); for (final Map.Entry<String, String> entry : params.entrySet()) { f... | WeChatPayUtils { public static <T> Map<String, T> beansMapFrom( @NotNull final SortedMap<String, String> params, @NotNull final Map<String, BiConsumer<String, T>> mapping, @NotNull final Supplier<T> newT) { final Map<String, T> rtMap = new HashMap<>(); for (final Map.Entry<String, String> entry : params.entrySet()) { f... | WeChatPayUtils { public static <T> Map<String, T> beansMapFrom( @NotNull final SortedMap<String, String> params, @NotNull final Map<String, BiConsumer<String, T>> mapping, @NotNull final Supplier<T> newT) { final Map<String, T> rtMap = new HashMap<>(); for (final Map.Entry<String, String> entry : params.entrySet()) { f... | WeChatPayUtils { public static <T> Map<String, T> beansMapFrom( @NotNull final SortedMap<String, String> params, @NotNull final Map<String, BiConsumer<String, T>> mapping, @NotNull final Supplier<T> newT) { final Map<String, T> rtMap = new HashMap<>(); for (final Map.Entry<String, String> entry : params.entrySet()) { f... |
@Test public void testParse() { final String xml = WeChatTestUtils.readClassPathFileToUTFString("/WeChatPayNotifyResult.xml", this.getClass()); final NotifyResult notifyResult = WeChatTestUtils.jaxbUnmarshal(xml, NotifyResult.class); assertThat(notifyResult) .hasAppid("wx2421b1c4370ec43b") .hasAttach("支付测试") .hasBankTy... | @Override public void beforeSign() { if (null == this.coupons && null != this.otherParams) { this.coupons = WeChatPayUtils.couponsFrom(this.otherParams); } } | NotifyResult extends BasePayResponse { @Override public void beforeSign() { if (null == this.coupons && null != this.otherParams) { this.coupons = WeChatPayUtils.couponsFrom(this.otherParams); } } } | NotifyResult extends BasePayResponse { @Override public void beforeSign() { if (null == this.coupons && null != this.otherParams) { this.coupons = WeChatPayUtils.couponsFrom(this.otherParams); } } } | NotifyResult extends BasePayResponse { @Override public void beforeSign() { if (null == this.coupons && null != this.otherParams) { this.coupons = WeChatPayUtils.couponsFrom(this.otherParams); } } @Override void beforeSign(); } | NotifyResult extends BasePayResponse { @Override public void beforeSign() { if (null == this.coupons && null != this.otherParams) { this.coupons = WeChatPayUtils.couponsFrom(this.otherParams); } } @Override void beforeSign(); } |
@Test public void beforeSign() { final String xmlStr = WeChatTestUtils.readClassPathFileToUTFString("/WeChatPayRefundQueryResponse.xml", this.getClass()); final RefundQueryResponse response = WeChatTestUtils.jaxbUnmarshal(xmlStr, RefundQueryResponse.class); assertThat(response) .hasReturnCode("SUCCESS") .hasResultCode(... | @Override public void beforeSign() { if (null == this.refunds && null != this.otherParams) { final Map<String, Refund> refundsMap = WeChatPayUtils.beansMapFrom(this.otherParams, createRefundMapping(), Refund::new); initCoupons(refundsMap); this.refunds = new ArrayList<>(refundsMap.values()); } } | RefundQueryResponse extends BasePayResponse { @Override public void beforeSign() { if (null == this.refunds && null != this.otherParams) { final Map<String, Refund> refundsMap = WeChatPayUtils.beansMapFrom(this.otherParams, createRefundMapping(), Refund::new); initCoupons(refundsMap); this.refunds = new ArrayList<>(ref... | RefundQueryResponse extends BasePayResponse { @Override public void beforeSign() { if (null == this.refunds && null != this.otherParams) { final Map<String, Refund> refundsMap = WeChatPayUtils.beansMapFrom(this.otherParams, createRefundMapping(), Refund::new); initCoupons(refundsMap); this.refunds = new ArrayList<>(ref... | RefundQueryResponse extends BasePayResponse { @Override public void beforeSign() { if (null == this.refunds && null != this.otherParams) { final Map<String, Refund> refundsMap = WeChatPayUtils.beansMapFrom(this.otherParams, createRefundMapping(), Refund::new); initCoupons(refundsMap); this.refunds = new ArrayList<>(ref... | RefundQueryResponse extends BasePayResponse { @Override public void beforeSign() { if (null == this.refunds && null != this.otherParams) { final Map<String, Refund> refundsMap = WeChatPayUtils.beansMapFrom(this.otherParams, createRefundMapping(), Refund::new); initCoupons(refundsMap); this.refunds = new ArrayList<>(ref... |
@Test public void setOtherProperties() throws Exception { final ObjectMapper mapper = new ObjectMapper(); final Demo demo = mapper.readValue("{\"errcode\":\"d1\",\"any1\":\"any1\",\"any2\":\"any2\"}", Demo.class); Assert.assertEquals("d1", demo.getErrCode()); Assert.assertEquals("any1", demo.getOtherProperties().get("a... | @JsonAnySetter protected void setOtherProperties(final String name, final String value) { this.otherProperties.put(name, value); } | WeChatMpResponse { @JsonAnySetter protected void setOtherProperties(final String name, final String value) { this.otherProperties.put(name, value); } } | WeChatMpResponse { @JsonAnySetter protected void setOtherProperties(final String name, final String value) { this.otherProperties.put(name, value); } } | WeChatMpResponse { @JsonAnySetter protected void setOtherProperties(final String name, final String value) { this.otherProperties.put(name, value); } boolean isSuccessful(); } | WeChatMpResponse { @JsonAnySetter protected void setOtherProperties(final String name, final String value) { this.otherProperties.put(name, value); } boolean isSuccessful(); } |
@Test public void generateAuthorizeUrl() { final String authorizeUrl = WeChatMpUtils.generateAuthorizeUrl( "wx520c15f417810387", "https: AuthorizeScope.BASE, "123"); final String expected = "https: assertEquals(expected, authorizeUrl); } | public static String generateAuthorizeUrl( @NotNull final String appId, @NotNull final String redirectUri, @NotNull final AuthorizeScope scope, @NotNull final String state) { return "https: + "&redirect_uri=" + WeChatUtils.urlEncode(redirectUri) + "&response_type=code&scope=" + scope.getScope() + "&state=" + state + "#... | WeChatMpUtils { public static String generateAuthorizeUrl( @NotNull final String appId, @NotNull final String redirectUri, @NotNull final AuthorizeScope scope, @NotNull final String state) { return "https: + "&redirect_uri=" + WeChatUtils.urlEncode(redirectUri) + "&response_type=code&scope=" + scope.getScope() + "&stat... | WeChatMpUtils { public static String generateAuthorizeUrl( @NotNull final String appId, @NotNull final String redirectUri, @NotNull final AuthorizeScope scope, @NotNull final String state) { return "https: + "&redirect_uri=" + WeChatUtils.urlEncode(redirectUri) + "&response_type=code&scope=" + scope.getScope() + "&stat... | WeChatMpUtils { public static String generateAuthorizeUrl( @NotNull final String appId, @NotNull final String redirectUri, @NotNull final AuthorizeScope scope, @NotNull final String state) { return "https: + "&redirect_uri=" + WeChatUtils.urlEncode(redirectUri) + "&response_type=code&scope=" + scope.getScope() + "&stat... | WeChatMpUtils { public static String generateAuthorizeUrl( @NotNull final String appId, @NotNull final String redirectUri, @NotNull final AuthorizeScope scope, @NotNull final String state) { return "https: + "&redirect_uri=" + WeChatUtils.urlEncode(redirectUri) + "&response_type=code&scope=" + scope.getScope() + "&stat... |
@Test public void generateAuthorizeUrlNoState() { final String authorizeUrl = WeChatMpUtils.generateAuthorizeUrl("wx520c15f417810387", "https: AuthorizeScope.BASE); final String expected = "https: assertEquals(expected, authorizeUrl); } | public static String generateAuthorizeUrl( @NotNull final String appId, @NotNull final String redirectUri, @NotNull final AuthorizeScope scope, @NotNull final String state) { return "https: + "&redirect_uri=" + WeChatUtils.urlEncode(redirectUri) + "&response_type=code&scope=" + scope.getScope() + "&state=" + state + "#... | WeChatMpUtils { public static String generateAuthorizeUrl( @NotNull final String appId, @NotNull final String redirectUri, @NotNull final AuthorizeScope scope, @NotNull final String state) { return "https: + "&redirect_uri=" + WeChatUtils.urlEncode(redirectUri) + "&response_type=code&scope=" + scope.getScope() + "&stat... | WeChatMpUtils { public static String generateAuthorizeUrl( @NotNull final String appId, @NotNull final String redirectUri, @NotNull final AuthorizeScope scope, @NotNull final String state) { return "https: + "&redirect_uri=" + WeChatUtils.urlEncode(redirectUri) + "&response_type=code&scope=" + scope.getScope() + "&stat... | WeChatMpUtils { public static String generateAuthorizeUrl( @NotNull final String appId, @NotNull final String redirectUri, @NotNull final AuthorizeScope scope, @NotNull final String state) { return "https: + "&redirect_uri=" + WeChatUtils.urlEncode(redirectUri) + "&response_type=code&scope=" + scope.getScope() + "&stat... | WeChatMpUtils { public static String generateAuthorizeUrl( @NotNull final String appId, @NotNull final String redirectUri, @NotNull final AuthorizeScope scope, @NotNull final String state) { return "https: + "&redirect_uri=" + WeChatUtils.urlEncode(redirectUri) + "&response_type=code&scope=" + scope.getScope() + "&stat... |
@Test public void weChatPayClient() throws Exception { ClassPool.getDefault().makeClass("cn.javaer.wechat.spring.boot.starter.pay.ConditionalOnClassTrigger").toClass(); try (AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext()) { context.register(WeChatPayAutoConfiguration.class);... | @Bean @ConditionalOnMissingBean public WeChatPayClient weChatPayClient( @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") @Autowired(required = false) RestTemplate restTemplate) { if (null == restTemplate) { restTemplate = new RestTemplate(); } return new WeChatPayRestTemplateClient(restTemplate, this.... | WeChatPayAutoConfiguration { @Bean @ConditionalOnMissingBean public WeChatPayClient weChatPayClient( @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") @Autowired(required = false) RestTemplate restTemplate) { if (null == restTemplate) { restTemplate = new RestTemplate(); } return new WeChatPayRestTempl... | WeChatPayAutoConfiguration { @Bean @ConditionalOnMissingBean public WeChatPayClient weChatPayClient( @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") @Autowired(required = false) RestTemplate restTemplate) { if (null == restTemplate) { restTemplate = new RestTemplate(); } return new WeChatPayRestTempl... | WeChatPayAutoConfiguration { @Bean @ConditionalOnMissingBean public WeChatPayClient weChatPayClient( @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") @Autowired(required = false) RestTemplate restTemplate) { if (null == restTemplate) { restTemplate = new RestTemplate(); } return new WeChatPayRestTempl... | WeChatPayAutoConfiguration { @Bean @ConditionalOnMissingBean public WeChatPayClient weChatPayClient( @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") @Autowired(required = false) RestTemplate restTemplate) { if (null == restTemplate) { restTemplate = new RestTemplate(); } return new WeChatPayRestTempl... |
@Test public void encodeLength() throws IOException { ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(50); int codedLength = BerLength.encodeLength(os, 128); assertEquals(2, codedLength); byte[] expectedBytes = new byte[] {(byte) 0x81, (byte) 128}; assertArrayEquals(expectedBytes, os.getArray()); } | public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS.write(length >> 8); reverseOS.write... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... |
@Test public void implicitEncoding5() throws IOException { ReverseByteArrayOutputStream berBAOStream = new ReverseByteArrayOutputStream(50); IntegerUnivPrim testInteger = new IntegerUnivPrim(BigInteger.valueOf(128)); int length = testInteger.encode(berBAOStream, false); assertEquals(3, length); byte[] expectedBytes = n... | @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... |
@Test public void implicitEncoding6() throws IOException { ReverseByteArrayOutputStream berBAOStream = new ReverseByteArrayOutputStream(50); IntegerUnivPrim testInteger = new IntegerUnivPrim(BigInteger.valueOf(-128)); int length = testInteger.encode(berBAOStream, false); assertEquals(2, length); byte[] expectedBytes = ... | @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... |
@Test public void implicitEncoding7() throws IOException { ReverseByteArrayOutputStream berBAOStream = new ReverseByteArrayOutputStream(50); IntegerUnivPrim testInteger = new IntegerUnivPrim(BigInteger.valueOf(-129)); int length = testInteger.encode(berBAOStream, false); assertEquals(3, length); byte[] expectedBytes = ... | @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... |
@Test public void explicitEncoding() throws IOException { ReverseByteArrayOutputStream berStream = new ReverseByteArrayOutputStream(50); BerInteger testInteger = new BerInteger(BigInteger.valueOf(51)); int length = testInteger.encode(berStream, true); assertEquals(3, length); byte[] expectedBytes = new byte[] {0x02, 0x... | @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... |
@Test public void explicitEncoding2() throws IOException { ReverseByteArrayOutputStream berStream = new ReverseByteArrayOutputStream(50); BerInteger testInteger = new BerInteger(BigInteger.valueOf(5555)); int length = testInteger.encode(berStream, true); assertEquals(4, length); byte[] expectedBytes = new byte[] {0x02,... | @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... |
@Test public void explicitEncoding() throws IOException { ReverseByteArrayOutputStream berStream = new ReverseByteArrayOutputStream(50); byte[] byteArray = new byte[] {0x01, 0x02, 0x03}; BerOctetString asn1OctetString = new BerOctetString(byteArray); int length = asn1OctetString.encode(berStream, true); assertEquals(5,... | @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } | BerOctetString implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } } | BerOctetString implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerOctetString(); BerOctetString(byte[] value); } | BerOctetString implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerOctetString(); BerOctetString(byte[] value); @Override int encode(OutputStream reverseOS); int encode(OutputStream reverseOS, boolean withTag); @Override int d... | BerOctetString implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerOctetString(); BerOctetString(byte[] value); @Override int encode(OutputStream reverseOS); int encode(OutputStream reverseOS, boolean withTag); @Override int d... |
@Test public void explicitDecoding() throws IOException { byte[] byteCode = new byte[] {0x04, 0x00}; ByteArrayInputStream berInputStream = new ByteArrayInputStream(byteCode); BerOctetString asn1OctetString = new BerOctetString(); asn1OctetString.decode(berInputStream, true); assertEquals(0, asn1OctetString.value.length... | @Override public int decode(InputStream is) throws IOException { return decode(is, true); } | BerOctetString implements Serializable, BerType { @Override public int decode(InputStream is) throws IOException { return decode(is, true); } } | BerOctetString implements Serializable, BerType { @Override public int decode(InputStream is) throws IOException { return decode(is, true); } BerOctetString(); BerOctetString(byte[] value); } | BerOctetString implements Serializable, BerType { @Override public int decode(InputStream is) throws IOException { return decode(is, true); } BerOctetString(); BerOctetString(byte[] value); @Override int encode(OutputStream reverseOS); int encode(OutputStream reverseOS, boolean withTag); @Override int decode(InputStre... | BerOctetString implements Serializable, BerType { @Override public int decode(InputStream is) throws IOException { return decode(is, true); } BerOctetString(); BerOctetString(byte[] value); @Override int encode(OutputStream reverseOS); int encode(OutputStream reverseOS, boolean withTag); @Override int decode(InputStre... |
@Test public void toStringTest() { BerOctetString octetString = new BerOctetString(new byte[] {1, 2, (byte) 0xa0}); assertEquals("0102A0", octetString.toString()); } | @Override public String toString() { return HexString.fromBytes(value); } | BerOctetString implements Serializable, BerType { @Override public String toString() { return HexString.fromBytes(value); } } | BerOctetString implements Serializable, BerType { @Override public String toString() { return HexString.fromBytes(value); } BerOctetString(); BerOctetString(byte[] value); } | BerOctetString implements Serializable, BerType { @Override public String toString() { return HexString.fromBytes(value); } BerOctetString(); BerOctetString(byte[] value); @Override int encode(OutputStream reverseOS); int encode(OutputStream reverseOS, boolean withTag); @Override int decode(InputStream is); int decode... | BerOctetString implements Serializable, BerType { @Override public String toString() { return HexString.fromBytes(value); } BerOctetString(); BerOctetString(byte[] value); @Override int encode(OutputStream reverseOS); int encode(OutputStream reverseOS, boolean withTag); @Override int decode(InputStream is); int decode... |
@Test public void explicitEncoding() throws IOException { ReverseByteArrayOutputStream berBAOStream = new ReverseByteArrayOutputStream(50); BerObjectIdentifier oi = new BerObjectIdentifier(objectIdentifierComponents); int length = oi.encode(berBAOStream, true); assertEquals(7, length); assertArrayEquals(expectedBytes, ... | @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } | BerObjectIdentifier implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } } | BerObjectIdentifier implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerObjectIdentifier(); BerObjectIdentifier(byte[] code); BerObjectIdentifier(int[] value); } | BerObjectIdentifier implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerObjectIdentifier(); BerObjectIdentifier(byte[] code); BerObjectIdentifier(int[] value); @Override int encode(OutputStream reverseOS); int encode(OutputSt... | BerObjectIdentifier implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerObjectIdentifier(); BerObjectIdentifier(byte[] code); BerObjectIdentifier(int[] value); @Override int encode(OutputStream reverseOS); int encode(OutputSt... |
@Test public void explicitDecoding() throws IOException { ByteArrayInputStream berInputStream = new ByteArrayInputStream(expectedBytes); BerObjectIdentifier oi = new BerObjectIdentifier(); oi.decode(berInputStream, true); assertArrayEquals(objectIdentifierComponents, oi.value); ByteArrayInputStream berInputStream2 = ne... | @Override public int decode(InputStream is) throws IOException { return decode(is, true); } | BerObjectIdentifier implements Serializable, BerType { @Override public int decode(InputStream is) throws IOException { return decode(is, true); } } | BerObjectIdentifier implements Serializable, BerType { @Override public int decode(InputStream is) throws IOException { return decode(is, true); } BerObjectIdentifier(); BerObjectIdentifier(byte[] code); BerObjectIdentifier(int[] value); } | BerObjectIdentifier implements Serializable, BerType { @Override public int decode(InputStream is) throws IOException { return decode(is, true); } BerObjectIdentifier(); BerObjectIdentifier(byte[] code); BerObjectIdentifier(int[] value); @Override int encode(OutputStream reverseOS); int encode(OutputStream reverseOS,... | BerObjectIdentifier implements Serializable, BerType { @Override public int decode(InputStream is) throws IOException { return decode(is, true); } BerObjectIdentifier(); BerObjectIdentifier(byte[] code); BerObjectIdentifier(int[] value); @Override int encode(OutputStream reverseOS); int encode(OutputStream reverseOS,... |
@Test public void encodeLength2() throws IOException { ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(50); int codedLength = BerLength.encodeLength(os, 128); assertEquals(2, codedLength); byte[] expectedBytes = new byte[] {(byte) 0x81, (byte) 128}; assertArrayEquals(expectedBytes, os.getArray()); } | public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS.write(length >> 8); reverseOS.write... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... |
@Test public void explicitEncoding() throws IOException { ReverseByteArrayOutputStream berStream = new ReverseByteArrayOutputStream(50); byte[] byteArray = new byte[] {0x01, 0x02, 0x03}; BerGeneralizedTime berGeneralizedTime = new BerGeneralizedTime(byteArray); int length = berGeneralizedTime.encode(berStream, true); a... | @Override public int encode(OutputStream reverseOS, boolean withTag) throws IOException { int codeLength = super.encode(reverseOS, false); if (withTag) { codeLength += tag.encode(reverseOS); } return codeLength; } | BerGeneralizedTime extends BerVisibleString { @Override public int encode(OutputStream reverseOS, boolean withTag) throws IOException { int codeLength = super.encode(reverseOS, false); if (withTag) { codeLength += tag.encode(reverseOS); } return codeLength; } } | BerGeneralizedTime extends BerVisibleString { @Override public int encode(OutputStream reverseOS, boolean withTag) throws IOException { int codeLength = super.encode(reverseOS, false); if (withTag) { codeLength += tag.encode(reverseOS); } return codeLength; } BerGeneralizedTime(); BerGeneralizedTime(byte[] value); Be... | BerGeneralizedTime extends BerVisibleString { @Override public int encode(OutputStream reverseOS, boolean withTag) throws IOException { int codeLength = super.encode(reverseOS, false); if (withTag) { codeLength += tag.encode(reverseOS); } return codeLength; } BerGeneralizedTime(); BerGeneralizedTime(byte[] value); Be... | BerGeneralizedTime extends BerVisibleString { @Override public int encode(OutputStream reverseOS, boolean withTag) throws IOException { int codeLength = super.encode(reverseOS, false); if (withTag) { codeLength += tag.encode(reverseOS); } return codeLength; } BerGeneralizedTime(); BerGeneralizedTime(byte[] value); Be... |
@Test public void toStringTest() { BerBitString bitString = new BerBitString(new byte[] {1, 2, 7}, 23); assertEquals("00000001000000100000011", bitString.toString()); } | @Override public String toString() { StringBuilder sb = new StringBuilder(); for (boolean bit : getValueAsBooleans()) { if (bit) { sb.append('1'); } else { sb.append('0'); } } return sb.toString(); } | BerBitString implements Serializable, BerType { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (boolean bit : getValueAsBooleans()) { if (bit) { sb.append('1'); } else { sb.append('0'); } } return sb.toString(); } } | BerBitString implements Serializable, BerType { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (boolean bit : getValueAsBooleans()) { if (bit) { sb.append('1'); } else { sb.append('0'); } } return sb.toString(); } BerBitString(); BerBitString(byte[] value, int numBits); BerBitString(... | BerBitString implements Serializable, BerType { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (boolean bit : getValueAsBooleans()) { if (bit) { sb.append('1'); } else { sb.append('0'); } } return sb.toString(); } BerBitString(); BerBitString(byte[] value, int numBits); BerBitString(... | BerBitString implements Serializable, BerType { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (boolean bit : getValueAsBooleans()) { if (bit) { sb.append('1'); } else { sb.append('0'); } } return sb.toString(); } BerBitString(); BerBitString(byte[] value, int numBits); BerBitString(... |
@Test public void toString2Test() { BerBitString bitString = new BerBitString( new boolean[] { false, false, false, false, false, false, false, true, false, false, false, false, false, false, true, false, false, false, false, false, false, true, true }); assertEquals("00000001000000100000011", bitString.toString()); } | @Override public String toString() { StringBuilder sb = new StringBuilder(); for (boolean bit : getValueAsBooleans()) { if (bit) { sb.append('1'); } else { sb.append('0'); } } return sb.toString(); } | BerBitString implements Serializable, BerType { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (boolean bit : getValueAsBooleans()) { if (bit) { sb.append('1'); } else { sb.append('0'); } } return sb.toString(); } } | BerBitString implements Serializable, BerType { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (boolean bit : getValueAsBooleans()) { if (bit) { sb.append('1'); } else { sb.append('0'); } } return sb.toString(); } BerBitString(); BerBitString(byte[] value, int numBits); BerBitString(... | BerBitString implements Serializable, BerType { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (boolean bit : getValueAsBooleans()) { if (bit) { sb.append('1'); } else { sb.append('0'); } } return sb.toString(); } BerBitString(); BerBitString(byte[] value, int numBits); BerBitString(... | BerBitString implements Serializable, BerType { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (boolean bit : getValueAsBooleans()) { if (bit) { sb.append('1'); } else { sb.append('0'); } } return sb.toString(); } BerBitString(); BerBitString(byte[] value, int numBits); BerBitString(... |
@Test public void encodeLength3() throws IOException { ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(50); int codedLength = BerLength.encodeLength(os, 65536); assertEquals(4, codedLength); byte[] expectedBytes = new byte[] {(byte) 0x83, 1, 0, 0}; assertArrayEquals(expectedBytes, os.getArray()); } | public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS.write(length >> 8); reverseOS.write... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... |
@Test public void encodeLength4() throws IOException { ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(50); int codedLength = BerLength.encodeLength(os, 256); assertEquals(3, codedLength); byte[] expectedBytes = new byte[] {(byte) 0x82, 1, 0}; assertArrayEquals(expectedBytes, os.getArray()); } | public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS.write(length >> 8); reverseOS.write... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... |
@Test public void encodeLength5() throws IOException { ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(50); int codedLength = BerLength.encodeLength(os, 16777216); assertEquals(5, codedLength); byte[] expectedBytes = new byte[] {(byte) 0x84, 1, 0, 0, 0}; assertArrayEquals(expectedBytes, os.getArray()... | public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS.write(length >> 8); reverseOS.write... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... | BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(length); reverseOS... |
@Test public void explicitDecoding() throws IOException { byte[] byteCode = new byte[] {(byte) 0x81, (byte) 128}; ByteArrayInputStream berInputStream = new ByteArrayInputStream(byteCode); BerLength berLength = new BerLength(); berLength.decode(berInputStream); assertEquals(128, berLength.val); } | public int decode(InputStream is) throws IOException { val = is.read(); if (val < 128) { if (val == -1) { throw new EOFException("Unexpected end of input stream."); } return 1; } int lengthLength = val & 0x7f; if (lengthLength == 0) { val = -1; return 1; } if (lengthLength > 4) { throw new IOException("Length is out of... | BerLength implements Serializable { public int decode(InputStream is) throws IOException { val = is.read(); if (val < 128) { if (val == -1) { throw new EOFException("Unexpected end of input stream."); } return 1; } int lengthLength = val & 0x7f; if (lengthLength == 0) { val = -1; return 1; } if (lengthLength > 4) { thr... | BerLength implements Serializable { public int decode(InputStream is) throws IOException { val = is.read(); if (val < 128) { if (val == -1) { throw new EOFException("Unexpected end of input stream."); } return 1; } int lengthLength = val & 0x7f; if (lengthLength == 0) { val = -1; return 1; } if (lengthLength > 4) { thr... | BerLength implements Serializable { public int decode(InputStream is) throws IOException { val = is.read(); if (val < 128) { if (val == -1) { throw new EOFException("Unexpected end of input stream."); } return 1; } int lengthLength = val & 0x7f; if (lengthLength == 0) { val = -1; return 1; } if (lengthLength > 4) { thr... | BerLength implements Serializable { public int decode(InputStream is) throws IOException { val = is.read(); if (val < 128) { if (val == -1) { throw new EOFException("Unexpected end of input stream."); } return 1; } int lengthLength = val & 0x7f; if (lengthLength == 0) { val = -1; return 1; } if (lengthLength > 4) { thr... |
@Test public void implicitEncoding1() throws IOException { ReverseByteArrayOutputStream berBAOStream = new ReverseByteArrayOutputStream(50); IntegerUnivPrim testInteger = new IntegerUnivPrim(BigInteger.valueOf(51)); int length = testInteger.encode(berBAOStream, false); assertEquals(2, length); byte[] expectedBytes = ne... | @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... |
@Test public void implicitEncoding2() throws IOException { ReverseByteArrayOutputStream berBAOStream = new ReverseByteArrayOutputStream(50); IntegerUnivPrim testInteger = new IntegerUnivPrim(BigInteger.valueOf(256)); int length = testInteger.encode(berBAOStream, false); assertEquals(3, length); byte[] expectedBytes = n... | @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... |
@Test public void implicitEncoding3() throws IOException { ReverseByteArrayOutputStream berBAOStream = new ReverseByteArrayOutputStream(50); IntegerUnivPrim testInteger = new IntegerUnivPrim(BigInteger.valueOf(0)); int length = testInteger.encode(berBAOStream, false); assertEquals(2, length); byte[] expectedBytes = new... | @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... |
@Test public void implicitEncoding4() throws IOException { ReverseByteArrayOutputStream berBAOStream = new ReverseByteArrayOutputStream(50); IntegerUnivPrim testInteger = new IntegerUnivPrim(BigInteger.valueOf(127)); int length = testInteger.encode(berBAOStream, false); assertEquals(2, length); byte[] expectedBytes = n... | @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); } | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... | BerInteger implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerInteger(); BerInteger(byte[] code); BerInteger(BigInteger val); BerInteger(long val); @Override int encode(OutputStream reverseOS); int encode(OutputStream rever... |
@Test public void testFederationType() { assertThat(metaStore.getFederationType(), is(FederationType.PRIMARY)); } | @Override public FederationType getFederationType() { return FederationType.PRIMARY; } | PrimaryMetaStore extends AbstractMetaStore { @Override public FederationType getFederationType() { return FederationType.PRIMARY; } } | PrimaryMetaStore extends AbstractMetaStore { @Override public FederationType getFederationType() { return FederationType.PRIMARY; } PrimaryMetaStore(); PrimaryMetaStore(
String name,
String remoteMetaStoreUris,
AccessControlType accessControlType,
String... writableDatabaseWhitelist); PrimaryM... | PrimaryMetaStore extends AbstractMetaStore { @Override public FederationType getFederationType() { return FederationType.PRIMARY; } PrimaryMetaStore(); PrimaryMetaStore(
String name,
String remoteMetaStoreUris,
AccessControlType accessControlType,
String... writableDatabaseWhitelist); PrimaryM... | PrimaryMetaStore extends AbstractMetaStore { @Override public FederationType getFederationType() { return FederationType.PRIMARY; } PrimaryMetaStore(); PrimaryMetaStore(
String name,
String remoteMetaStoreUris,
AccessControlType accessControlType,
String... writableDatabaseWhitelist); PrimaryM... |
@Test public void getMetastoreMappingName() throws Exception { when(metaStoreMapping.getMetastoreMappingName()).thenReturn("Name"); String result = decorator.getMetastoreMappingName(); assertThat(result, is("Name")); } | @Override public String getMetastoreMappingName() { return metaStoreMapping.getMetastoreMappingName(); } | MetaStoreMappingDecorator implements MetaStoreMapping { @Override public String getMetastoreMappingName() { return metaStoreMapping.getMetastoreMappingName(); } } | MetaStoreMappingDecorator implements MetaStoreMapping { @Override public String getMetastoreMappingName() { return metaStoreMapping.getMetastoreMappingName(); } MetaStoreMappingDecorator(MetaStoreMapping metaStoreMapping); } | MetaStoreMappingDecorator implements MetaStoreMapping { @Override public String getMetastoreMappingName() { return metaStoreMapping.getMetastoreMappingName(); } MetaStoreMappingDecorator(MetaStoreMapping metaStoreMapping); @Override String transformOutboundDatabaseName(String databaseName); @Override List<String> trans... | MetaStoreMappingDecorator implements MetaStoreMapping { @Override public String getMetastoreMappingName() { return metaStoreMapping.getMetastoreMappingName(); } MetaStoreMappingDecorator(MetaStoreMapping metaStoreMapping); @Override String transformOutboundDatabaseName(String databaseName); @Override List<String> trans... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.