use of org.apache.ignite.marshaller.MarshallerContextTestImpl in project ignite by apache.
the class OptimizedMarshallerTest method marshaller.
/**
* @return Marshaller.
*/
private OptimizedMarshaller marshaller() {
U.clearClassCache();
OptimizedMarshaller marsh = new OptimizedMarshaller();
marsh.setContext(new MarshallerContextTestImpl());
return marsh;
}
use of org.apache.ignite.marshaller.MarshallerContextTestImpl in project ignite by apache.
the class GridBinaryCacheEntryMemorySizeSelfTest method createMarshaller.
/**
* {@inheritDoc}
*/
@Override
protected Marshaller createMarshaller() throws IgniteCheckedException {
BinaryMarshaller marsh = new BinaryMarshaller();
IgniteConfiguration iCfg = new IgniteConfiguration();
iCfg.setDiscoverySpi(new TcpDiscoverySpi() {
@Override
public void sendCustomEvent(DiscoverySpiCustomMessage msg) throws IgniteException {
// No-op.
}
});
iCfg.setClientMode(false);
GridTestKernalContext kernCtx = new GridTestKernalContext(log, iCfg);
kernCtx.add(new GridDiscoveryManager(kernCtx));
MarshallerContextTestImpl marshCtx = new MarshallerContextTestImpl(null);
marshCtx.onMarshallerProcessorStarted(kernCtx, null);
marsh.setContext(marshCtx);
BinaryContext pCtx = new BinaryContext(BinaryNoopMetadataHandler.instance(), iCfg, new NullLogger());
IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", pCtx, iCfg);
return marsh;
}
use of org.apache.ignite.marshaller.MarshallerContextTestImpl in project ignite by apache.
the class BinaryMarshallerSelfTest method binaryMarshaller.
/**
* @return Binary marshaller.
*/
protected BinaryMarshaller binaryMarshaller(BinaryNameMapper nameMapper, BinaryIdMapper mapper, BinarySerializer serializer, Collection<BinaryTypeConfiguration> cfgs, Collection<String> excludedClasses) throws IgniteCheckedException {
IgniteConfiguration iCfg = new IgniteConfiguration();
BinaryConfiguration bCfg = new BinaryConfiguration();
bCfg.setNameMapper(nameMapper);
bCfg.setIdMapper(mapper);
bCfg.setSerializer(serializer);
bCfg.setCompactFooter(compactFooter());
bCfg.setTypeConfigurations(cfgs);
iCfg.setBinaryConfiguration(bCfg);
iCfg.setClientMode(false);
iCfg.setDiscoverySpi(new TcpDiscoverySpi() {
@Override
public void sendCustomEvent(DiscoverySpiCustomMessage msg) throws IgniteException {
// No-op.
}
});
BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), iCfg, new NullLogger());
BinaryMarshaller marsh = new BinaryMarshaller();
MarshallerContextTestImpl marshCtx = new MarshallerContextTestImpl(null, excludedClasses);
GridTestKernalContext kernCtx = new GridTestKernalContext(log, iCfg);
kernCtx.add(new GridDiscoveryManager(kernCtx));
marshCtx.onMarshallerProcessorStarted(kernCtx, null);
marsh.setContext(marshCtx);
IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg);
return marsh;
}
use of org.apache.ignite.marshaller.MarshallerContextTestImpl in project ignite by apache.
the class GridBinaryWildcardsSelfTest method binaryMarshaller.
/**
*/
protected BinaryMarshaller binaryMarshaller(BinaryNameMapper nameMapper, BinaryIdMapper mapper, BinarySerializer serializer, Collection<BinaryTypeConfiguration> cfgs) throws IgniteCheckedException {
IgniteConfiguration iCfg = new IgniteConfiguration();
BinaryConfiguration bCfg = new BinaryConfiguration();
bCfg.setNameMapper(nameMapper);
bCfg.setIdMapper(mapper);
bCfg.setSerializer(serializer);
bCfg.setTypeConfigurations(cfgs);
iCfg.setBinaryConfiguration(bCfg);
BinaryContext ctx = new BinaryContext(BinaryNoopMetadataHandler.instance(), iCfg, new NullLogger());
BinaryMarshaller marsh = new BinaryMarshaller();
marsh.setContext(new MarshallerContextTestImpl(null));
IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg);
return marsh;
}
use of org.apache.ignite.marshaller.MarshallerContextTestImpl in project ignite by apache.
the class BinaryFooterOffsetsAbstractSelfTest method beforeTest.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTest() throws Exception {
super.beforeTest();
ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), new IgniteConfiguration(), new NullLogger());
marsh = new BinaryMarshaller();
IgniteConfiguration iCfg = new IgniteConfiguration();
BinaryConfiguration bCfg = new BinaryConfiguration();
bCfg.setTypeConfigurations(Arrays.asList(new BinaryTypeConfiguration(TestObject.class.getName())));
bCfg.setCompactFooter(compactFooter());
iCfg.setBinaryConfiguration(bCfg);
marsh.setContext(new MarshallerContextTestImpl(null));
IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg);
}
Aggregations