target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void propertyBridge() { PropertyBridgeWriteContext context = new SessionBasedBridgeOperationContext( sessionContext ); assertThat( context.extension( HibernateOrmExtension.get() ) ).isSameAs( sessionContext ); }
public static HibernateOrmExtension get() { return INSTANCE; }
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
@Test public void valueBridge() { ValueBridgeToIndexedValueContext toIndexedValueContext = new ValueBridgeToIndexedValueContextImpl( mappingContext ); assertThat( toIndexedValueContext.extension( HibernateOrmExtension.get() ) ).isSameAs( mappingContext ); ValueBridgeFromIndexedValueContext fromIndexedValueContext = new...
public static HibernateOrmExtension get() { return INSTANCE; }
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
@Test public void toIndexValueConverter() { ToDocumentFieldValueConvertContext context = new ToDocumentFieldValueConvertContextImpl( mappingContext ); assertThat( context.extension( HibernateOrmExtension.get() ) ).isSameAs( mappingContext ); }
public static HibernateOrmExtension get() { return INSTANCE; }
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
@Test public void fromIndexValueConverter() { FromDocumentFieldValueConvertContext context = new FromDocumentFieldValueConvertContextImpl( sessionContext ); assertThat( context.extension( HibernateOrmExtension.get() ) ).isSameAs( sessionContext ); }
public static HibernateOrmExtension get() { return INSTANCE; }
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
HibernateOrmExtension implements IdentifierBridgeToDocumentIdentifierContextExtension<HibernateOrmMappingContext>, IdentifierBridgeFromDocumentIdentifierContextExtension<HibernateOrmSessionContext>, RoutingBridgeRouteContextExtension<HibernateOrmSessionContext>, org.hibernate.search.mapper.pojo.bridge.runti...
@Test public void resolve_withoutBeanConfigurer() { when( serviceResolverMock.loadJavaServices( BeanConfigurer.class ) ) .thenReturn( Collections.emptyList() ); when( configurationSourceMock.get( EngineSpiSettings.Radicals.BEAN_CONFIGURERS ) ) .thenReturn( Optional.empty() ); BeanResolver beanResolver = new ConfiguredB...
@Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } catch (RuntimeException e2) { throw log.cannotRes...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
@Test public void resolve_withBeanConfigurer() { BeanReference<Type1> beanReference1Mock = beanReferenceMock(); BeanReference<Type2> beanReference2Mock = beanReferenceMock(); BeanReference<Type3> beanReference3Mock = beanReferenceMock(); BeanReference<Type3> beanReference4Mock = beanReferenceMock(); BeanConfigurer bean...
@Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } catch (RuntimeException e2) { throw log.cannotRes...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
@Test public void resolve_noBean() { when( serviceResolverMock.loadJavaServices( BeanConfigurer.class ) ) .thenReturn( Collections.emptyList() ); when( configurationSourceMock.get( EngineSpiSettings.Radicals.BEAN_CONFIGURERS ) ) .thenReturn( (Optional) Optional.empty() ); BeanResolver beanResolver = new ConfiguredBeanR...
@Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } catch (RuntimeException e2) { throw log.cannotRes...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
@Test public void javaIOCloseable() { Throwable mainException = new Exception(); IOException exception1 = new IOException(); RuntimeException exception2 = new IllegalStateException(); @SuppressWarnings("resource") Closeable closeable = () -> { throw exception1; }; new SuppressingCloser( mainException ) .push( closeable...
public SuppressingCloser push(AutoCloseable closeable) { return push( AutoCloseable::close, closeable ); }
SuppressingCloser extends AbstractCloser<SuppressingCloser, Exception> { public SuppressingCloser push(AutoCloseable closeable) { return push( AutoCloseable::close, closeable ); } }
SuppressingCloser extends AbstractCloser<SuppressingCloser, Exception> { public SuppressingCloser push(AutoCloseable closeable) { return push( AutoCloseable::close, closeable ); } SuppressingCloser(Throwable mainThrowable); }
SuppressingCloser extends AbstractCloser<SuppressingCloser, Exception> { public SuppressingCloser push(AutoCloseable closeable) { return push( AutoCloseable::close, closeable ); } SuppressingCloser(Throwable mainThrowable); SuppressingCloser push(AutoCloseable closeable); SuppressingCloser pushAll(AutoCloseable ... clo...
SuppressingCloser extends AbstractCloser<SuppressingCloser, Exception> { public SuppressingCloser push(AutoCloseable closeable) { return push( AutoCloseable::close, closeable ); } SuppressingCloser(Throwable mainThrowable); SuppressingCloser push(AutoCloseable closeable); SuppressingCloser pushAll(AutoCloseable ... clo...
@Test public void resolve_withBeanConfigurer_providerFailure() { BeanReference<Type1> beanReference1Mock = beanReferenceMock(); BeanReference<Type1> beanReference2Mock = beanReferenceMock(); BeanConfigurer beanConfigurer1 = context -> { context.define( Type1.class, beanReference1Mock ); }; BeanConfigurer beanConfigurer...
@Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } catch (RuntimeException e2) { throw log.cannotRes...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
@Test public void resolve_withBeanConfigurer_noProviderBean_configuredBeanFailure() { BeanReference<Type1> beanReference1Mock = beanReferenceMock(); BeanReference<Type2> beanReference2Mock = beanReferenceMock(); BeanConfigurer beanConfigurer1 = context -> { context.define( Type1.class, beanReference1Mock ); }; BeanConf...
@Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } catch (RuntimeException e2) { throw log.cannotRes...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
@Test public void resolve_withBeanConfigurer_multipleBeans() { BeanReference<Type1> beanReference1Mock = beanReferenceMock(); BeanReference<Type1> beanReference2Mock = beanReferenceMock(); BeanConfigurer beanConfigurer1 = context -> { context.define( Type1.class, beanReference1Mock ); }; BeanConfigurer beanConfigurer2 ...
@Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } catch (RuntimeException e2) { throw log.cannotRes...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
ConfiguredBeanResolver implements BeanResolver { @Override public <T> BeanHolder<T> resolve(Class<T> typeReference) { Contracts.assertNotNull( typeReference, "typeReference" ); try { return beanProvider.forType( typeReference ); } catch (SearchException e) { try { return resolveSingleConfiguredBean( typeReference ); } ...
@Test public void backendKey() { assertThat( BackendSettings.backendKey( "foo.bar" ) ) .isEqualTo( "hibernate.search.backend.foo.bar" ); assertThat( BackendSettings.backendKey( "myBackend", "foo.bar" ) ) .isEqualTo( "hibernate.search.backends.myBackend.foo.bar" ); assertThat( BackendSettings.backendKey( null, "foo.bar"...
public static String backendKey(String radical) { return join( ".", EngineSettings.BACKEND, radical ); }
BackendSettings { public static String backendKey(String radical) { return join( ".", EngineSettings.BACKEND, radical ); } }
BackendSettings { public static String backendKey(String radical) { return join( ".", EngineSettings.BACKEND, radical ); } private BackendSettings(); }
BackendSettings { public static String backendKey(String radical) { return join( ".", EngineSettings.BACKEND, radical ); } private BackendSettings(); static String backendKey(String radical); static String backendKey(String backendName, String radical); }
BackendSettings { public static String backendKey(String radical) { return join( ".", EngineSettings.BACKEND, radical ); } private BackendSettings(); static String backendKey(String radical); static String backendKey(String backendName, String radical); static final String TYPE; @Deprecated static final String INDEX_...
@Test public void indexKey() { assertThat( IndexSettings.indexKey( "indexName", "foo.bar" ) ) .isEqualTo( "hibernate.search.backend.indexes.indexName.foo.bar" ); assertThat( IndexSettings.indexKey( "backendName", "indexName", "foo.bar" ) ) .isEqualTo( "hibernate.search.backends.backendName.indexes.indexName.foo.bar" );...
public static String indexKey(String indexName, String radical) { return join( ".", EngineSettings.BACKEND, BackendSettings.INDEXES, indexName, radical ); }
IndexSettings { public static String indexKey(String indexName, String radical) { return join( ".", EngineSettings.BACKEND, BackendSettings.INDEXES, indexName, radical ); } }
IndexSettings { public static String indexKey(String indexName, String radical) { return join( ".", EngineSettings.BACKEND, BackendSettings.INDEXES, indexName, radical ); } private IndexSettings(); }
IndexSettings { public static String indexKey(String indexName, String radical) { return join( ".", EngineSettings.BACKEND, BackendSettings.INDEXES, indexName, radical ); } private IndexSettings(); @Deprecated static String indexDefaultsKey(String radical); static String indexKey(String indexName, String radical); @De...
IndexSettings { public static String indexKey(String indexName, String radical) { return join( ".", EngineSettings.BACKEND, BackendSettings.INDEXES, indexName, radical ); } private IndexSettings(); @Deprecated static String indexDefaultsKey(String radical); static String indexKey(String indexName, String radical); @De...
@Test @SuppressWarnings("deprecation") public void indexDefaultsKey() { assertThat( IndexSettings.indexDefaultsKey( "foo.bar" ) ) .isEqualTo( "hibernate.search.backend.index_defaults.foo.bar" ); assertThat( IndexSettings.indexDefaultsKey( "backendName", "foo.bar" ) ) .isEqualTo( "hibernate.search.backends.backendName.i...
@Deprecated public static String indexDefaultsKey(String radical) { return join( ".", EngineSettings.BACKEND, BackendSettings.INDEX_DEFAULTS, radical ); }
IndexSettings { @Deprecated public static String indexDefaultsKey(String radical) { return join( ".", EngineSettings.BACKEND, BackendSettings.INDEX_DEFAULTS, radical ); } }
IndexSettings { @Deprecated public static String indexDefaultsKey(String radical) { return join( ".", EngineSettings.BACKEND, BackendSettings.INDEX_DEFAULTS, radical ); } private IndexSettings(); }
IndexSettings { @Deprecated public static String indexDefaultsKey(String radical) { return join( ".", EngineSettings.BACKEND, BackendSettings.INDEX_DEFAULTS, radical ); } private IndexSettings(); @Deprecated static String indexDefaultsKey(String radical); static String indexKey(String indexName, String radical); @Depr...
IndexSettings { @Deprecated public static String indexDefaultsKey(String radical) { return join( ".", EngineSettings.BACKEND, BackendSettings.INDEX_DEFAULTS, radical ); } private IndexSettings(); @Deprecated static String indexDefaultsKey(String radical); static String indexKey(String indexName, String radical); @Depr...
@Test public void parseGeoPoint() { GeoPoint geoPoint = ParseUtils.parseGeoPoint( "12.123, -24.234" ); assertThat( geoPoint ).isEqualTo( GeoPoint.of( 12.123, -24.234 ) ); geoPoint = ParseUtils.parseGeoPoint( "12.123,-24.234" ); assertThat( geoPoint ).isEqualTo( GeoPoint.of( 12.123, -24.234 ) ); geoPoint = ParseUtils.pa...
public static GeoPoint parseGeoPoint(String value) { String[] split = value.split( GEO_POINT_SEPARATOR ); if ( split.length != 2 ) { throw log.unableToParseGeoPoint( value ); } try { return GeoPoint.of( Double.parseDouble( split[0] ), Double.parseDouble( split[1] ) ); } catch (NumberFormatException e) { throw log.unabl...
ParseUtils { public static GeoPoint parseGeoPoint(String value) { String[] split = value.split( GEO_POINT_SEPARATOR ); if ( split.length != 2 ) { throw log.unableToParseGeoPoint( value ); } try { return GeoPoint.of( Double.parseDouble( split[0] ), Double.parseDouble( split[1] ) ); } catch (NumberFormatException e) { th...
ParseUtils { public static GeoPoint parseGeoPoint(String value) { String[] split = value.split( GEO_POINT_SEPARATOR ); if ( split.length != 2 ) { throw log.unableToParseGeoPoint( value ); } try { return GeoPoint.of( Double.parseDouble( split[0] ), Double.parseDouble( split[1] ) ); } catch (NumberFormatException e) { th...
ParseUtils { public static GeoPoint parseGeoPoint(String value) { String[] split = value.split( GEO_POINT_SEPARATOR ); if ( split.length != 2 ) { throw log.unableToParseGeoPoint( value ); } try { return GeoPoint.of( Double.parseDouble( split[0] ), Double.parseDouble( split[1] ) ); } catch (NumberFormatException e) { th...
ParseUtils { public static GeoPoint parseGeoPoint(String value) { String[] split = value.split( GEO_POINT_SEPARATOR ); if ( split.length != 2 ) { throw log.unableToParseGeoPoint( value ); } try { return GeoPoint.of( Double.parseDouble( split[0] ), Double.parseDouble( split[1] ) ); } catch (NumberFormatException e) { th...
@Test public void genericContext_runtimeException() { RuntimeException runtimeException = new SimulatedRuntimeException(); logged.expectEvent( Level.ERROR, sameInstance( runtimeException ), "failure handler threw an exception" ); doThrow( runtimeException ).when( failureHandlerMock ).handle( any( FailureContext.class )...
@Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } }
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } }
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } FailSafeFailureHandlerWrapper(FailureHandler delegate); }
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } FailSafeFailureHandlerWrapper(FailureHandler delegate); @Override void handle(FailureContext context); @Overrid...
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } FailSafeFailureHandlerWrapper(FailureHandler delegate); @Override void handle(FailureContext context); @Overrid...
@Test public void genericContext_error() { Error error = new SimulatedError(); logged.expectEvent( Level.ERROR, sameInstance( error ), "failure handler threw an exception" ); doThrow( error ).when( failureHandlerMock ).handle( any( FailureContext.class ) ); wrapper.handle( FailureContext.builder().build() ); verifyNoMo...
@Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } }
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } }
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } FailSafeFailureHandlerWrapper(FailureHandler delegate); }
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } FailSafeFailureHandlerWrapper(FailureHandler delegate); @Override void handle(FailureContext context); @Overrid...
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } FailSafeFailureHandlerWrapper(FailureHandler delegate); @Override void handle(FailureContext context); @Overrid...
@Test public void entityIndexingContext_runtimeException() { RuntimeException runtimeException = new SimulatedRuntimeException(); logged.expectEvent( Level.ERROR, sameInstance( runtimeException ), "failure handler threw an exception" ); doThrow( runtimeException ).when( failureHandlerMock ).handle( any( EntityIndexingF...
@Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } }
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } }
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } FailSafeFailureHandlerWrapper(FailureHandler delegate); }
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } FailSafeFailureHandlerWrapper(FailureHandler delegate); @Override void handle(FailureContext context); @Overrid...
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } FailSafeFailureHandlerWrapper(FailureHandler delegate); @Override void handle(FailureContext context); @Overrid...
@Test public void autoCloseable() { Throwable mainException = new Exception(); Exception exception1 = new Exception(); RuntimeException exception2 = new IllegalStateException(); @SuppressWarnings("resource") AutoCloseable closeable = () -> { throw exception1; }; new SuppressingCloser( mainException ) .push( closeable )...
public SuppressingCloser push(AutoCloseable closeable) { return push( AutoCloseable::close, closeable ); }
SuppressingCloser extends AbstractCloser<SuppressingCloser, Exception> { public SuppressingCloser push(AutoCloseable closeable) { return push( AutoCloseable::close, closeable ); } }
SuppressingCloser extends AbstractCloser<SuppressingCloser, Exception> { public SuppressingCloser push(AutoCloseable closeable) { return push( AutoCloseable::close, closeable ); } SuppressingCloser(Throwable mainThrowable); }
SuppressingCloser extends AbstractCloser<SuppressingCloser, Exception> { public SuppressingCloser push(AutoCloseable closeable) { return push( AutoCloseable::close, closeable ); } SuppressingCloser(Throwable mainThrowable); SuppressingCloser push(AutoCloseable closeable); SuppressingCloser pushAll(AutoCloseable ... clo...
SuppressingCloser extends AbstractCloser<SuppressingCloser, Exception> { public SuppressingCloser push(AutoCloseable closeable) { return push( AutoCloseable::close, closeable ); } SuppressingCloser(Throwable mainThrowable); SuppressingCloser push(AutoCloseable closeable); SuppressingCloser pushAll(AutoCloseable ... clo...
@Test public void entityIndexingContext_error() { Error error = new SimulatedError(); logged.expectEvent( Level.ERROR, sameInstance( error ), "failure handler threw an exception" ); doThrow( error ).when( failureHandlerMock ).handle( any( EntityIndexingFailureContext.class ) ); wrapper.handle( EntityIndexingFailureCont...
@Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } }
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } }
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } FailSafeFailureHandlerWrapper(FailureHandler delegate); }
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } FailSafeFailureHandlerWrapper(FailureHandler delegate); @Override void handle(FailureContext context); @Overrid...
FailSafeFailureHandlerWrapper implements FailureHandler { @Override public void handle(FailureContext context) { try { delegate.handle( context ); } catch (Throwable t) { log.failureInFailureHandler( t ); } } FailSafeFailureHandlerWrapper(FailureHandler delegate); @Override void handle(FailureContext context); @Overrid...
@Test public void error_missingBackendType_nullType() { String keyPrefix = "somePrefix."; ArgumentCaptor<Throwable> throwableCaptor = ArgumentCaptor.forClass( Throwable.class ); when( configurationSourceMock.get( "default_backend" ) ) .thenReturn( (Optional) Optional.empty() ); IndexManagerBuildingStateHolder holder = ...
void createBackends(Set<Optional<String>> backendNames) { for ( Optional<String> backendNameOptional : backendNames ) { String backendName = backendNameOptional.orElse( defaultBackendName ); EventContext eventContext = EventContexts.fromBackendName( backendName ); BackendInitialBuildState backendBuildState; try { backe...
IndexManagerBuildingStateHolder { void createBackends(Set<Optional<String>> backendNames) { for ( Optional<String> backendNameOptional : backendNames ) { String backendName = backendNameOptional.orElse( defaultBackendName ); EventContext eventContext = EventContexts.fromBackendName( backendName ); BackendInitialBuildSt...
IndexManagerBuildingStateHolder { void createBackends(Set<Optional<String>> backendNames) { for ( Optional<String> backendNameOptional : backendNames ) { String backendName = backendNameOptional.orElse( defaultBackendName ); EventContext eventContext = EventContexts.fromBackendName( backendName ); BackendInitialBuildSt...
IndexManagerBuildingStateHolder { void createBackends(Set<Optional<String>> backendNames) { for ( Optional<String> backendNameOptional : backendNames ) { String backendName = backendNameOptional.orElse( defaultBackendName ); EventContext eventContext = EventContexts.fromBackendName( backendName ); BackendInitialBuildSt...
IndexManagerBuildingStateHolder { void createBackends(Set<Optional<String>> backendNames) { for ( Optional<String> backendNameOptional : backendNames ) { String backendName = backendNameOptional.orElse( defaultBackendName ); EventContext eventContext = EventContexts.fromBackendName( backendName ); BackendInitialBuildSt...
@Test public void error_missingBackendType_emptyType() { String keyPrefix = "somePrefix."; ArgumentCaptor<Throwable> throwableCaptor = ArgumentCaptor.forClass( Throwable.class ); when( configurationSourceMock.get( "default_backend" ) ) .thenReturn( (Optional) Optional.empty() ); IndexManagerBuildingStateHolder holder =...
void createBackends(Set<Optional<String>> backendNames) { for ( Optional<String> backendNameOptional : backendNames ) { String backendName = backendNameOptional.orElse( defaultBackendName ); EventContext eventContext = EventContexts.fromBackendName( backendName ); BackendInitialBuildState backendBuildState; try { backe...
IndexManagerBuildingStateHolder { void createBackends(Set<Optional<String>> backendNames) { for ( Optional<String> backendNameOptional : backendNames ) { String backendName = backendNameOptional.orElse( defaultBackendName ); EventContext eventContext = EventContexts.fromBackendName( backendName ); BackendInitialBuildSt...
IndexManagerBuildingStateHolder { void createBackends(Set<Optional<String>> backendNames) { for ( Optional<String> backendNameOptional : backendNames ) { String backendName = backendNameOptional.orElse( defaultBackendName ); EventContext eventContext = EventContexts.fromBackendName( backendName ); BackendInitialBuildSt...
IndexManagerBuildingStateHolder { void createBackends(Set<Optional<String>> backendNames) { for ( Optional<String> backendNameOptional : backendNames ) { String backendName = backendNameOptional.orElse( defaultBackendName ); EventContext eventContext = EventContexts.fromBackendName( backendName ); BackendInitialBuildSt...
IndexManagerBuildingStateHolder { void createBackends(Set<Optional<String>> backendNames) { for ( Optional<String> backendNameOptional : backendNames ) { String backendName = backendNameOptional.orElse( defaultBackendName ); EventContext eventContext = EventContexts.fromBackendName( backendName ); BackendInitialBuildSt...
@Test public void simple_batchEndsImmediately() throws InterruptedException { createAndStartExecutor( 2, true ); StubWork work1Mock = workMock( 1 ); CompletableFuture<Object> batch1Future = CompletableFuture.completedFuture( null ); when( processorMock.endBatch() ).thenReturn( (CompletableFuture) batch1Future ); execut...
public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( work ); processingTask...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
@Test public void simple_batchEndsLater_someAdditionalWorkBeforeComplete() throws InterruptedException { createAndStartExecutor( 2, true ); StubWork work1Mock = workMock( 1 ); CompletableFuture<Object> batch1Future = new CompletableFuture<>(); when( processorMock.endBatch() ).thenReturn( (CompletableFuture) batch1Futur...
public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( work ); processingTask...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
@Test public void simple_batchEndsLater_noAdditionalWork() throws InterruptedException { createAndStartExecutor( 2, true ); StubWork work1Mock = workMock( 1 ); CompletableFuture<Object> batch1Future = new CompletableFuture<>(); when( processorMock.endBatch() ).thenReturn( (CompletableFuture) batch1Future ); executor.su...
public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( work ); processingTask...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
@Test public void beginBatchFailure() throws InterruptedException { createAndStartExecutor( 4, true ); SimulatedFailure simulatedFailure = new SimulatedFailure(); Runnable unblockExecutorSwitch = blockExecutor(); StubWork work1Mock = workMock( 1 ); executor.submit( work1Mock ); verifyAsynchronouslyAndReset( inOrder -> ...
public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( work ); processingTask...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
@Test public void submitFailure() throws InterruptedException { createAndStartExecutor( 4, true ); SimulatedFailure simulatedFailure = new SimulatedFailure(); Runnable unblockExecutorSwitch = blockExecutor(); StubWork work1Mock = workMock( 1 ); StubWork work2Mock = workMock( 2 ); StubWork work3Mock = workMock( 3 ); exe...
public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( work ); processingTask...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
@Test public void endBatchFailure() throws InterruptedException { createAndStartExecutor( 4, true ); SimulatedFailure simulatedFailure = new SimulatedFailure(); Runnable unblockExecutorSwitch = blockExecutor(); StubWork work1Mock = workMock( 1 ); StubWork work2Mock = workMock( 2 ); executor.submit( work1Mock ); executo...
public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( work ); processingTask...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
BatchingExecutor { public void submit(BatchedWork<? super P> work) throws InterruptedException { if ( processingTask == null ) { throw new AssertionFailure( "Attempt to submit a work to executor '" + name + "', which is stopped" + " There is probably a bug in Hibernate Search, please report it." ); } workQueue.put( wor...
@Test public void success() { Long work1Result = 42L; Long work2Result = 41L; Long work3Result = 43L; ArgumentCaptor<CompletableFuture<Long>> work1FutureCaptor = futureCaptor(); ArgumentCaptor<CompletableFuture<Long>> work2FutureCaptor = futureCaptor(); ArgumentCaptor<CompletableFuture<Long>> work3FutureCaptor = future...
CompletableFuture<IndexIndexingPlanExecutionReport<R>> execute() { CompletableFuture<IndexIndexingPlanExecutionReport<R>> reportFuture = CompletableFuture.allOf( futures ) .handle( (result, throwable) -> onAllWorksFinished() ); for ( int i = 0; i < works.size(); i++ ) { CompletableFuture<Long> future = futures[i]; Sing...
LuceneIndexIndexingPlanExecution { CompletableFuture<IndexIndexingPlanExecutionReport<R>> execute() { CompletableFuture<IndexIndexingPlanExecutionReport<R>> reportFuture = CompletableFuture.allOf( futures ) .handle( (result, throwable) -> onAllWorksFinished() ); for ( int i = 0; i < works.size(); i++ ) { CompletableFut...
LuceneIndexIndexingPlanExecution { CompletableFuture<IndexIndexingPlanExecutionReport<R>> execute() { CompletableFuture<IndexIndexingPlanExecutionReport<R>> reportFuture = CompletableFuture.allOf( futures ) .handle( (result, throwable) -> onAllWorksFinished() ); for ( int i = 0; i < works.size(); i++ ) { CompletableFut...
LuceneIndexIndexingPlanExecution { CompletableFuture<IndexIndexingPlanExecutionReport<R>> execute() { CompletableFuture<IndexIndexingPlanExecutionReport<R>> reportFuture = CompletableFuture.allOf( futures ) .handle( (result, throwable) -> onAllWorksFinished() ); for ( int i = 0; i < works.size(); i++ ) { CompletableFut...
LuceneIndexIndexingPlanExecution { CompletableFuture<IndexIndexingPlanExecutionReport<R>> execute() { CompletableFuture<IndexIndexingPlanExecutionReport<R>> reportFuture = CompletableFuture.allOf( futures ) .handle( (result, throwable) -> onAllWorksFinished() ); for ( int i = 0; i < works.size(); i++ ) { CompletableFut...
@Test public void runtimeException() { Throwable mainException = new Exception(); RuntimeException exception1 = new RuntimeException(); RuntimeException exception2 = new IllegalStateException(); RuntimeException exception3 = new UnsupportedOperationException(); new SuppressingCloser( mainException ) .push( ignored -> {...
public SuppressingCloser push(AutoCloseable closeable) { return push( AutoCloseable::close, closeable ); }
SuppressingCloser extends AbstractCloser<SuppressingCloser, Exception> { public SuppressingCloser push(AutoCloseable closeable) { return push( AutoCloseable::close, closeable ); } }
SuppressingCloser extends AbstractCloser<SuppressingCloser, Exception> { public SuppressingCloser push(AutoCloseable closeable) { return push( AutoCloseable::close, closeable ); } SuppressingCloser(Throwable mainThrowable); }
SuppressingCloser extends AbstractCloser<SuppressingCloser, Exception> { public SuppressingCloser push(AutoCloseable closeable) { return push( AutoCloseable::close, closeable ); } SuppressingCloser(Throwable mainThrowable); SuppressingCloser push(AutoCloseable closeable); SuppressingCloser pushAll(AutoCloseable ... clo...
SuppressingCloser extends AbstractCloser<SuppressingCloser, Exception> { public SuppressingCloser push(AutoCloseable closeable) { return push( AutoCloseable::close, closeable ); } SuppressingCloser(Throwable mainThrowable); SuppressingCloser push(AutoCloseable closeable); SuppressingCloser pushAll(AutoCloseable ... clo...
@Test public void testIterator() { Schema sample = AvroSchemaGeneratorTest.getSampleSchema(); boolean baseSeen = false, recursiveSeen = false, compositeSeen = false, arraySeen = false, mapSeen = false; for (Schema schema : new AvroSchemaIterator(sample)) { if (schema.getName().equals("SampleBaseType")) { baseSeen = tru...
@Override public Iterator<Schema> iterator() { return this; }
AvroSchemaIterator implements Iterable<Schema>, Iterator<Schema> { @Override public Iterator<Schema> iterator() { return this; } }
AvroSchemaIterator implements Iterable<Schema>, Iterator<Schema> { @Override public Iterator<Schema> iterator() { return this; } AvroSchemaIterator(Schema rootSchema); }
AvroSchemaIterator implements Iterable<Schema>, Iterator<Schema> { @Override public Iterator<Schema> iterator() { return this; } AvroSchemaIterator(Schema rootSchema); @Override Iterator<Schema> iterator(); @Override boolean hasNext(); @Override Schema next(); }
AvroSchemaIterator implements Iterable<Schema>, Iterator<Schema> { @Override public Iterator<Schema> iterator() { return this; } AvroSchemaIterator(Schema rootSchema); @Override Iterator<Schema> iterator(); @Override boolean hasNext(); @Override Schema next(); }
@Test public void testParseCompositeKey() { final CompositeKey key = CompositeKey.parseCompositeKey("\u0000abc\u0000def\u0000ghi\u0000jkl\u0000mno\u0000"); assertThat(key.getObjectType(), is(equalTo("abc"))); assertThat(key.getAttributes(), hasSize(4)); assertThat(key.getAttributes(), contains("def", "ghi", "jkl", "mno...
public static CompositeKey parseCompositeKey(final String compositeKey) { if (compositeKey == null) { return null; } if (!compositeKey.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forInputString(compositeKey, compositeKey, 0); } final String[] segments = compositeKey.split(DELIMITER, 0); return new Compos...
CompositeKey { public static CompositeKey parseCompositeKey(final String compositeKey) { if (compositeKey == null) { return null; } if (!compositeKey.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forInputString(compositeKey, compositeKey, 0); } final String[] segments = compositeKey.split(DELIMITER, 0); re...
CompositeKey { public static CompositeKey parseCompositeKey(final String compositeKey) { if (compositeKey == null) { return null; } if (!compositeKey.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forInputString(compositeKey, compositeKey, 0); } final String[] segments = compositeKey.split(DELIMITER, 0); re...
CompositeKey { public static CompositeKey parseCompositeKey(final String compositeKey) { if (compositeKey == null) { return null; } if (!compositeKey.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forInputString(compositeKey, compositeKey, 0); } final String[] segments = compositeKey.split(DELIMITER, 0); re...
CompositeKey { public static CompositeKey parseCompositeKey(final String compositeKey) { if (compositeKey == null) { return null; } if (!compositeKey.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forInputString(compositeKey, compositeKey, 0); } final String[] segments = compositeKey.split(DELIMITER, 0); re...
@Test(expected = CompositeKeyFormatException.class) public void testParseCompositeKeyInvalidObjectType() { CompositeKey.parseCompositeKey("ab\udbff\udfffc\u0000def\u0000ghi\u0000jkl\u0000mno\u0000"); }
public static CompositeKey parseCompositeKey(final String compositeKey) { if (compositeKey == null) { return null; } if (!compositeKey.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forInputString(compositeKey, compositeKey, 0); } final String[] segments = compositeKey.split(DELIMITER, 0); return new Compos...
CompositeKey { public static CompositeKey parseCompositeKey(final String compositeKey) { if (compositeKey == null) { return null; } if (!compositeKey.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forInputString(compositeKey, compositeKey, 0); } final String[] segments = compositeKey.split(DELIMITER, 0); re...
CompositeKey { public static CompositeKey parseCompositeKey(final String compositeKey) { if (compositeKey == null) { return null; } if (!compositeKey.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forInputString(compositeKey, compositeKey, 0); } final String[] segments = compositeKey.split(DELIMITER, 0); re...
CompositeKey { public static CompositeKey parseCompositeKey(final String compositeKey) { if (compositeKey == null) { return null; } if (!compositeKey.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forInputString(compositeKey, compositeKey, 0); } final String[] segments = compositeKey.split(DELIMITER, 0); re...
CompositeKey { public static CompositeKey parseCompositeKey(final String compositeKey) { if (compositeKey == null) { return null; } if (!compositeKey.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forInputString(compositeKey, compositeKey, 0); } final String[] segments = compositeKey.split(DELIMITER, 0); re...
@Test(expected = CompositeKeyFormatException.class) public void testParseCompositeKeyInvalidAttribute() { CompositeKey.parseCompositeKey("abc\u0000def\u0000ghi\u0000jk\udbff\udfffl\u0000mno\u0000"); }
public static CompositeKey parseCompositeKey(final String compositeKey) { if (compositeKey == null) { return null; } if (!compositeKey.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forInputString(compositeKey, compositeKey, 0); } final String[] segments = compositeKey.split(DELIMITER, 0); return new Compos...
CompositeKey { public static CompositeKey parseCompositeKey(final String compositeKey) { if (compositeKey == null) { return null; } if (!compositeKey.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forInputString(compositeKey, compositeKey, 0); } final String[] segments = compositeKey.split(DELIMITER, 0); re...
CompositeKey { public static CompositeKey parseCompositeKey(final String compositeKey) { if (compositeKey == null) { return null; } if (!compositeKey.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forInputString(compositeKey, compositeKey, 0); } final String[] segments = compositeKey.split(DELIMITER, 0); re...
CompositeKey { public static CompositeKey parseCompositeKey(final String compositeKey) { if (compositeKey == null) { return null; } if (!compositeKey.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forInputString(compositeKey, compositeKey, 0); } final String[] segments = compositeKey.split(DELIMITER, 0); re...
CompositeKey { public static CompositeKey parseCompositeKey(final String compositeKey) { if (compositeKey == null) { return null; } if (!compositeKey.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forInputString(compositeKey, compositeKey, 0); } final String[] segments = compositeKey.split(DELIMITER, 0); re...
@Test public void addOrgs() { final StateBasedEndorsement ep = StateBasedEndorsementFactory.getInstance().newStateBasedEndorsement(null); ep.addOrgs(RoleType.RoleTypePeer, "Org1"); final byte[] epBytes = ep.policy(); assertThat(epBytes, is(not(nullValue()))); assertTrue(epBytes.length > 0); final byte[] expectedEPBytes...
@Override public void addOrgs(final RoleType role, final String... organizations) { MSPRoleType mspRole; if (RoleType.RoleTypeMember.equals(role)) { mspRole = MSPRoleType.MEMBER; } else { mspRole = MSPRoleType.PEER; } for (final String neworg : organizations) { orgs.put(neworg, mspRole); } }
StateBasedEndorsementImpl implements StateBasedEndorsement { @Override public void addOrgs(final RoleType role, final String... organizations) { MSPRoleType mspRole; if (RoleType.RoleTypeMember.equals(role)) { mspRole = MSPRoleType.MEMBER; } else { mspRole = MSPRoleType.PEER; } for (final String neworg : organizations)...
StateBasedEndorsementImpl implements StateBasedEndorsement { @Override public void addOrgs(final RoleType role, final String... organizations) { MSPRoleType mspRole; if (RoleType.RoleTypeMember.equals(role)) { mspRole = MSPRoleType.MEMBER; } else { mspRole = MSPRoleType.PEER; } for (final String neworg : organizations)...
StateBasedEndorsementImpl implements StateBasedEndorsement { @Override public void addOrgs(final RoleType role, final String... organizations) { MSPRoleType mspRole; if (RoleType.RoleTypeMember.equals(role)) { mspRole = MSPRoleType.MEMBER; } else { mspRole = MSPRoleType.PEER; } for (final String neworg : organizations)...
StateBasedEndorsementImpl implements StateBasedEndorsement { @Override public void addOrgs(final RoleType role, final String... organizations) { MSPRoleType mspRole; if (RoleType.RoleTypeMember.equals(role)) { mspRole = MSPRoleType.MEMBER; } else { mspRole = MSPRoleType.PEER; } for (final String neworg : organizations)...
@Test public void delOrgs() { final byte[] initEPBytes = StateBasedEndorsementUtils.signedByFabricEntity("Org1", MSPRoleType.PEER).toByteString().toByteArray(); final StateBasedEndorsement ep = StateBasedEndorsementFactory.getInstance().newStateBasedEndorsement(initEPBytes); final List<String> listOrgs = ep.listOrgs();...
@Override public void delOrgs(final String... organizations) { for (final String delorg : organizations) { orgs.remove(delorg); } }
StateBasedEndorsementImpl implements StateBasedEndorsement { @Override public void delOrgs(final String... organizations) { for (final String delorg : organizations) { orgs.remove(delorg); } } }
StateBasedEndorsementImpl implements StateBasedEndorsement { @Override public void delOrgs(final String... organizations) { for (final String delorg : organizations) { orgs.remove(delorg); } } StateBasedEndorsementImpl(final byte[] ep); }
StateBasedEndorsementImpl implements StateBasedEndorsement { @Override public void delOrgs(final String... organizations) { for (final String delorg : organizations) { orgs.remove(delorg); } } StateBasedEndorsementImpl(final byte[] ep); @Override byte[] policy(); @Override void addOrgs(final RoleType role, final String...
StateBasedEndorsementImpl implements StateBasedEndorsement { @Override public void delOrgs(final String... organizations) { for (final String delorg : organizations) { orgs.remove(delorg); } } StateBasedEndorsementImpl(final byte[] ep); @Override byte[] policy(); @Override void addOrgs(final RoleType role, final String...
@Test public void listOrgs() { final byte[] initEPBytes = StateBasedEndorsementUtils.signedByFabricEntity("Org1", MSPRoleType.PEER).toByteString().toByteArray(); final StateBasedEndorsement ep = StateBasedEndorsementFactory.getInstance().newStateBasedEndorsement(initEPBytes); final List<String> listOrgs = ep.listOrgs()...
@Override public List<String> listOrgs() { final List<String> res = new ArrayList<>(); res.addAll(orgs.keySet()); return res; }
StateBasedEndorsementImpl implements StateBasedEndorsement { @Override public List<String> listOrgs() { final List<String> res = new ArrayList<>(); res.addAll(orgs.keySet()); return res; } }
StateBasedEndorsementImpl implements StateBasedEndorsement { @Override public List<String> listOrgs() { final List<String> res = new ArrayList<>(); res.addAll(orgs.keySet()); return res; } StateBasedEndorsementImpl(final byte[] ep); }
StateBasedEndorsementImpl implements StateBasedEndorsement { @Override public List<String> listOrgs() { final List<String> res = new ArrayList<>(); res.addAll(orgs.keySet()); return res; } StateBasedEndorsementImpl(final byte[] ep); @Override byte[] policy(); @Override void addOrgs(final RoleType role, final String... ...
StateBasedEndorsementImpl implements StateBasedEndorsement { @Override public List<String> listOrgs() { final List<String> res = new ArrayList<>(); res.addAll(orgs.keySet()); return res; } StateBasedEndorsementImpl(final byte[] ep); @Override byte[] policy(); @Override void addOrgs(final RoleType role, final String... ...
@Test public void getInstance() { assertNotNull(StateBasedEndorsementFactory.getInstance()); assertTrue(StateBasedEndorsementFactory.getInstance() instanceof StateBasedEndorsementFactory); }
public static synchronized StateBasedEndorsementFactory getInstance() { if (instance == null) { instance = new StateBasedEndorsementFactory(); } return instance; }
StateBasedEndorsementFactory { public static synchronized StateBasedEndorsementFactory getInstance() { if (instance == null) { instance = new StateBasedEndorsementFactory(); } return instance; } }
StateBasedEndorsementFactory { public static synchronized StateBasedEndorsementFactory getInstance() { if (instance == null) { instance = new StateBasedEndorsementFactory(); } return instance; } }
StateBasedEndorsementFactory { public static synchronized StateBasedEndorsementFactory getInstance() { if (instance == null) { instance = new StateBasedEndorsementFactory(); } return instance; } static synchronized StateBasedEndorsementFactory getInstance(); StateBasedEndorsement newStateBasedEndorsement(final byte[] ...
StateBasedEndorsementFactory { public static synchronized StateBasedEndorsementFactory getInstance() { if (instance == null) { instance = new StateBasedEndorsementFactory(); } return instance; } static synchronized StateBasedEndorsementFactory getInstance(); StateBasedEndorsement newStateBasedEndorsement(final byte[] ...
@Test public void newStateBasedEndorsement() { assertNotNull(StateBasedEndorsementFactory.getInstance().newStateBasedEndorsement(new byte[] {})); thrown.expect(IllegalArgumentException.class); StateBasedEndorsementFactory.getInstance().newStateBasedEndorsement(new byte[] {0}); }
public StateBasedEndorsement newStateBasedEndorsement(final byte[] ep) { return new StateBasedEndorsementImpl(ep); }
StateBasedEndorsementFactory { public StateBasedEndorsement newStateBasedEndorsement(final byte[] ep) { return new StateBasedEndorsementImpl(ep); } }
StateBasedEndorsementFactory { public StateBasedEndorsement newStateBasedEndorsement(final byte[] ep) { return new StateBasedEndorsementImpl(ep); } }
StateBasedEndorsementFactory { public StateBasedEndorsement newStateBasedEndorsement(final byte[] ep) { return new StateBasedEndorsementImpl(ep); } static synchronized StateBasedEndorsementFactory getInstance(); StateBasedEndorsement newStateBasedEndorsement(final byte[] ep); }
StateBasedEndorsementFactory { public StateBasedEndorsement newStateBasedEndorsement(final byte[] ep) { return new StateBasedEndorsementImpl(ep); } static synchronized StateBasedEndorsementFactory getInstance(); StateBasedEndorsement newStateBasedEndorsement(final byte[] ep); }
@Test public void testKeyValueImpl() { new KeyValueImpl(KV.newBuilder() .setKey("key") .setValue(ByteString.copyFromUtf8("value")) .build()); }
KeyValueImpl(final KV kv) { this.key = kv.getKey(); this.value = kv.getValue(); }
KeyValueImpl implements KeyValue { KeyValueImpl(final KV kv) { this.key = kv.getKey(); this.value = kv.getValue(); } }
KeyValueImpl implements KeyValue { KeyValueImpl(final KV kv) { this.key = kv.getKey(); this.value = kv.getValue(); } KeyValueImpl(final KV kv); }
KeyValueImpl implements KeyValue { KeyValueImpl(final KV kv) { this.key = kv.getKey(); this.value = kv.getValue(); } KeyValueImpl(final KV kv); @Override String getKey(); @Override byte[] getValue(); @Override String getStringValue(); @Override int hashCode(); @Override boolean equals(final Object obj); }
KeyValueImpl implements KeyValue { KeyValueImpl(final KV kv) { this.key = kv.getKey(); this.value = kv.getValue(); } KeyValueImpl(final KV kv); @Override String getKey(); @Override byte[] getValue(); @Override String getStringValue(); @Override int hashCode(); @Override boolean equals(final Object obj); }
@Test public void testGetKey() { final KeyValueImpl kv = new KeyValueImpl(KV.newBuilder() .setKey("key") .setValue(ByteString.copyFromUtf8("value")) .build()); assertThat(kv.getKey(), is(equalTo("key"))); }
@Override public String getKey() { return key; }
KeyValueImpl implements KeyValue { @Override public String getKey() { return key; } }
KeyValueImpl implements KeyValue { @Override public String getKey() { return key; } KeyValueImpl(final KV kv); }
KeyValueImpl implements KeyValue { @Override public String getKey() { return key; } KeyValueImpl(final KV kv); @Override String getKey(); @Override byte[] getValue(); @Override String getStringValue(); @Override int hashCode(); @Override boolean equals(final Object obj); }
KeyValueImpl implements KeyValue { @Override public String getKey() { return key; } KeyValueImpl(final KV kv); @Override String getKey(); @Override byte[] getValue(); @Override String getStringValue(); @Override int hashCode(); @Override boolean equals(final Object obj); }
@Test public void assetDelete() { MyAssetContract contract = new MyAssetContract(); Context ctx = mock(Context.class); ChaincodeStub stub = mock(ChaincodeStub.class); when(ctx.getStub()).thenReturn(stub); when(stub.getState("10001")).thenReturn(null); Exception thrown = assertThrows(RuntimeException.class, () -> { cont...
@Transaction() public void deleteMyAsset(Context ctx, String myAssetId) { boolean exists = myAssetExists(ctx,myAssetId); if (!exists) { throw new RuntimeException("The asset "+myAssetId+" does not exist"); } ctx.getStub().delState(myAssetId); }
MyAssetContract implements ContractInterface { @Transaction() public void deleteMyAsset(Context ctx, String myAssetId) { boolean exists = myAssetExists(ctx,myAssetId); if (!exists) { throw new RuntimeException("The asset "+myAssetId+" does not exist"); } ctx.getStub().delState(myAssetId); } }
MyAssetContract implements ContractInterface { @Transaction() public void deleteMyAsset(Context ctx, String myAssetId) { boolean exists = myAssetExists(ctx,myAssetId); if (!exists) { throw new RuntimeException("The asset "+myAssetId+" does not exist"); } ctx.getStub().delState(myAssetId); } MyAssetContract(); }
MyAssetContract implements ContractInterface { @Transaction() public void deleteMyAsset(Context ctx, String myAssetId) { boolean exists = myAssetExists(ctx,myAssetId); if (!exists) { throw new RuntimeException("The asset "+myAssetId+" does not exist"); } ctx.getStub().delState(myAssetId); } MyAssetContract(); @Transact...
MyAssetContract implements ContractInterface { @Transaction() public void deleteMyAsset(Context ctx, String myAssetId) { boolean exists = myAssetExists(ctx,myAssetId); if (!exists) { throw new RuntimeException("The asset "+myAssetId+" does not exist"); } ctx.getStub().delState(myAssetId); } MyAssetContract(); @Transact...
@Test public void testGetValue() { final KeyValueImpl kv = new KeyValueImpl(KV.newBuilder() .setKey("key") .setValue(ByteString.copyFromUtf8("value")) .build()); assertThat(kv.getValue(), is(equalTo("value".getBytes(UTF_8)))); }
@Override public byte[] getValue() { return value.toByteArray(); }
KeyValueImpl implements KeyValue { @Override public byte[] getValue() { return value.toByteArray(); } }
KeyValueImpl implements KeyValue { @Override public byte[] getValue() { return value.toByteArray(); } KeyValueImpl(final KV kv); }
KeyValueImpl implements KeyValue { @Override public byte[] getValue() { return value.toByteArray(); } KeyValueImpl(final KV kv); @Override String getKey(); @Override byte[] getValue(); @Override String getStringValue(); @Override int hashCode(); @Override boolean equals(final Object obj); }
KeyValueImpl implements KeyValue { @Override public byte[] getValue() { return value.toByteArray(); } KeyValueImpl(final KV kv); @Override String getKey(); @Override byte[] getValue(); @Override String getStringValue(); @Override int hashCode(); @Override boolean equals(final Object obj); }
@Test public void testGetStringValue() { final KeyValueImpl kv = new KeyValueImpl(KV.newBuilder() .setKey("key") .setValue(ByteString.copyFromUtf8("value")) .build()); assertThat(kv.getStringValue(), is(equalTo("value"))); }
@Override public String getStringValue() { return value.toStringUtf8(); }
KeyValueImpl implements KeyValue { @Override public String getStringValue() { return value.toStringUtf8(); } }
KeyValueImpl implements KeyValue { @Override public String getStringValue() { return value.toStringUtf8(); } KeyValueImpl(final KV kv); }
KeyValueImpl implements KeyValue { @Override public String getStringValue() { return value.toStringUtf8(); } KeyValueImpl(final KV kv); @Override String getKey(); @Override byte[] getValue(); @Override String getStringValue(); @Override int hashCode(); @Override boolean equals(final Object obj); }
KeyValueImpl implements KeyValue { @Override public String getStringValue() { return value.toStringUtf8(); } KeyValueImpl(final KV kv); @Override String getKey(); @Override byte[] getValue(); @Override String getStringValue(); @Override int hashCode(); @Override boolean equals(final Object obj); }
@Test public void testHashCode() { final KeyValueImpl kv = new KeyValueImpl(KV.newBuilder() .build()); int expectedHashCode = 31; expectedHashCode = expectedHashCode + "".hashCode(); expectedHashCode = expectedHashCode * 31 + ByteString.copyFromUtf8("").hashCode(); assertEquals("Wrong hashcode", expectedHashCode, kv.ha...
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((key == null) ? 0 : key.hashCode()); result = prime * result + ((value == null) ? 0 : value.hashCode()); return result; }
KeyValueImpl implements KeyValue { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((key == null) ? 0 : key.hashCode()); result = prime * result + ((value == null) ? 0 : value.hashCode()); return result; } }
KeyValueImpl implements KeyValue { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((key == null) ? 0 : key.hashCode()); result = prime * result + ((value == null) ? 0 : value.hashCode()); return result; } KeyValueImpl(final KV kv); }
KeyValueImpl implements KeyValue { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((key == null) ? 0 : key.hashCode()); result = prime * result + ((value == null) ? 0 : value.hashCode()); return result; } KeyValueImpl(final KV kv); @Override String getKey(); @Override ...
KeyValueImpl implements KeyValue { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((key == null) ? 0 : key.hashCode()); result = prime * result + ((value == null) ? 0 : value.hashCode()); return result; } KeyValueImpl(final KV kv); @Override String getKey(); @Override ...
@Test public void testEquals() { final KeyValueImpl kv1 = new KeyValueImpl(KV.newBuilder() .setKey("a") .setValue(ByteString.copyFromUtf8("valueA")) .build()); final KeyValueImpl kv2 = new KeyValueImpl(KV.newBuilder() .setKey("a") .setValue(ByteString.copyFromUtf8("valueB")) .build()); final KeyValueImpl kv3 = new KeyV...
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final KeyValueImpl other = (KeyValueImpl) obj; if (!key.equals(other.key)) { return false; } if (!value.equals(other.value)) { return false; } retu...
KeyValueImpl implements KeyValue { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final KeyValueImpl other = (KeyValueImpl) obj; if (!key.equals(other.key)) { return false; } if (!value.equals(o...
KeyValueImpl implements KeyValue { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final KeyValueImpl other = (KeyValueImpl) obj; if (!key.equals(other.key)) { return false; } if (!value.equals(o...
KeyValueImpl implements KeyValue { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final KeyValueImpl other = (KeyValueImpl) obj; if (!key.equals(other.key)) { return false; } if (!value.equals(o...
KeyValueImpl implements KeyValue { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final KeyValueImpl other = (KeyValueImpl) obj; if (!key.equals(other.key)) { return false; } if (!value.equals(o...
@Test public void register() throws UnsupportedEncodingException { itm.register(); }
public InvocationTaskManager register() { logger.info(() -> "Registering new chaincode " + this.chaincodeId); chaincode.setState(ChaincodeBase.CCState.CREATED); this.outgoingMessage.accept(ChaincodeMessageFactory.newRegisterChaincodeMessage(this.chaincodeId)); return this; }
InvocationTaskManager { public InvocationTaskManager register() { logger.info(() -> "Registering new chaincode " + this.chaincodeId); chaincode.setState(ChaincodeBase.CCState.CREATED); this.outgoingMessage.accept(ChaincodeMessageFactory.newRegisterChaincodeMessage(this.chaincodeId)); return this; } }
InvocationTaskManager { public InvocationTaskManager register() { logger.info(() -> "Registering new chaincode " + this.chaincodeId); chaincode.setState(ChaincodeBase.CCState.CREATED); this.outgoingMessage.accept(ChaincodeMessageFactory.newRegisterChaincodeMessage(this.chaincodeId)); return this; } InvocationTaskManage...
InvocationTaskManager { public InvocationTaskManager register() { logger.info(() -> "Registering new chaincode " + this.chaincodeId); chaincode.setState(ChaincodeBase.CCState.CREATED); this.outgoingMessage.accept(ChaincodeMessageFactory.newRegisterChaincodeMessage(this.chaincodeId)); return this; } InvocationTaskManage...
InvocationTaskManager { public InvocationTaskManager register() { logger.info(() -> "Registering new chaincode " + this.chaincodeId); chaincode.setState(ChaincodeBase.CCState.CREATED); this.outgoingMessage.accept(ChaincodeMessageFactory.newRegisterChaincodeMessage(this.chaincodeId)); return this; } InvocationTaskManage...
@Test public void onMessageTestTx() throws UnsupportedEncodingException { final ChaincodeMessage msg = ChaincodeMessageFactory.newEventMessage(ChaincodeMessage.Type.TRANSACTION, "mychannel", "txid", ByteString.copyFrom("Hello", "UTF-8")); when(chaincode.getChaincodeConfig()).thenReturn(new Properties()); chaincode.setS...
public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED: if (msgType == REGISTE...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
@Test public void onWrongCreatedState() throws UnsupportedEncodingException { perfLogger.setLevel(Level.ALL); final ChaincodeMessage msg = ChaincodeMessageFactory.newEventMessage(ChaincodeMessage.Type.TRANSACTION, "mychannel", "txid", ByteString.copyFrom("Hello", "UTF-8")); when(chaincode.getChaincodeConfig()).thenRetu...
public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED: if (msgType == REGISTE...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
@Test public void onWrongEstablishedState() throws UnsupportedEncodingException { final ChaincodeMessage msg = ChaincodeMessageFactory.newEventMessage(ChaincodeMessage.Type.TRANSACTION, "mychannel", "txid", ByteString.copyFrom("Hello", "UTF-8")); when(chaincode.getChaincodeConfig()).thenReturn(new Properties()); chainc...
public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED: if (msgType == REGISTE...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
@Test public void onErrorResponse() throws UnsupportedEncodingException { final ChaincodeMessage msg = ChaincodeMessageFactory.newEventMessage(ChaincodeMessage.Type.ERROR, "mychannel", "txid", ByteString.copyFrom("Hello", "UTF-8")); when(chaincode.getChaincodeConfig()).thenReturn(new Properties()); chaincode.setState(C...
public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED: if (msgType == REGISTE...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
InvocationTaskManager { public void onChaincodeMessage(final ChaincodeMessage chaincodeMessage) { logger.fine(() -> String.format("[%-8.8s] %s", chaincodeMessage.getTxid(), ChaincodeBase.toJsonString(chaincodeMessage))); try { final Type msgType = chaincodeMessage.getType(); switch (chaincode.getState()) { case CREATED...
@Test void testNewGetPrivateDataHashEventMessage() { ChaincodeMessageFactory.newGetPrivateDataHashEventMessage(channelId, txId, collection, key); }
protected static ChaincodeMessage newGetPrivateDataHashEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_PRIVATE_DATA_HASH, channelId, txId, GetState.newBuilder().setCollection(collection).setKey(key).build().toByteString()); }
ChaincodeMessageFactory { protected static ChaincodeMessage newGetPrivateDataHashEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_PRIVATE_DATA_HASH, channelId, txId, GetState.newBuilder().setCollection(collection).setKey(key).build().toByteS...
ChaincodeMessageFactory { protected static ChaincodeMessage newGetPrivateDataHashEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_PRIVATE_DATA_HASH, channelId, txId, GetState.newBuilder().setCollection(collection).setKey(key).build().toByteS...
ChaincodeMessageFactory { protected static ChaincodeMessage newGetPrivateDataHashEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_PRIVATE_DATA_HASH, channelId, txId, GetState.newBuilder().setCollection(collection).setKey(key).build().toByteS...
ChaincodeMessageFactory { protected static ChaincodeMessage newGetPrivateDataHashEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_PRIVATE_DATA_HASH, channelId, txId, GetState.newBuilder().setCollection(collection).setKey(key).build().toByteS...
@Test public void assetRead() { MyAssetContract contract = new MyAssetContract(); Context ctx = mock(Context.class); ChaincodeStub stub = mock(ChaincodeStub.class); when(ctx.getStub()).thenReturn(stub); MyAsset asset = new MyAsset(); asset.setValue("Valuable"); String json = asset.toJSONString(); when(stub.getState("10...
@Transaction() public MyAsset readMyAsset(Context ctx, String myAssetId) { boolean exists = myAssetExists(ctx,myAssetId); if (!exists) { throw new RuntimeException("The asset "+myAssetId+" does not exist"); } MyAsset newAsset = MyAsset.fromJSONString(new String(ctx.getStub().getState(myAssetId),UTF_8)); return newAsset...
MyAssetContract implements ContractInterface { @Transaction() public MyAsset readMyAsset(Context ctx, String myAssetId) { boolean exists = myAssetExists(ctx,myAssetId); if (!exists) { throw new RuntimeException("The asset "+myAssetId+" does not exist"); } MyAsset newAsset = MyAsset.fromJSONString(new String(ctx.getStub...
MyAssetContract implements ContractInterface { @Transaction() public MyAsset readMyAsset(Context ctx, String myAssetId) { boolean exists = myAssetExists(ctx,myAssetId); if (!exists) { throw new RuntimeException("The asset "+myAssetId+" does not exist"); } MyAsset newAsset = MyAsset.fromJSONString(new String(ctx.getStub...
MyAssetContract implements ContractInterface { @Transaction() public MyAsset readMyAsset(Context ctx, String myAssetId) { boolean exists = myAssetExists(ctx,myAssetId); if (!exists) { throw new RuntimeException("The asset "+myAssetId+" does not exist"); } MyAsset newAsset = MyAsset.fromJSONString(new String(ctx.getStub...
MyAssetContract implements ContractInterface { @Transaction() public MyAsset readMyAsset(Context ctx, String myAssetId) { boolean exists = myAssetExists(ctx,myAssetId); if (!exists) { throw new RuntimeException("The asset "+myAssetId+" does not exist"); } MyAsset newAsset = MyAsset.fromJSONString(new String(ctx.getStub...
@Test void testNewGetStateEventMessage() { ChaincodeMessageFactory.newGetStateEventMessage(channelId, txId, collection, key); }
protected static ChaincodeMessage newGetStateEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_STATE, channelId, txId, GetState.newBuilder().setCollection(collection).setKey(key).build().toByteString()); }
ChaincodeMessageFactory { protected static ChaincodeMessage newGetStateEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_STATE, channelId, txId, GetState.newBuilder().setCollection(collection).setKey(key).build().toByteString()); } }
ChaincodeMessageFactory { protected static ChaincodeMessage newGetStateEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_STATE, channelId, txId, GetState.newBuilder().setCollection(collection).setKey(key).build().toByteString()); } private C...
ChaincodeMessageFactory { protected static ChaincodeMessage newGetStateEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_STATE, channelId, txId, GetState.newBuilder().setCollection(collection).setKey(key).build().toByteString()); } private C...
ChaincodeMessageFactory { protected static ChaincodeMessage newGetStateEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_STATE, channelId, txId, GetState.newBuilder().setCollection(collection).setKey(key).build().toByteString()); } private C...
@Test void testNewGetStateMetadataEventMessage() { ChaincodeMessageFactory.newGetStateMetadataEventMessage(channelId, txId, collection, key); }
protected static ChaincodeMessage newGetStateMetadataEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_STATE_METADATA, channelId, txId, GetStateMetadata.newBuilder().setCollection(collection).setKey(key).build().toByteString()); }
ChaincodeMessageFactory { protected static ChaincodeMessage newGetStateMetadataEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_STATE_METADATA, channelId, txId, GetStateMetadata.newBuilder().setCollection(collection).setKey(key).build().toBy...
ChaincodeMessageFactory { protected static ChaincodeMessage newGetStateMetadataEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_STATE_METADATA, channelId, txId, GetStateMetadata.newBuilder().setCollection(collection).setKey(key).build().toBy...
ChaincodeMessageFactory { protected static ChaincodeMessage newGetStateMetadataEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_STATE_METADATA, channelId, txId, GetStateMetadata.newBuilder().setCollection(collection).setKey(key).build().toBy...
ChaincodeMessageFactory { protected static ChaincodeMessage newGetStateMetadataEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(GET_STATE_METADATA, channelId, txId, GetStateMetadata.newBuilder().setCollection(collection).setKey(key).build().toBy...
@Test void testNewPutStateEventMessage() { ChaincodeMessageFactory.newPutStateEventMessage(channelId, txId, collection, key, value); }
protected static ChaincodeMessage newPutStateEventMessage(final String channelId, final String txId, final String collection, final String key, final ByteString value) { return newEventMessage(PUT_STATE, channelId, txId, PutState.newBuilder().setCollection(collection).setKey(key).setValue(value).build().toByteString())...
ChaincodeMessageFactory { protected static ChaincodeMessage newPutStateEventMessage(final String channelId, final String txId, final String collection, final String key, final ByteString value) { return newEventMessage(PUT_STATE, channelId, txId, PutState.newBuilder().setCollection(collection).setKey(key).setValue(valu...
ChaincodeMessageFactory { protected static ChaincodeMessage newPutStateEventMessage(final String channelId, final String txId, final String collection, final String key, final ByteString value) { return newEventMessage(PUT_STATE, channelId, txId, PutState.newBuilder().setCollection(collection).setKey(key).setValue(valu...
ChaincodeMessageFactory { protected static ChaincodeMessage newPutStateEventMessage(final String channelId, final String txId, final String collection, final String key, final ByteString value) { return newEventMessage(PUT_STATE, channelId, txId, PutState.newBuilder().setCollection(collection).setKey(key).setValue(valu...
ChaincodeMessageFactory { protected static ChaincodeMessage newPutStateEventMessage(final String channelId, final String txId, final String collection, final String key, final ByteString value) { return newEventMessage(PUT_STATE, channelId, txId, PutState.newBuilder().setCollection(collection).setKey(key).setValue(valu...
@Test void testNewPutStateMetadataEventMessage() { ChaincodeMessageFactory.newPutStateMetadataEventMessage(channelId, txId, collection, key, metakey, value); }
protected static ChaincodeMessage newPutStateMetadataEventMessage(final String channelId, final String txId, final String collection, final String key, final String metakey, final ByteString value) { return newEventMessage(PUT_STATE_METADATA, channelId, txId, PutStateMetadata.newBuilder().setCollection(collection).setK...
ChaincodeMessageFactory { protected static ChaincodeMessage newPutStateMetadataEventMessage(final String channelId, final String txId, final String collection, final String key, final String metakey, final ByteString value) { return newEventMessage(PUT_STATE_METADATA, channelId, txId, PutStateMetadata.newBuilder().setC...
ChaincodeMessageFactory { protected static ChaincodeMessage newPutStateMetadataEventMessage(final String channelId, final String txId, final String collection, final String key, final String metakey, final ByteString value) { return newEventMessage(PUT_STATE_METADATA, channelId, txId, PutStateMetadata.newBuilder().setC...
ChaincodeMessageFactory { protected static ChaincodeMessage newPutStateMetadataEventMessage(final String channelId, final String txId, final String collection, final String key, final String metakey, final ByteString value) { return newEventMessage(PUT_STATE_METADATA, channelId, txId, PutStateMetadata.newBuilder().setC...
ChaincodeMessageFactory { protected static ChaincodeMessage newPutStateMetadataEventMessage(final String channelId, final String txId, final String collection, final String key, final String metakey, final ByteString value) { return newEventMessage(PUT_STATE_METADATA, channelId, txId, PutStateMetadata.newBuilder().setC...
@Test void testNewDeleteStateEventMessage() { ChaincodeMessageFactory.newDeleteStateEventMessage(channelId, txId, collection, key); }
protected static ChaincodeMessage newDeleteStateEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(DEL_STATE, channelId, txId, DelState.newBuilder().setCollection(collection).setKey(key).build().toByteString()); }
ChaincodeMessageFactory { protected static ChaincodeMessage newDeleteStateEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(DEL_STATE, channelId, txId, DelState.newBuilder().setCollection(collection).setKey(key).build().toByteString()); } }
ChaincodeMessageFactory { protected static ChaincodeMessage newDeleteStateEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(DEL_STATE, channelId, txId, DelState.newBuilder().setCollection(collection).setKey(key).build().toByteString()); } private...
ChaincodeMessageFactory { protected static ChaincodeMessage newDeleteStateEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(DEL_STATE, channelId, txId, DelState.newBuilder().setCollection(collection).setKey(key).build().toByteString()); } private...
ChaincodeMessageFactory { protected static ChaincodeMessage newDeleteStateEventMessage(final String channelId, final String txId, final String collection, final String key) { return newEventMessage(DEL_STATE, channelId, txId, DelState.newBuilder().setCollection(collection).setKey(key).build().toByteString()); } private...
@Test void testNewErrorEventMessage() { ChaincodeMessageFactory.newErrorEventMessage(channelId, txId, message); ChaincodeMessageFactory.newErrorEventMessage(channelId, txId, throwable); ChaincodeMessageFactory.newErrorEventMessage(channelId, txId, message, event); }
protected static ChaincodeMessage newErrorEventMessage(final String channelId, final String txId, final Throwable throwable) { return newErrorEventMessage(channelId, txId, printStackTrace(throwable)); }
ChaincodeMessageFactory { protected static ChaincodeMessage newErrorEventMessage(final String channelId, final String txId, final Throwable throwable) { return newErrorEventMessage(channelId, txId, printStackTrace(throwable)); } }
ChaincodeMessageFactory { protected static ChaincodeMessage newErrorEventMessage(final String channelId, final String txId, final Throwable throwable) { return newErrorEventMessage(channelId, txId, printStackTrace(throwable)); } private ChaincodeMessageFactory(); }
ChaincodeMessageFactory { protected static ChaincodeMessage newErrorEventMessage(final String channelId, final String txId, final Throwable throwable) { return newErrorEventMessage(channelId, txId, printStackTrace(throwable)); } private ChaincodeMessageFactory(); }
ChaincodeMessageFactory { protected static ChaincodeMessage newErrorEventMessage(final String channelId, final String txId, final Throwable throwable) { return newErrorEventMessage(channelId, txId, printStackTrace(throwable)); } private ChaincodeMessageFactory(); }
@Test void testNewCompletedEventMessage() { ChaincodeMessageFactory.newCompletedEventMessage(channelId, txId, response, event); }
protected static ChaincodeMessage newCompletedEventMessage(final String channelId, final String txId, final Chaincode.Response response, final ChaincodeEvent event) { final ChaincodeMessage message = newEventMessage(COMPLETED, channelId, txId, toProtoResponse(response).toByteString(), event); return message; }
ChaincodeMessageFactory { protected static ChaincodeMessage newCompletedEventMessage(final String channelId, final String txId, final Chaincode.Response response, final ChaincodeEvent event) { final ChaincodeMessage message = newEventMessage(COMPLETED, channelId, txId, toProtoResponse(response).toByteString(), event); ...
ChaincodeMessageFactory { protected static ChaincodeMessage newCompletedEventMessage(final String channelId, final String txId, final Chaincode.Response response, final ChaincodeEvent event) { final ChaincodeMessage message = newEventMessage(COMPLETED, channelId, txId, toProtoResponse(response).toByteString(), event); ...
ChaincodeMessageFactory { protected static ChaincodeMessage newCompletedEventMessage(final String channelId, final String txId, final Chaincode.Response response, final ChaincodeEvent event) { final ChaincodeMessage message = newEventMessage(COMPLETED, channelId, txId, toProtoResponse(response).toByteString(), event); ...
ChaincodeMessageFactory { protected static ChaincodeMessage newCompletedEventMessage(final String channelId, final String txId, final Chaincode.Response response, final ChaincodeEvent event) { final ChaincodeMessage message = newEventMessage(COMPLETED, channelId, txId, toProtoResponse(response).toByteString(), event); ...
@Test void testNewInvokeChaincodeMessage() { ChaincodeMessageFactory.newInvokeChaincodeMessage(channelId, txId, payload); }
protected static ChaincodeMessage newInvokeChaincodeMessage(final String channelId, final String txId, final ByteString payload) { return newEventMessage(INVOKE_CHAINCODE, channelId, txId, payload, null); }
ChaincodeMessageFactory { protected static ChaincodeMessage newInvokeChaincodeMessage(final String channelId, final String txId, final ByteString payload) { return newEventMessage(INVOKE_CHAINCODE, channelId, txId, payload, null); } }
ChaincodeMessageFactory { protected static ChaincodeMessage newInvokeChaincodeMessage(final String channelId, final String txId, final ByteString payload) { return newEventMessage(INVOKE_CHAINCODE, channelId, txId, payload, null); } private ChaincodeMessageFactory(); }
ChaincodeMessageFactory { protected static ChaincodeMessage newInvokeChaincodeMessage(final String channelId, final String txId, final ByteString payload) { return newEventMessage(INVOKE_CHAINCODE, channelId, txId, payload, null); } private ChaincodeMessageFactory(); }
ChaincodeMessageFactory { protected static ChaincodeMessage newInvokeChaincodeMessage(final String channelId, final String txId, final ByteString payload) { return newEventMessage(INVOKE_CHAINCODE, channelId, txId, payload, null); } private ChaincodeMessageFactory(); }
@Test void testNewRegisterChaincodeMessage() { ChaincodeMessageFactory.newRegisterChaincodeMessage(chaincodeId); }
protected static ChaincodeMessage newRegisterChaincodeMessage(final ChaincodeID chaincodeId) { return ChaincodeMessage.newBuilder().setType(REGISTER).setPayload(chaincodeId.toByteString()).build(); }
ChaincodeMessageFactory { protected static ChaincodeMessage newRegisterChaincodeMessage(final ChaincodeID chaincodeId) { return ChaincodeMessage.newBuilder().setType(REGISTER).setPayload(chaincodeId.toByteString()).build(); } }
ChaincodeMessageFactory { protected static ChaincodeMessage newRegisterChaincodeMessage(final ChaincodeID chaincodeId) { return ChaincodeMessage.newBuilder().setType(REGISTER).setPayload(chaincodeId.toByteString()).build(); } private ChaincodeMessageFactory(); }
ChaincodeMessageFactory { protected static ChaincodeMessage newRegisterChaincodeMessage(final ChaincodeID chaincodeId) { return ChaincodeMessage.newBuilder().setType(REGISTER).setPayload(chaincodeId.toByteString()).build(); } private ChaincodeMessageFactory(); }
ChaincodeMessageFactory { protected static ChaincodeMessage newRegisterChaincodeMessage(final ChaincodeID chaincodeId) { return ChaincodeMessage.newBuilder().setType(REGISTER).setPayload(chaincodeId.toByteString()).build(); } private ChaincodeMessageFactory(); }
@Test void testNewEventMessageTypeStringStringByteString() { ChaincodeMessageFactory.newEventMessage(type, channelId, txId, payload); ChaincodeMessageFactory.newEventMessage(type, channelId, txId, payload, event); }
protected static ChaincodeMessage newEventMessage(final Type type, final String channelId, final String txId, final ByteString payload) { return newEventMessage(type, channelId, txId, payload, null); }
ChaincodeMessageFactory { protected static ChaincodeMessage newEventMessage(final Type type, final String channelId, final String txId, final ByteString payload) { return newEventMessage(type, channelId, txId, payload, null); } }
ChaincodeMessageFactory { protected static ChaincodeMessage newEventMessage(final Type type, final String channelId, final String txId, final ByteString payload) { return newEventMessage(type, channelId, txId, payload, null); } private ChaincodeMessageFactory(); }
ChaincodeMessageFactory { protected static ChaincodeMessage newEventMessage(final Type type, final String channelId, final String txId, final ByteString payload) { return newEventMessage(type, channelId, txId, payload, null); } private ChaincodeMessageFactory(); }
ChaincodeMessageFactory { protected static ChaincodeMessage newEventMessage(final Type type, final String channelId, final String txId, final ByteString payload) { return newEventMessage(type, channelId, txId, payload, null); } private ChaincodeMessageFactory(); }
@Test public void testKeyModificationImpl() { new KeyModificationImpl(KvQueryResult.KeyModification.newBuilder() .setTxId("txid") .setValue(ByteString.copyFromUtf8("value")) .setTimestamp(Timestamp.newBuilder() .setSeconds(1234567890) .setNanos(123456789)) .setIsDelete(true) .build()); }
KeyModificationImpl(final KvQueryResult.KeyModification km) { this.txId = km.getTxId(); this.value = km.getValue(); this.timestamp = Instant.ofEpochSecond(km.getTimestamp().getSeconds(), km.getTimestamp().getNanos()); this.deleted = km.getIsDelete(); }
KeyModificationImpl implements KeyModification { KeyModificationImpl(final KvQueryResult.KeyModification km) { this.txId = km.getTxId(); this.value = km.getValue(); this.timestamp = Instant.ofEpochSecond(km.getTimestamp().getSeconds(), km.getTimestamp().getNanos()); this.deleted = km.getIsDelete(); } }
KeyModificationImpl implements KeyModification { KeyModificationImpl(final KvQueryResult.KeyModification km) { this.txId = km.getTxId(); this.value = km.getValue(); this.timestamp = Instant.ofEpochSecond(km.getTimestamp().getSeconds(), km.getTimestamp().getNanos()); this.deleted = km.getIsDelete(); } KeyModificationImp...
KeyModificationImpl implements KeyModification { KeyModificationImpl(final KvQueryResult.KeyModification km) { this.txId = km.getTxId(); this.value = km.getValue(); this.timestamp = Instant.ofEpochSecond(km.getTimestamp().getSeconds(), km.getTimestamp().getNanos()); this.deleted = km.getIsDelete(); } KeyModificationImp...
KeyModificationImpl implements KeyModification { KeyModificationImpl(final KvQueryResult.KeyModification km) { this.txId = km.getTxId(); this.value = km.getValue(); this.timestamp = Instant.ofEpochSecond(km.getTimestamp().getSeconds(), km.getTimestamp().getNanos()); this.deleted = km.getIsDelete(); } KeyModificationImp...
@Test public void testGetTxId() { final KeyModification km = new KeyModificationImpl(KvQueryResult.KeyModification.newBuilder() .setTxId("txid") .build()); assertThat(km.getTxId(), is(equalTo("txid"))); }
@Override public String getTxId() { return txId; }
KeyModificationImpl implements KeyModification { @Override public String getTxId() { return txId; } }
KeyModificationImpl implements KeyModification { @Override public String getTxId() { return txId; } KeyModificationImpl(final KvQueryResult.KeyModification km); }
KeyModificationImpl implements KeyModification { @Override public String getTxId() { return txId; } KeyModificationImpl(final KvQueryResult.KeyModification km); @Override String getTxId(); @Override byte[] getValue(); @Override String getStringValue(); @Override java.time.Instant getTimestamp(); @Override boolean isDel...
KeyModificationImpl implements KeyModification { @Override public String getTxId() { return txId; } KeyModificationImpl(final KvQueryResult.KeyModification km); @Override String getTxId(); @Override byte[] getValue(); @Override String getStringValue(); @Override java.time.Instant getTimestamp(); @Override boolean isDel...
@Test public void testGetValue() { final KeyModification km = new KeyModificationImpl(KvQueryResult.KeyModification.newBuilder() .setValue(ByteString.copyFromUtf8("value")) .build()); assertThat(km.getValue(), is(equalTo("value".getBytes(UTF_8)))); }
@Override public byte[] getValue() { return value.toByteArray(); }
KeyModificationImpl implements KeyModification { @Override public byte[] getValue() { return value.toByteArray(); } }
KeyModificationImpl implements KeyModification { @Override public byte[] getValue() { return value.toByteArray(); } KeyModificationImpl(final KvQueryResult.KeyModification km); }
KeyModificationImpl implements KeyModification { @Override public byte[] getValue() { return value.toByteArray(); } KeyModificationImpl(final KvQueryResult.KeyModification km); @Override String getTxId(); @Override byte[] getValue(); @Override String getStringValue(); @Override java.time.Instant getTimestamp(); @Overri...
KeyModificationImpl implements KeyModification { @Override public byte[] getValue() { return value.toByteArray(); } KeyModificationImpl(final KvQueryResult.KeyModification km); @Override String getTxId(); @Override byte[] getValue(); @Override String getStringValue(); @Override java.time.Instant getTimestamp(); @Overri...
@Test public void testGetStringValue() { final KeyModification km = new KeyModificationImpl(KvQueryResult.KeyModification.newBuilder() .setValue(ByteString.copyFromUtf8("value")) .build()); assertThat(km.getStringValue(), is(equalTo("value"))); }
@Override public String getStringValue() { return value.toStringUtf8(); }
KeyModificationImpl implements KeyModification { @Override public String getStringValue() { return value.toStringUtf8(); } }
KeyModificationImpl implements KeyModification { @Override public String getStringValue() { return value.toStringUtf8(); } KeyModificationImpl(final KvQueryResult.KeyModification km); }
KeyModificationImpl implements KeyModification { @Override public String getStringValue() { return value.toStringUtf8(); } KeyModificationImpl(final KvQueryResult.KeyModification km); @Override String getTxId(); @Override byte[] getValue(); @Override String getStringValue(); @Override java.time.Instant getTimestamp(); ...
KeyModificationImpl implements KeyModification { @Override public String getStringValue() { return value.toStringUtf8(); } KeyModificationImpl(final KvQueryResult.KeyModification km); @Override String getTxId(); @Override byte[] getValue(); @Override String getStringValue(); @Override java.time.Instant getTimestamp(); ...
@Test public void testGetTimestamp() { final KeyModification km = new KeyModificationImpl(KvQueryResult.KeyModification.newBuilder() .setTimestamp(Timestamp.newBuilder() .setSeconds(1234567890L) .setNanos(123456789)) .build()); assertThat(km.getTimestamp(), hasProperty("epochSecond", equalTo(1234567890L))); assertThat(...
@Override public java.time.Instant getTimestamp() { return timestamp; }
KeyModificationImpl implements KeyModification { @Override public java.time.Instant getTimestamp() { return timestamp; } }
KeyModificationImpl implements KeyModification { @Override public java.time.Instant getTimestamp() { return timestamp; } KeyModificationImpl(final KvQueryResult.KeyModification km); }
KeyModificationImpl implements KeyModification { @Override public java.time.Instant getTimestamp() { return timestamp; } KeyModificationImpl(final KvQueryResult.KeyModification km); @Override String getTxId(); @Override byte[] getValue(); @Override String getStringValue(); @Override java.time.Instant getTimestamp(); @O...
KeyModificationImpl implements KeyModification { @Override public java.time.Instant getTimestamp() { return timestamp; } KeyModificationImpl(final KvQueryResult.KeyModification km); @Override String getTxId(); @Override byte[] getValue(); @Override String getStringValue(); @Override java.time.Instant getTimestamp(); @O...
@Test public void testIsDeleted() { Stream.of(true, false) .forEach(b -> { final KeyModification km = new KeyModificationImpl(KvQueryResult.KeyModification.newBuilder() .setIsDelete(b) .build()); assertThat(km.isDeleted(), is(b)); }); }
@Override public boolean isDeleted() { return deleted; }
KeyModificationImpl implements KeyModification { @Override public boolean isDeleted() { return deleted; } }
KeyModificationImpl implements KeyModification { @Override public boolean isDeleted() { return deleted; } KeyModificationImpl(final KvQueryResult.KeyModification km); }
KeyModificationImpl implements KeyModification { @Override public boolean isDeleted() { return deleted; } KeyModificationImpl(final KvQueryResult.KeyModification km); @Override String getTxId(); @Override byte[] getValue(); @Override String getStringValue(); @Override java.time.Instant getTimestamp(); @Override boolean...
KeyModificationImpl implements KeyModification { @Override public boolean isDeleted() { return deleted; } KeyModificationImpl(final KvQueryResult.KeyModification km); @Override String getTxId(); @Override byte[] getValue(); @Override String getStringValue(); @Override java.time.Instant getTimestamp(); @Override boolean...
@Test public void testHashCode() { final KeyModification km = new KeyModificationImpl(KvQueryResult.KeyModification.newBuilder() .setIsDelete(false) .build()); int expectedHashCode = 31; expectedHashCode = expectedHashCode + 1237; expectedHashCode = expectedHashCode * 31 + Instant.EPOCH.hashCode(); expectedHashCode = e...
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (deleted ? 1231 : 1237); result = prime * result + ((timestamp == null) ? 0 : timestamp.hashCode()); result = prime * result + ((txId == null) ? 0 : txId.hashCode()); result = prime * result + ((value == null) ? 0 : value....
KeyModificationImpl implements KeyModification { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (deleted ? 1231 : 1237); result = prime * result + ((timestamp == null) ? 0 : timestamp.hashCode()); result = prime * result + ((txId == null) ? 0 : txId.hashCode()); result...
KeyModificationImpl implements KeyModification { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (deleted ? 1231 : 1237); result = prime * result + ((timestamp == null) ? 0 : timestamp.hashCode()); result = prime * result + ((txId == null) ? 0 : txId.hashCode()); result...
KeyModificationImpl implements KeyModification { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (deleted ? 1231 : 1237); result = prime * result + ((timestamp == null) ? 0 : timestamp.hashCode()); result = prime * result + ((txId == null) ? 0 : txId.hashCode()); result...
KeyModificationImpl implements KeyModification { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (deleted ? 1231 : 1237); result = prime * result + ((timestamp == null) ? 0 : timestamp.hashCode()); result = prime * result + ((txId == null) ? 0 : txId.hashCode()); result...
@Test public void testEquals() { final KeyModification km1 = new KeyModificationImpl(KvQueryResult.KeyModification.newBuilder() .setIsDelete(false) .build()); final KeyModification km2 = new KeyModificationImpl(KvQueryResult.KeyModification.newBuilder() .setIsDelete(true) .build()); final KeyModification km3 = new KeyM...
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final KeyModificationImpl other = (KeyModificationImpl) obj; if (deleted != other.deleted) { return false; } if (!timestamp.equals(other.timestamp)...
KeyModificationImpl implements KeyModification { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final KeyModificationImpl other = (KeyModificationImpl) obj; if (deleted != other.deleted) { retur...
KeyModificationImpl implements KeyModification { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final KeyModificationImpl other = (KeyModificationImpl) obj; if (deleted != other.deleted) { retur...
KeyModificationImpl implements KeyModification { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final KeyModificationImpl other = (KeyModificationImpl) obj; if (deleted != other.deleted) { retur...
KeyModificationImpl implements KeyModification { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final KeyModificationImpl other = (KeyModificationImpl) obj; if (deleted != other.deleted) { retur...
@Test public void getMetadata() { final QueryResultsIteratorWithMetadataImpl<Integer> testIter = new QueryResultsIteratorWithMetadataImpl<>(null, "", "", prepareQueryResponse().toByteString(), queryResultBytesToKv); assertThat(testIter.getMetadata().getBookmark(), is("asdf")); assertThat(testIter.getMetadata().getFetch...
@Override public ChaincodeShim.QueryResponseMetadata getMetadata() { return metadata; }
QueryResultsIteratorWithMetadataImpl extends QueryResultsIteratorImpl<T> implements QueryResultsIteratorWithMetadata<T> { @Override public ChaincodeShim.QueryResponseMetadata getMetadata() { return metadata; } }
QueryResultsIteratorWithMetadataImpl extends QueryResultsIteratorImpl<T> implements QueryResultsIteratorWithMetadata<T> { @Override public ChaincodeShim.QueryResponseMetadata getMetadata() { return metadata; } QueryResultsIteratorWithMetadataImpl(final ChaincodeInvocationTask handler, final String channelId, final Stri...
QueryResultsIteratorWithMetadataImpl extends QueryResultsIteratorImpl<T> implements QueryResultsIteratorWithMetadata<T> { @Override public ChaincodeShim.QueryResponseMetadata getMetadata() { return metadata; } QueryResultsIteratorWithMetadataImpl(final ChaincodeInvocationTask handler, final String channelId, final Stri...
QueryResultsIteratorWithMetadataImpl extends QueryResultsIteratorImpl<T> implements QueryResultsIteratorWithMetadata<T> { @Override public ChaincodeShim.QueryResponseMetadata getMetadata() { return metadata; } QueryResultsIteratorWithMetadataImpl(final ChaincodeInvocationTask handler, final String channelId, final Stri...
@Test public void testNewSuccessResponseEmpty() { final org.hyperledger.fabric.shim.Chaincode.Response response = ResponseUtils.newSuccessResponse(); assertEquals("Response status is incorrect", response.getStatus(), org.hyperledger.fabric.shim.Chaincode.Response.Status.SUCCESS); assertNull("Response message in not nul...
@Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void sta...
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void sta...
@Test public void logger() { Logger.getLogger(LoggerTest.class); Logger.getLogger(LoggerTest.class.getName()); }
protected Logger(final String name) { super(name, null); this.setParent(java.util.logging.Logger.getLogger("org.hyperledger.fabric")); }
Logger extends java.util.logging.Logger { protected Logger(final String name) { super(name, null); this.setParent(java.util.logging.Logger.getLogger("org.hyperledger.fabric")); } }
Logger extends java.util.logging.Logger { protected Logger(final String name) { super(name, null); this.setParent(java.util.logging.Logger.getLogger("org.hyperledger.fabric")); } protected Logger(final String name); }
Logger extends java.util.logging.Logger { protected Logger(final String name) { super(name, null); this.setParent(java.util.logging.Logger.getLogger("org.hyperledger.fabric")); } protected Logger(final String name); static Logger getLogger(final String name); void debug(final Supplier<String> msgSupplier); void debug(...
Logger extends java.util.logging.Logger { protected Logger(final String name) { super(name, null); this.setParent(java.util.logging.Logger.getLogger("org.hyperledger.fabric")); } protected Logger(final String name); static Logger getLogger(final String name); void debug(final Supplier<String> msgSupplier); void debug(...
@Test public void testNewSuccessResponseWithMessage() { final org.hyperledger.fabric.shim.Chaincode.Response response = ResponseUtils.newSuccessResponse("Simple message"); assertEquals("Response status is incorrect", response.getStatus(), org.hyperledger.fabric.shim.Chaincode.Response.Status.SUCCESS); assertEquals("Res...
@Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void sta...
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void sta...
@Test public void testNewSuccessResponseWithPayload() { final org.hyperledger.fabric.shim.Chaincode.Response response = ResponseUtils.newSuccessResponse("Simple payload".getBytes(Charset.defaultCharset())); assertEquals("Response status is incorrect", response.getStatus(), org.hyperledger.fabric.shim.Chaincode.Response...
@Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void sta...
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void sta...
@Test public void testNewSuccessResponseWithMessageAndPayload() { final org.hyperledger.fabric.shim.Chaincode.Response response = ResponseUtils.newSuccessResponse("Simple message", "Simple payload".getBytes(Charset.defaultCharset())); assertEquals("Response status is incorrect", response.getStatus(), org.hyperledger.fa...
@Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void sta...
ChaincodeBase implements Chaincode { @Deprecated protected static Response newSuccessResponse(final String message, final byte[] payload) { return ResponseUtils.newSuccessResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void sta...
@Test public void testNewErrorResponseEmpty() { final org.hyperledger.fabric.shim.Chaincode.Response response = ResponseUtils.newErrorResponse(); assertEquals("Response status is incorrect", response.getStatus(), org.hyperledger.fabric.shim.Chaincode.Response.Status.INTERNAL_SERVER_ERROR); assertNull("Response message ...
@Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void start(f...
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void start(f...
@Test public void testNewErrorResponseWithMessage() { final org.hyperledger.fabric.shim.Chaincode.Response response = ResponseUtils.newErrorResponse("Simple message"); assertEquals("Response status is incorrect", response.getStatus(), org.hyperledger.fabric.shim.Chaincode.Response.Status.INTERNAL_SERVER_ERROR); assertE...
@Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void start(f...
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void start(f...
@Test public void testNewErrorResponseWithPayload() { final org.hyperledger.fabric.shim.Chaincode.Response response = ResponseUtils.newErrorResponse("Simple payload".getBytes(Charset.defaultCharset())); assertEquals("Response status is incorrect", response.getStatus(), org.hyperledger.fabric.shim.Chaincode.Response.Sta...
@Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void start(f...
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void start(f...
@Test public void testNewErrorResponseWithMessageAndPayload() { final org.hyperledger.fabric.shim.Chaincode.Response response = ResponseUtils.newErrorResponse("Simple message", "Simple payload".getBytes(Charset.defaultCharset())); assertEquals("Response status is incorrect", response.getStatus(), org.hyperledger.fabric...
@Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void start(f...
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void start(f...
@Test public void testNewErrorResponseWithException() { final org.hyperledger.fabric.shim.Chaincode.Response response = ResponseUtils.newErrorResponse(new Exception("Simple exception")); assertEquals("Response status is incorrect", response.getStatus(), org.hyperledger.fabric.shim.Chaincode.Response.Status.INTERNAL_SER...
@Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void start(f...
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void start(f...
@Test public void testNewErrorResponseWithChaincodeException() { final org.hyperledger.fabric.shim.Chaincode.Response response = ResponseUtils.newErrorResponse(new ChaincodeException("Chaincode exception")); assertEquals("Response status is incorrect", response.getStatus(), org.hyperledger.fabric.shim.Chaincode.Respons...
@Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } }
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void start(f...
ChaincodeBase implements Chaincode { @Deprecated protected static Response newErrorResponse(final String message, final byte[] payload) { return ResponseUtils.newErrorResponse(message, payload); } @Override abstract Response init(ChaincodeStub stub); @Override abstract Response invoke(ChaincodeStub stub); void start(f...
@Test public void testUnsetOptionId() { final ChaincodeBase cb = new EmptyChaincode(); thrown.expect(IllegalArgumentException.class); thrown.expectMessage(Matchers.containsString("The chaincode id must be specified")); cb.validateOptions(); }
protected final void validateOptions() { if (this.id == null) { throw new IllegalArgumentException(format( "The chaincode id must be specified using either the -i or --i command line options or the %s environment variable.", CORE_CHAINCODE_ID_NAME)); } if (this.tlsEnabled) { if (tlsClientCertPath == null) { throw new I...
ChaincodeBase implements Chaincode { protected final void validateOptions() { if (this.id == null) { throw new IllegalArgumentException(format( "The chaincode id must be specified using either the -i or --i command line options or the %s environment variable.", CORE_CHAINCODE_ID_NAME)); } if (this.tlsEnabled) { if (tls...
ChaincodeBase implements Chaincode { protected final void validateOptions() { if (this.id == null) { throw new IllegalArgumentException(format( "The chaincode id must be specified using either the -i or --i command line options or the %s environment variable.", CORE_CHAINCODE_ID_NAME)); } if (this.tlsEnabled) { if (tls...
ChaincodeBase implements Chaincode { protected final void validateOptions() { if (this.id == null) { throw new IllegalArgumentException(format( "The chaincode id must be specified using either the -i or --i command line options or the %s environment variable.", CORE_CHAINCODE_ID_NAME)); } if (this.tlsEnabled) { if (tls...
ChaincodeBase implements Chaincode { protected final void validateOptions() { if (this.id == null) { throw new IllegalArgumentException(format( "The chaincode id must be specified using either the -i or --i command line options or the %s environment variable.", CORE_CHAINCODE_ID_NAME)); } if (this.tlsEnabled) { if (tls...
@Test public void testValidateSimpleKeys() { CompositeKey.validateSimpleKeys("abc", "def", "ghi"); }
public static void validateSimpleKeys(final String... keys) { for (final String key : keys) { if (!key.isEmpty() && key.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forSimpleKey(key); } } }
CompositeKey { public static void validateSimpleKeys(final String... keys) { for (final String key : keys) { if (!key.isEmpty() && key.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forSimpleKey(key); } } } }
CompositeKey { public static void validateSimpleKeys(final String... keys) { for (final String key : keys) { if (!key.isEmpty() && key.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forSimpleKey(key); } } } CompositeKey(final String objectType, final String... attributes); CompositeKey(final String objectT...
CompositeKey { public static void validateSimpleKeys(final String... keys) { for (final String key : keys) { if (!key.isEmpty() && key.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forSimpleKey(key); } } } CompositeKey(final String objectType, final String... attributes); CompositeKey(final String objectT...
CompositeKey { public static void validateSimpleKeys(final String... keys) { for (final String key : keys) { if (!key.isEmpty() && key.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forSimpleKey(key); } } } CompositeKey(final String objectType, final String... attributes); CompositeKey(final String objectT...
@Test @Ignore public void testNewChannelBuilder() throws Exception { final ChaincodeBase cb = new EmptyChaincode(); environmentVariables.set("CORE_CHAINCODE_ID_NAME", "mycc"); environmentVariables.set("CORE_PEER_ADDRESS", "localhost:7052"); environmentVariables.set("CORE_PEER_TLS_ENABLED", "true"); environmentVariables...
@SuppressWarnings("deprecation") final ManagedChannelBuilder<?> newChannelBuilder() throws IOException { final NettyChannelBuilder builder = NettyChannelBuilder.forAddress(host, port); LOGGER.info("Configuring channel connection to peer."); if (tlsEnabled) { builder.negotiationType(NegotiationType.TLS); builder.sslCont...
ChaincodeBase implements Chaincode { @SuppressWarnings("deprecation") final ManagedChannelBuilder<?> newChannelBuilder() throws IOException { final NettyChannelBuilder builder = NettyChannelBuilder.forAddress(host, port); LOGGER.info("Configuring channel connection to peer."); if (tlsEnabled) { builder.negotiationType(...
ChaincodeBase implements Chaincode { @SuppressWarnings("deprecation") final ManagedChannelBuilder<?> newChannelBuilder() throws IOException { final NettyChannelBuilder builder = NettyChannelBuilder.forAddress(host, port); LOGGER.info("Configuring channel connection to peer."); if (tlsEnabled) { builder.negotiationType(...
ChaincodeBase implements Chaincode { @SuppressWarnings("deprecation") final ManagedChannelBuilder<?> newChannelBuilder() throws IOException { final NettyChannelBuilder builder = NettyChannelBuilder.forAddress(host, port); LOGGER.info("Configuring channel connection to peer."); if (tlsEnabled) { builder.negotiationType(...
ChaincodeBase implements Chaincode { @SuppressWarnings("deprecation") final ManagedChannelBuilder<?> newChannelBuilder() throws IOException { final NettyChannelBuilder builder = NettyChannelBuilder.forAddress(host, port); LOGGER.info("Configuring channel connection to peer."); if (tlsEnabled) { builder.negotiationType(...
@Test public void testInitializeLogging() { final ChaincodeBase cb = new EmptyChaincode(); cb.processEnvironmentOptions(); cb.initializeLogging(); assertEquals("Wrong log level for org.hyperledger.fabric.shim ", Level.INFO, Logger.getLogger("org.hyperledger.fabric.shim").getLevel()); assertEquals("Wrong log level for "...
protected final void initializeLogging() { System.setProperty("java.util.logging.SimpleFormatter.format", "%1$tH:%1$tM:%1$tS:%1$tL %4$-7.7s %2$-80.80s %5$s%6$s%n"); final Logger rootLogger = Logger.getLogger(""); for (final java.util.logging.Handler handler : rootLogger.getHandlers()) { handler.setLevel(ALL); handler.s...
ChaincodeBase implements Chaincode { protected final void initializeLogging() { System.setProperty("java.util.logging.SimpleFormatter.format", "%1$tH:%1$tM:%1$tS:%1$tL %4$-7.7s %2$-80.80s %5$s%6$s%n"); final Logger rootLogger = Logger.getLogger(""); for (final java.util.logging.Handler handler : rootLogger.getHandlers(...
ChaincodeBase implements Chaincode { protected final void initializeLogging() { System.setProperty("java.util.logging.SimpleFormatter.format", "%1$tH:%1$tM:%1$tS:%1$tL %4$-7.7s %2$-80.80s %5$s%6$s%n"); final Logger rootLogger = Logger.getLogger(""); for (final java.util.logging.Handler handler : rootLogger.getHandlers(...
ChaincodeBase implements Chaincode { protected final void initializeLogging() { System.setProperty("java.util.logging.SimpleFormatter.format", "%1$tH:%1$tM:%1$tS:%1$tL %4$-7.7s %2$-80.80s %5$s%6$s%n"); final Logger rootLogger = Logger.getLogger(""); for (final java.util.logging.Handler handler : rootLogger.getHandlers(...
ChaincodeBase implements Chaincode { protected final void initializeLogging() { System.setProperty("java.util.logging.SimpleFormatter.format", "%1$tH:%1$tM:%1$tS:%1$tL %4$-7.7s %2$-80.80s %5$s%6$s%n"); final Logger rootLogger = Logger.getLogger(""); for (final java.util.logging.Handler handler : rootLogger.getHandlers(...
@Test public void getInstance() { final ContextFactory f1 = ContextFactory.getInstance(); final ContextFactory f2 = ContextFactory.getInstance(); assertThat(f1, sameInstance(f2)); }
public static synchronized ContextFactory getInstance() { if (cf == null) { cf = new ContextFactory(); } return cf; }
ContextFactory { public static synchronized ContextFactory getInstance() { if (cf == null) { cf = new ContextFactory(); } return cf; } }
ContextFactory { public static synchronized ContextFactory getInstance() { if (cf == null) { cf = new ContextFactory(); } return cf; } }
ContextFactory { public static synchronized ContextFactory getInstance() { if (cf == null) { cf = new ContextFactory(); } return cf; } static synchronized ContextFactory getInstance(); Context createContext(final ChaincodeStub stub); }
ContextFactory { public static synchronized ContextFactory getInstance() { if (cf == null) { cf = new ContextFactory(); } return cf; } static synchronized ContextFactory getInstance(); Context createContext(final ChaincodeStub stub); }
@Test public void createContext() { final ChaincodeStub stub = new ChaincodeStubNaiveImpl(); final Context ctx = ContextFactory.getInstance().createContext(stub); assertThat(stub.getArgs(), is(equalTo(ctx.getStub().getArgs()))); assertThat(stub.getStringArgs(), is(equalTo(ctx.getStub().getStringArgs()))); assertThat(st...
public Context createContext(final ChaincodeStub stub) { final Context newContext = new Context(stub); return newContext; }
ContextFactory { public Context createContext(final ChaincodeStub stub) { final Context newContext = new Context(stub); return newContext; } }
ContextFactory { public Context createContext(final ChaincodeStub stub) { final Context newContext = new Context(stub); return newContext; } }
ContextFactory { public Context createContext(final ChaincodeStub stub) { final Context newContext = new Context(stub); return newContext; } static synchronized ContextFactory getInstance(); Context createContext(final ChaincodeStub stub); }
ContextFactory { public Context createContext(final ChaincodeStub stub) { final Context newContext = new Context(stub); return newContext; } static synchronized ContextFactory getInstance(); Context createContext(final ChaincodeStub stub); }
@Test public void getInstance() { final ChaincodeStub stub = new ChaincodeStubNaiveImpl(); final Context context1 = new Context(stub); final Context context2 = new Context(stub); assertThat(context1.getStub(), sameInstance(context2.getStub())); }
public ChaincodeStub getStub() { return this.stub; }
Context { public ChaincodeStub getStub() { return this.stub; } }
Context { public ChaincodeStub getStub() { return this.stub; } Context(final ChaincodeStub stub); }
Context { public ChaincodeStub getStub() { return this.stub; } Context(final ChaincodeStub stub); ChaincodeStub getStub(); ClientIdentity getClientIdentity(); }
Context { public ChaincodeStub getStub() { return this.stub; } Context(final ChaincodeStub stub); ChaincodeStub getStub(); ClientIdentity getClientIdentity(); }
@Test public void getSetClientIdentity() { final ChaincodeStub stub = new ChaincodeStubNaiveImpl(); final Context context = ContextFactory.getInstance().createContext(stub); assertThat(context.getClientIdentity(), sameInstance(context.clientIdentity)); }
public ClientIdentity getClientIdentity() { return this.clientIdentity; }
Context { public ClientIdentity getClientIdentity() { return this.clientIdentity; } }
Context { public ClientIdentity getClientIdentity() { return this.clientIdentity; } Context(final ChaincodeStub stub); }
Context { public ClientIdentity getClientIdentity() { return this.clientIdentity; } Context(final ChaincodeStub stub); ChaincodeStub getStub(); ClientIdentity getClientIdentity(); }
Context { public ClientIdentity getClientIdentity() { return this.clientIdentity; } Context(final ChaincodeStub stub); ChaincodeStub getStub(); ClientIdentity getClientIdentity(); }
@Test public void testCreateAndScan() { final ContractRouter r = new ContractRouter(new String[] {"-a", "127.0.0.1:7052", "-i", "testId"}); r.findAllContracts(); final ChaincodeStub s = new ChaincodeStubNaiveImpl(); final List<String> args = new ArrayList<>(); args.add("samplecontract:t1"); args.add("asdf"); ((Chaincod...
protected void findAllContracts() { registry.findAndSetContracts(this.typeRegistry); }
ContractRouter extends ChaincodeBase { protected void findAllContracts() { registry.findAndSetContracts(this.typeRegistry); } }
ContractRouter extends ChaincodeBase { protected void findAllContracts() { registry.findAndSetContracts(this.typeRegistry); } ContractRouter(final String[] args); }
ContractRouter extends ChaincodeBase { protected void findAllContracts() { registry.findAndSetContracts(this.typeRegistry); } ContractRouter(final String[] args); @Override Response invoke(final ChaincodeStub stub); @Override Response init(final ChaincodeStub stub); static void main(final String[] args); }
ContractRouter extends ChaincodeBase { protected void findAllContracts() { registry.findAndSetContracts(this.typeRegistry); } ContractRouter(final String[] args); @Override Response invoke(final ChaincodeStub stub); @Override Response init(final ChaincodeStub stub); static void main(final String[] args); }
@Test public void testInit() { final ContractRouter r = new ContractRouter(new String[] {"-a", "127.0.0.1:7052", "-i", "testId"}); r.findAllContracts(); final ChaincodeStub s = new ChaincodeStubNaiveImpl(); final List<String> args = new ArrayList<>(); args.add("samplecontract:t1"); args.add("asdf"); ((ChaincodeStubNaiv...
@Override public Response init(final ChaincodeStub stub) { return processRequest(stub); }
ContractRouter extends ChaincodeBase { @Override public Response init(final ChaincodeStub stub) { return processRequest(stub); } }
ContractRouter extends ChaincodeBase { @Override public Response init(final ChaincodeStub stub) { return processRequest(stub); } ContractRouter(final String[] args); }
ContractRouter extends ChaincodeBase { @Override public Response init(final ChaincodeStub stub) { return processRequest(stub); } ContractRouter(final String[] args); @Override Response invoke(final ChaincodeStub stub); @Override Response init(final ChaincodeStub stub); static void main(final String[] args); }
ContractRouter extends ChaincodeBase { @Override public Response init(final ChaincodeStub stub) { return processRequest(stub); } ContractRouter(final String[] args); @Override Response invoke(final ChaincodeStub stub); @Override Response init(final ChaincodeStub stub); static void main(final String[] args); }
@Test public void putIfNotNull() { final TypeSchema ts = new TypeSchema(); System.out.println("Key - value"); ts.putIfNotNull("Key", "value"); System.out.println("Key - null"); final String nullstr = null; ts.putIfNotNull("Key", nullstr); assertThat(ts.get("Key"), equalTo("value")); System.out.println("Key - <empty>");...
String putIfNotNull(final String key, final String value) { return (String) this.putInternal(key, value); }
TypeSchema extends HashMap<String, Object> { String putIfNotNull(final String key, final String value) { return (String) this.putInternal(key, value); } }
TypeSchema extends HashMap<String, Object> { String putIfNotNull(final String key, final String value) { return (String) this.putInternal(key, value); } TypeSchema(); }
TypeSchema extends HashMap<String, Object> { String putIfNotNull(final String key, final String value) { return (String) this.putInternal(key, value); } TypeSchema(); String getType(); TypeSchema getItems(); String getRef(); String getFormat(); Class<?> getTypeClass(final TypeRegistry typeRegistry); static TypeSchema t...
TypeSchema extends HashMap<String, Object> { String putIfNotNull(final String key, final String value) { return (String) this.putInternal(key, value); } TypeSchema(); String getType(); TypeSchema getItems(); String getRef(); String getFormat(); Class<?> getTypeClass(final TypeRegistry typeRegistry); static TypeSchema t...
@Test public void getType() { final TypeSchema ts = new TypeSchema(); ts.put("type", "MyType"); assertThat(ts.getType(), equalTo("MyType")); final TypeSchema wrapper = new TypeSchema(); wrapper.put("schema", ts); assertThat(wrapper.getType(), equalTo("MyType")); }
public String getType() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (String) intermediateMap.get("type"); } return (String) this.get("type"); }
TypeSchema extends HashMap<String, Object> { public String getType() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (String) intermediateMap.get("type"); } return (String) this.get("type"); } }
TypeSchema extends HashMap<String, Object> { public String getType() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (String) intermediateMap.get("type"); } return (String) this.get("type"); } TypeSchema(); }
TypeSchema extends HashMap<String, Object> { public String getType() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (String) intermediateMap.get("type"); } return (String) this.get("type"); } TypeSchema(); String getType(); TypeSchema getItems(); String getR...
TypeSchema extends HashMap<String, Object> { public String getType() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (String) intermediateMap.get("type"); } return (String) this.get("type"); } TypeSchema(); String getType(); TypeSchema getItems(); String getR...
@Test(expected = CompositeKeyFormatException.class) public void testValidateSimpleKeysException() throws Exception { CompositeKey.validateSimpleKeys("\u0000abc"); }
public static void validateSimpleKeys(final String... keys) { for (final String key : keys) { if (!key.isEmpty() && key.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forSimpleKey(key); } } }
CompositeKey { public static void validateSimpleKeys(final String... keys) { for (final String key : keys) { if (!key.isEmpty() && key.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forSimpleKey(key); } } } }
CompositeKey { public static void validateSimpleKeys(final String... keys) { for (final String key : keys) { if (!key.isEmpty() && key.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forSimpleKey(key); } } } CompositeKey(final String objectType, final String... attributes); CompositeKey(final String objectT...
CompositeKey { public static void validateSimpleKeys(final String... keys) { for (final String key : keys) { if (!key.isEmpty() && key.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forSimpleKey(key); } } } CompositeKey(final String objectType, final String... attributes); CompositeKey(final String objectT...
CompositeKey { public static void validateSimpleKeys(final String... keys) { for (final String key : keys) { if (!key.isEmpty() && key.startsWith(NAMESPACE)) { throw CompositeKeyFormatException.forSimpleKey(key); } } } CompositeKey(final String objectType, final String... attributes); CompositeKey(final String objectT...
@Test public void getFormat() { final TypeSchema ts = new TypeSchema(); ts.put("format", "MyFormat"); assertThat(ts.getFormat(), equalTo("MyFormat")); final TypeSchema wrapper = new TypeSchema(); wrapper.put("schema", ts); assertThat(wrapper.getFormat(), equalTo("MyFormat")); }
public String getFormat() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (String) intermediateMap.get("format"); } return (String) this.get("format"); }
TypeSchema extends HashMap<String, Object> { public String getFormat() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (String) intermediateMap.get("format"); } return (String) this.get("format"); } }
TypeSchema extends HashMap<String, Object> { public String getFormat() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (String) intermediateMap.get("format"); } return (String) this.get("format"); } TypeSchema(); }
TypeSchema extends HashMap<String, Object> { public String getFormat() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (String) intermediateMap.get("format"); } return (String) this.get("format"); } TypeSchema(); String getType(); TypeSchema getItems(); Strin...
TypeSchema extends HashMap<String, Object> { public String getFormat() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (String) intermediateMap.get("format"); } return (String) this.get("format"); } TypeSchema(); String getType(); TypeSchema getItems(); Strin...
@Test public void getRef() { final TypeSchema ts = new TypeSchema(); ts.put("$ref", "#/ref/to/MyType"); assertThat(ts.getRef(), equalTo("#/ref/to/MyType")); final TypeSchema wrapper = new TypeSchema(); wrapper.put("schema", ts); assertThat(wrapper.getRef(), equalTo("#/ref/to/MyType")); }
public String getRef() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (String) intermediateMap.get("$ref"); } return (String) this.get("$ref"); }
TypeSchema extends HashMap<String, Object> { public String getRef() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (String) intermediateMap.get("$ref"); } return (String) this.get("$ref"); } }
TypeSchema extends HashMap<String, Object> { public String getRef() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (String) intermediateMap.get("$ref"); } return (String) this.get("$ref"); } TypeSchema(); }
TypeSchema extends HashMap<String, Object> { public String getRef() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (String) intermediateMap.get("$ref"); } return (String) this.get("$ref"); } TypeSchema(); String getType(); TypeSchema getItems(); String getRe...
TypeSchema extends HashMap<String, Object> { public String getRef() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (String) intermediateMap.get("$ref"); } return (String) this.get("$ref"); } TypeSchema(); String getType(); TypeSchema getItems(); String getRe...
@Test public void getItems() { final TypeSchema ts1 = new TypeSchema(); final TypeSchema ts = new TypeSchema(); ts.put("items", ts1); assertThat(ts.getItems(), equalTo(ts1)); final TypeSchema wrapper = new TypeSchema(); wrapper.put("schema", ts); assertThat(wrapper.getItems(), equalTo(ts1)); }
public TypeSchema getItems() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (TypeSchema) intermediateMap.get("items"); } return (TypeSchema) this.get("items"); }
TypeSchema extends HashMap<String, Object> { public TypeSchema getItems() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (TypeSchema) intermediateMap.get("items"); } return (TypeSchema) this.get("items"); } }
TypeSchema extends HashMap<String, Object> { public TypeSchema getItems() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (TypeSchema) intermediateMap.get("items"); } return (TypeSchema) this.get("items"); } TypeSchema(); }
TypeSchema extends HashMap<String, Object> { public TypeSchema getItems() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (TypeSchema) intermediateMap.get("items"); } return (TypeSchema) this.get("items"); } TypeSchema(); String getType(); TypeSchema getItems...
TypeSchema extends HashMap<String, Object> { public TypeSchema getItems() { if (this.containsKey("schema")) { final Map<?, ?> intermediateMap = (Map<?, ?>) this.get("schema"); return (TypeSchema) intermediateMap.get("items"); } return (TypeSchema) this.get("items"); } TypeSchema(); String getType(); TypeSchema getItems...
@Test public void getTypeClass() { final TypeSchema ts = new TypeSchema(); ts.put("type", "string"); final TypeRegistry mockRegistry = new TypeRegistryImpl(); assertThat(ts.getTypeClass(mockRegistry), equalTo(String.class)); ts.put("type", "integer"); ts.put("format", "int8"); assertThat(ts.getTypeClass(mockRegistry), ...
public Class<?> getTypeClass(final TypeRegistry typeRegistry) { Class<?> clz = null; String type = getType(); if (type == null) { type = "object"; } if (type.contentEquals("string")) { final String format = getFormat(); if (format != null && format.contentEquals("uint16")) { clz = char.class; } else { clz = String.clas...
TypeSchema extends HashMap<String, Object> { public Class<?> getTypeClass(final TypeRegistry typeRegistry) { Class<?> clz = null; String type = getType(); if (type == null) { type = "object"; } if (type.contentEquals("string")) { final String format = getFormat(); if (format != null && format.contentEquals("uint16")) {...
TypeSchema extends HashMap<String, Object> { public Class<?> getTypeClass(final TypeRegistry typeRegistry) { Class<?> clz = null; String type = getType(); if (type == null) { type = "object"; } if (type.contentEquals("string")) { final String format = getFormat(); if (format != null && format.contentEquals("uint16")) {...
TypeSchema extends HashMap<String, Object> { public Class<?> getTypeClass(final TypeRegistry typeRegistry) { Class<?> clz = null; String type = getType(); if (type == null) { type = "object"; } if (type.contentEquals("string")) { final String format = getFormat(); if (format != null && format.contentEquals("uint16")) {...
TypeSchema extends HashMap<String, Object> { public Class<?> getTypeClass(final TypeRegistry typeRegistry) { Class<?> clz = null; String type = getType(); if (type == null) { type = "object"; } if (type.contentEquals("string")) { final String format = getFormat(); if (format != null && format.contentEquals("uint16")) {...