/** * @throws IgniteCheckedException In case of error. */ public GridIoManagerSelfTest() throws IgniteCheckedException { ctx = new GridTestKernalContext(log); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { ctx = new GridTestKernalContext(log); }
/** {@inheritDoc} */ @Override protected void beforeTest() { p = new CompressionProcessorImpl(new GridTestKernalContext(log)); }
/** * @param cfg Configuration to use in Test * @return Test kernal context. */ protected GridTestKernalContext newContext(IgniteConfiguration cfg) throws IgniteCheckedException { return new GridTestKernalContext(log(), cfg); }
/** * @param jmx JMX server. */ public IgniteTestResources(MBeanServer jmx) throws IgniteCheckedException { assert jmx != null; this.jmx = jmx; this.log = rootLog.getLogger(getClass()); this.rsrcProc = new GridResourceProcessor(new GridTestKernalContext(this.log)); }
/** * @param log Logger. */ public IgniteTestResources(IgniteLogger log) throws IgniteCheckedException { assert log != null; this.log = log.getLogger(getClass()); this.jmx = prepareMBeanServer(); this.rsrcProc = new GridResourceProcessor(new GridTestKernalContext(this.log)); }
/** * @param cfg Ignite configuration */ public IgniteTestResources(IgniteConfiguration cfg) throws IgniteCheckedException { this.cfg = cfg; this.log = rootLog.getLogger(getClass()); this.jmx = prepareMBeanServer(); this.rsrcProc = new GridResourceProcessor(new GridTestKernalContext(this.log, this.cfg)); }
/** * @throws IgniteCheckedException If failed. */ public IgniteTestResources() throws IgniteCheckedException { if (SensitiveInfoTestLoggerProxy.TEST_SENSITIVE) log = new SensitiveInfoTestLoggerProxy(rootLog.getLogger(getClass()), null, null, null); else log = rootLog.getLogger(getClass()); this.jmx = prepareMBeanServer(); this.rsrcProc = new GridResourceProcessor(new GridTestKernalContext(this.log)); }
/** * Mocks GridServiceProcessor to test method {@link IgniteServiceProcessor#reassign(IgniteUuid, * ServiceConfiguration, AffinityTopologyVersion, TreeMap)} AffinityTopologyVersion, Map)} )}. */ private IgniteServiceProcessor mockServiceProcessor() { GridTestKernalContext spyCtx = spy(new GridTestKernalContext(new GridTestLog4jLogger())); GridEventStorageManager mockEvt = mock(GridEventStorageManager.class); GridIoManager mockIo = mock(GridIoManager.class); when(spyCtx.event()).thenReturn(mockEvt); when(spyCtx.io()).thenReturn(mockIo); GridDiscoveryManager mockDisco = mock(GridDiscoveryManager.class); when(mockDisco.nodes(any(AffinityTopologyVersion.class))).thenReturn(new ArrayList<>(nodes)); spyCtx.add(mockDisco); return new IgniteServiceProcessor(spyCtx); }
private GridKernalContext newContext() throws IgniteCheckedException { IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setIgniteHome(igniteHome); cfg.setClientMode(false); return new GridTestKernalContext(rootLog.getLogger(OptimizedMarshallerEnumSelfTest.class), cfg); }
new GridTestKernalContext(new GridTestLog4jLogger()));
timeoutProcessor = new GridTimeoutProcessor(new GridTestKernalContext(log));
timeoutProcessor = new GridTimeoutProcessor(new GridTestKernalContext(log));
GridTestKernalContext ctx = new GridTestKernalContext(log);
timeoutProcessor = new GridTimeoutProcessor(new GridTestKernalContext(log));
/** * @return Test kernal context. */ protected GridTestKernalContext newContext() throws IgniteCheckedException { IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setClientMode(false); cfg.setDiscoverySpi(new TcpDiscoverySpi() { @Override public void sendCustomEvent(DiscoverySpiCustomMessage msg) throws IgniteException { //No-op } }); GridTestKernalContext ctx = new GridTestKernalContext(log(), cfg); return ctx; }
timeoutProcessor = new GridTimeoutProcessor(new GridTestKernalContext(log));
/** {@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; } }
/** * */ @Test public void testEnabledManager() throws IgniteCheckedException { GridTestKernalContext ctx = new GridTestKernalContext(new GridStringLogger()); assertTrue(new Manager(ctx, new Spi()).enabled()); assertFalse(new Manager(ctx, new NoopSpi()).enabled()); assertTrue(new Manager(ctx, new Spi(), new NoopSpi()).enabled()); assertTrue(new Manager(ctx, new NoopSpi(), new Spi()).enabled()); }
GridTestKernalContext kernCtx = new GridTestKernalContext(log, iCfg); kernCtx.add(new GridDiscoveryManager(kernCtx));