http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/util/nodestart/GridNodeStartUtils.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/util/nodestart/GridNodeStartUtils.java b/modules/core/src/main/java/org/gridgain/grid/util/nodestart/GridNodeStartUtils.java index d15a636..67959d7 100644 --- a/modules/core/src/main/java/org/gridgain/grid/util/nodestart/GridNodeStartUtils.java +++ b/modules/core/src/main/java/org/gridgain/grid/util/nodestart/GridNodeStartUtils.java @@ -87,10 +87,10 @@ public class GridNodeStartUtils { * * @param file File. * @return Tuple with host maps and default values. - * @throws GridException In case of error. + * @throws IgniteCheckedException In case of error. */ public static IgniteBiTuple<Collection<Map<String, Object>>, Map<String, Object>> parseFile( - File file) throws GridException { + File file) throws IgniteCheckedException { assert file != null; assert file.exists(); assert file.isFile(); @@ -126,7 +126,7 @@ public class GridNodeStartUtils { } else if (l.contains("=")) { if (section == null) - throw new GridException("GridGain ini format doesn't support unnamed section."); + throw new IgniteCheckedException("GridGain ini format doesn't support unnamed section."); String key = l.substring(0, l.indexOf('=')); String val = line.substring(line.indexOf('=') + 1); @@ -152,7 +152,7 @@ public class GridNodeStartUtils { } } else - throw new GridException("Failed to parse INI file (line " + lineCnt + ")."); + throw new IgniteCheckedException("Failed to parse INI file (line " + lineCnt + ")."); } Map<String, Object> dfltsTmp = processSection(section, hosts, dflts, props); @@ -163,7 +163,7 @@ public class GridNodeStartUtils { return F.t(hosts, dflts); } catch (IOException | NumberFormatException e) { - throw new GridException("Failed to parse INI file (line " + lineCnt + ").", e); + throw new IgniteCheckedException("Failed to parse INI file (line " + lineCnt + ").", e); } finally { U.closeQuiet(br); @@ -178,16 +178,16 @@ public class GridNodeStartUtils { * @param dflts Parsed properties for default section. * @param props Current properties. * @return Default properties if specified section is default, {@code null} otherwise. - * @throws GridException If INI file contains several default sections. + * @throws IgniteCheckedException If INI file contains several default sections. */ private static Map<String, Object> processSection(String section, Collection<Map<String, Object>> hosts, - Map<String, Object> dflts, Map<String, Object> props) throws GridException { + Map<String, Object> dflts, Map<String, Object> props) throws IgniteCheckedException { if (section == null || props == null) return null; if (DFLT_SECTION.equalsIgnoreCase(section)) { if (dflts != null) - throw new GridException("Only one '" + DFLT_SECTION + "' section is allowed."); + throw new IgniteCheckedException("Only one '" + DFLT_SECTION + "' section is allowed."); return props; } @@ -204,11 +204,11 @@ public class GridNodeStartUtils { * @param hosts Host configurations. * @param dflts Default values. * @return Specification grouped by hosts. - * @throws GridException In case of error. + * @throws IgniteCheckedException In case of error. */ public static Map<String, Collection<GridRemoteStartSpecification>> specifications( Collection<Map<String, Object>> hosts, @Nullable Map<String, Object> dflts) - throws GridException { + throws IgniteCheckedException { Map<String, Collection<GridRemoteStartSpecification>> specsMap = U.newHashMap(hosts.size()); GridRemoteStartSpecification dfltSpec = processDefaults(dflts); @@ -232,10 +232,10 @@ public class GridNodeStartUtils { * * @param dflts Properties. * @return Specification. - * @throws GridException If properties are invalid. + * @throws IgniteCheckedException If properties are invalid. */ private static GridRemoteStartSpecification processDefaults(@Nullable Map<String, Object> dflts) - throws GridException { + throws IgniteCheckedException { int port = DFLT_PORT; String uname = System.getProperty("user.name"); String passwd = null; @@ -276,10 +276,10 @@ public class GridNodeStartUtils { } if (port <= 0) - throw new GridException("Invalid port number: " + port); + throw new IgniteCheckedException("Invalid port number: " + port); if (nodes <= 0) - throw new GridException("Invalid number of nodes: " + nodes); + throw new IgniteCheckedException("Invalid number of nodes: " + nodes); return new GridRemoteStartSpecification(null, port, uname, passwd, key, nodes, ggHome, cfg, script, log); @@ -291,15 +291,15 @@ public class GridNodeStartUtils { * @param props Properties. * @param dfltSpec Default specification. * @return Specification. - * @throws GridException If properties are invalid. + * @throws IgniteCheckedException If properties are invalid. */ private static Collection<GridRemoteStartSpecification> processHost(Map<String, Object> props, - GridRemoteStartSpecification dfltSpec) throws GridException { + GridRemoteStartSpecification dfltSpec) throws IgniteCheckedException { assert props != null; assert dfltSpec != null; if (props.get(HOST) == null) - throw new GridException("Host must be specified."); + throw new IgniteCheckedException("Host must be specified."); Set<String> hosts = expandHost((String)props.get(HOST)); int port = props.get(PORT) != null ? (Integer)props.get(PORT) : dfltSpec.port(); @@ -312,13 +312,13 @@ public class GridNodeStartUtils { String script = props.get(SCRIPT) != null ? (String)props.get(SCRIPT) : dfltSpec.script(); if (port<= 0) - throw new GridException("Invalid port number: " + port); + throw new IgniteCheckedException("Invalid port number: " + port); if (nodes <= 0) - throw new GridException("Invalid number of nodes: " + nodes); + throw new IgniteCheckedException("Invalid number of nodes: " + nodes); if (passwd == null && key == null) - throw new GridException("Password or private key file must be specified."); + throw new IgniteCheckedException("Password or private key file must be specified."); if (passwd != null && key != null) passwd = null; @@ -339,9 +339,9 @@ public class GridNodeStartUtils { * * @param addr Host with or without `~` range. * @return Set of individual host names (IPs). - * @throws GridException In case of error. + * @throws IgniteCheckedException In case of error. */ - public static Set<String> expandHost(String addr) throws GridException { + public static Set<String> expandHost(String addr) throws IgniteCheckedException { assert addr != null; Set<String> addrs = new HashSet<>(); @@ -350,12 +350,12 @@ public class GridNodeStartUtils { String[] parts = addr.split(RANGE_SMB); if (parts.length != 2) - throw new GridException("Invalid IP range: " + addr); + throw new IgniteCheckedException("Invalid IP range: " + addr); int lastDot = parts[0].lastIndexOf('.'); if (lastDot < 0) - throw new GridException("Invalid IP range: " + addr); + throw new IgniteCheckedException("Invalid IP range: " + addr); String base = parts[0].substring(0, lastDot); String begin = parts[0].substring(lastDot + 1); @@ -366,13 +366,13 @@ public class GridNodeStartUtils { int b = Integer.valueOf(end); if (a > b) - throw new GridException("Invalid IP range: " + addr); + throw new IgniteCheckedException("Invalid IP range: " + addr); for (int i = a; i <= b; i++) addrs.add(base + "." + i); } catch (NumberFormatException e) { - throw new GridException("Invalid IP range: " + addr, e); + throw new IgniteCheckedException("Invalid IP range: " + addr, e); } } else
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/util/offheap/unsafe/GridUnsafeMap.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/util/offheap/unsafe/GridUnsafeMap.java b/modules/core/src/main/java/org/gridgain/grid/util/offheap/unsafe/GridUnsafeMap.java index a61703b..10a7511 100644 --- a/modules/core/src/main/java/org/gridgain/grid/util/offheap/unsafe/GridUnsafeMap.java +++ b/modules/core/src/main/java/org/gridgain/grid/util/offheap/unsafe/GridUnsafeMap.java @@ -9,8 +9,8 @@ package org.gridgain.grid.util.offheap.unsafe; +import org.apache.ignite.*; import org.apache.ignite.lang.*; -import org.gridgain.grid.*; import org.gridgain.grid.util.*; import org.gridgain.grid.util.lang.*; import org.gridgain.grid.util.offheap.*; @@ -367,12 +367,12 @@ public class GridUnsafeMap<K> implements GridOffHeapMap<K> { try { advance(); } - catch (GridException e) { + catch (IgniteCheckedException e) { e.printStackTrace(); // Should never happen. } } - private void advance() throws GridException { + private void advance() throws IgniteCheckedException { curIt = null; while (idx < segs.length) { @@ -387,7 +387,7 @@ public class GridUnsafeMap<K> implements GridOffHeapMap<K> { curIt = null; } - @Override protected IgniteBiTuple<byte[], byte[]> onNext() throws GridException { + @Override protected IgniteBiTuple<byte[], byte[]> onNext() throws IgniteCheckedException { if (curIt == null) throw new NoSuchElementException(); @@ -410,7 +410,7 @@ public class GridUnsafeMap<K> implements GridOffHeapMap<K> { throw new UnsupportedOperationException(); } - @Override protected void onClose() throws GridException { + @Override protected void onClose() throws IgniteCheckedException { if (curIt != null) curIt.close(); } @@ -428,12 +428,12 @@ public class GridUnsafeMap<K> implements GridOffHeapMap<K> { try { advance(); } - catch (GridException e) { + catch (IgniteCheckedException e) { e.printStackTrace(); // Should never happen. } } - private void advance() throws GridException { + private void advance() throws IgniteCheckedException { curIt = null; while (idx < segs.length) { @@ -448,7 +448,7 @@ public class GridUnsafeMap<K> implements GridOffHeapMap<K> { curIt = null; } - @Override protected T onNext() throws GridException { + @Override protected T onNext() throws IgniteCheckedException { if (curIt == null) throw new NoSuchElementException(); @@ -471,7 +471,7 @@ public class GridUnsafeMap<K> implements GridOffHeapMap<K> { throw new UnsupportedOperationException(); } - @Override protected void onClose() throws GridException { + @Override protected void onClose() throws IgniteCheckedException { if (curIt != null) curIt.close(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/util/offheap/unsafe/GridUnsafePartitionedMap.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/util/offheap/unsafe/GridUnsafePartitionedMap.java b/modules/core/src/main/java/org/gridgain/grid/util/offheap/unsafe/GridUnsafePartitionedMap.java index 4aa5562..27b9b67 100644 --- a/modules/core/src/main/java/org/gridgain/grid/util/offheap/unsafe/GridUnsafePartitionedMap.java +++ b/modules/core/src/main/java/org/gridgain/grid/util/offheap/unsafe/GridUnsafePartitionedMap.java @@ -9,6 +9,7 @@ package org.gridgain.grid.util.offheap.unsafe; +import org.apache.ignite.*; import org.apache.ignite.lang.*; import org.gridgain.grid.*; import org.gridgain.grid.util.*; @@ -268,12 +269,12 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap { try { advance(); } - catch (GridException e) { + catch (IgniteCheckedException e) { e.printStackTrace(); // Should never happen. } } - private void advance() throws GridException { + private void advance() throws IgniteCheckedException { curIt = null; while (p < parts) { @@ -288,7 +289,7 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap { curIt = null; } - @Override protected IgniteBiTuple<byte[], byte[]> onNext() throws GridException { + @Override protected IgniteBiTuple<byte[], byte[]> onNext() throws IgniteCheckedException { if (curIt == null) throw new NoSuchElementException(); @@ -311,7 +312,7 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap { throw new UnsupportedOperationException(); } - @Override protected void onClose() throws GridException { + @Override protected void onClose() throws IgniteCheckedException { if (curIt != null) curIt.close(); } @@ -331,12 +332,12 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap { try { advance(); } - catch (GridException e) { + catch (IgniteCheckedException e) { e.printStackTrace(); // Should never happen. } } - private void advance() throws GridException { + private void advance() throws IgniteCheckedException { curIt = null; while (p < parts) { @@ -351,7 +352,7 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap { curIt = null; } - @Override protected T onNext() throws GridException { + @Override protected T onNext() throws IgniteCheckedException { if (curIt == null) throw new NoSuchElementException(); @@ -374,7 +375,7 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap { throw new UnsupportedOperationException(); } - @Override protected void onClose() throws GridException { + @Override protected void onClose() throws IgniteCheckedException { if (curIt != null) curIt.close(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/util/tostring/GridToStringBuilder.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/util/tostring/GridToStringBuilder.java b/modules/core/src/main/java/org/gridgain/grid/util/tostring/GridToStringBuilder.java index 4bb5bc4..fdb7663 100644 --- a/modules/core/src/main/java/org/gridgain/grid/util/tostring/GridToStringBuilder.java +++ b/modules/core/src/main/java/org/gridgain/grid/util/tostring/GridToStringBuilder.java @@ -9,7 +9,7 @@ package org.gridgain.grid.util.tostring; -import org.gridgain.grid.*; +import org.apache.ignite.*; import org.gridgain.grid.util.typedef.*; import org.gridgain.grid.util.typedef.internal.*; import org.jetbrains.annotations.*; @@ -482,7 +482,7 @@ public class GridToStringBuilder { } // No other option here. - throw new GridRuntimeException(e); + throw new IgniteException(e); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/util/typedef/X.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/util/typedef/X.java b/modules/core/src/main/java/org/gridgain/grid/util/typedef/X.java index b5b4c71..29c5622 100644 --- a/modules/core/src/main/java/org/gridgain/grid/util/typedef/X.java +++ b/modules/core/src/main/java/org/gridgain/grid/util/typedef/X.java @@ -268,7 +268,7 @@ public final class X { new ArrayList<>(), obj, honorCloneable); } catch (Throwable e) { - throw new GridRuntimeException("Unable to clone instance of class: " + obj.getClass(), e); + throw new IgniteException("Unable to clone instance of class: " + obj.getClass(), e); } } @@ -313,7 +313,7 @@ public final class X { return clone; } catch (Exception e) { - throw new GridRuntimeException("Unable to clone instance of class: " + obj.getClass(), e); + throw new IgniteException("Unable to clone instance of class: " + obj.getClass(), e); } } @@ -371,7 +371,7 @@ public final class X { clone = U.forceNewInstance(cls); if (clone == null) - throw new GridRuntimeException("Failed to clone object (empty constructor could not be assigned): " + obj); + throw new IgniteException("Failed to clone object (empty constructor could not be assigned): " + obj); clones.add(clone); @@ -812,9 +812,9 @@ public final class X { * Synchronously waits for all futures in the collection. * * @param futs Futures to wait for. - * @throws GridException If any of the futures threw exception. + * @throws IgniteCheckedException If any of the futures threw exception. */ - public static void waitAll(@Nullable Iterable<IgniteFuture<?>> futs) throws GridException { + public static void waitAll(@Nullable Iterable<IgniteFuture<?>> futs) throws IgniteCheckedException { if (F.isEmpty(futs)) return; @@ -899,15 +899,15 @@ public final class X { * Tries to resolve GridGain installation home folder. * * @return Installation home folder. - * @throws GridException If GridGain home folder was not set. + * @throws IgniteCheckedException If GridGain home folder was not set. */ - public static String resolveGridGainHome() throws GridException { + public static String resolveGridGainHome() throws IgniteCheckedException { String var = IgniteSystemProperties.getString(GG_HOME); if (var != null) return var; else - throw new GridException("Failed to resolve GridGain home folder " + + throw new IgniteCheckedException("Failed to resolve GridGain home folder " + "(please set 'GRIDGAIN_HOME' environment or system variable)"); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/util/worker/GridWorkerFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/util/worker/GridWorkerFuture.java b/modules/core/src/main/java/org/gridgain/grid/util/worker/GridWorkerFuture.java index 887a824..6e41518 100644 --- a/modules/core/src/main/java/org/gridgain/grid/util/worker/GridWorkerFuture.java +++ b/modules/core/src/main/java/org/gridgain/grid/util/worker/GridWorkerFuture.java @@ -9,7 +9,7 @@ package org.gridgain.grid.util.worker; -import org.gridgain.grid.*; +import org.apache.ignite.*; import org.gridgain.grid.kernal.*; import org.gridgain.grid.util.future.*; @@ -40,7 +40,7 @@ public class GridWorkerFuture<T> extends GridFutureAdapter<T> { } /** {@inheritDoc} */ - @Override public boolean cancel() throws GridException { + @Override public boolean cancel() throws IgniteCheckedException { assert w != null; if (!onCancelled()) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/util/worker/GridWorkerPool.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/util/worker/GridWorkerPool.java b/modules/core/src/main/java/org/gridgain/grid/util/worker/GridWorkerPool.java index 02b0f86..2e98e6c 100644 --- a/modules/core/src/main/java/org/gridgain/grid/util/worker/GridWorkerPool.java +++ b/modules/core/src/main/java/org/gridgain/grid/util/worker/GridWorkerPool.java @@ -49,10 +49,10 @@ public class GridWorkerPool { * Schedules runnable task for execution. * * @param w Runnable task. - * @throws GridException Thrown if any exception occurred. + * @throws IgniteCheckedException Thrown if any exception occurred. */ @SuppressWarnings({"CatchGenericClass", "ProhibitedExceptionThrown"}) - public void execute(final GridWorker w) throws GridException { + public void execute(final GridWorker w) throws IgniteCheckedException { workers.add(w); try { @@ -75,7 +75,7 @@ public class GridWorkerPool { catch (RuntimeException e) { workers.remove(w); - throw new GridException("Failed to execute worker due to runtime exception.", e); + throw new IgniteCheckedException("Failed to execute worker due to runtime exception.", e); } catch (Error e) { workers.remove(w); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/jdbc/util/GridJdbcUtils.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/jdbc/util/GridJdbcUtils.java b/modules/core/src/main/java/org/gridgain/jdbc/util/GridJdbcUtils.java index 8f1e18b..3d79267 100644 --- a/modules/core/src/main/java/org/gridgain/jdbc/util/GridJdbcUtils.java +++ b/modules/core/src/main/java/org/gridgain/jdbc/util/GridJdbcUtils.java @@ -9,6 +9,7 @@ package org.gridgain.jdbc.util; +import org.apache.ignite.*; import org.apache.ignite.marshaller.*; import org.apache.ignite.marshaller.jdk.*; import org.gridgain.grid.*; @@ -40,7 +41,7 @@ public class GridJdbcUtils { try { return MARSHALLER.marshal(args); } - catch (GridException e) { + catch (IgniteCheckedException e) { throw new SQLException("Failed to unmarshal result.", e); } } @@ -69,7 +70,7 @@ public class GridJdbcUtils { try { return MARSHALLER.unmarshal(bytes, null); } - catch (GridException e) { + catch (IgniteCheckedException e) { throw new SQLException("Failed to unmarshal result.", e); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/GridOptimizedMarshallerSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/GridOptimizedMarshallerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/GridOptimizedMarshallerSelfTest.java index 4fd524d..f17551d 100644 --- a/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/GridOptimizedMarshallerSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/GridOptimizedMarshallerSelfTest.java @@ -1,8 +1,8 @@ package org.apache.ignite.marshaller.optimized; +import org.apache.ignite.*; import org.apache.ignite.lang.*; import org.apache.ignite.marshaller.*; -import org.gridgain.grid.*; import org.gridgain.grid.marshaller.*; import org.gridgain.grid.util.typedef.*; import org.gridgain.testframework.*; @@ -56,9 +56,9 @@ public class GridOptimizedMarshallerSelfTest extends GridMarshallerAbstractTest /** * Tests marshal self-linked object. * - * @throws GridException If marshalling failed. + * @throws IgniteCheckedException If marshalling failed. */ - public void testMarshallingSelfLink() throws GridException { + public void testMarshallingSelfLink() throws IgniteCheckedException { SelfLink sl = new SelfLink("a string 1"); sl.link(sl); @@ -81,7 +81,7 @@ public class GridOptimizedMarshallerSelfTest extends GridMarshallerAbstractTest return null; } }, - GridException.class, + IgniteCheckedException.class, null ); } @@ -121,7 +121,7 @@ public class GridOptimizedMarshallerSelfTest extends GridMarshallerAbstractTest assert false; } - catch (GridException e) { + catch (IgniteCheckedException e) { assert e.getCause() instanceof IOException; assert e.getCause().getMessage().contains("must return the value of the field"); } @@ -196,7 +196,7 @@ public class GridOptimizedMarshallerSelfTest extends GridMarshallerAbstractTest out.writeInt(val); } - catch (GridException e) { + catch (IgniteCheckedException e) { throw new IOException(e); } } @@ -213,7 +213,7 @@ public class GridOptimizedMarshallerSelfTest extends GridMarshallerAbstractTest val = in.readInt(); } - catch (GridException e) { + catch (IgniteCheckedException e) { throw new IOException(e); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/GridOptimizedMarshallerTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/GridOptimizedMarshallerTest.java b/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/GridOptimizedMarshallerTest.java index dce41dd..c905d0c 100644 --- a/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/GridOptimizedMarshallerTest.java +++ b/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/GridOptimizedMarshallerTest.java @@ -25,9 +25,9 @@ public class GridOptimizedMarshallerTest extends GridCommonAbstractTest { /** * Tests ability to marshal non-serializable objects. * - * @throws GridException If marshalling failed. + * @throws IgniteCheckedException If marshalling failed. */ - public void testNonSerializable() throws GridException { + public void testNonSerializable() throws IgniteCheckedException { IgniteOptimizedMarshaller marsh = new IgniteOptimizedMarshaller(); marsh.setRequireSerializable(false); @@ -40,9 +40,9 @@ public class GridOptimizedMarshallerTest extends GridCommonAbstractTest { /** * Tests ability to marshal non-serializable objects. * - * @throws GridException If marshalling failed. + * @throws IgniteCheckedException If marshalling failed. */ - public void testNonSerializable1() throws GridException { + public void testNonSerializable1() throws IgniteCheckedException { IgniteOptimizedMarshaller marsh = new IgniteOptimizedMarshaller(); marsh.setRequireSerializable(false); @@ -61,9 +61,9 @@ public class GridOptimizedMarshallerTest extends GridCommonAbstractTest { /** * Tests ability to marshal non-serializable objects. * - * @throws GridException If marshalling failed. + * @throws IgniteCheckedException If marshalling failed. */ - public void testNonSerializable2() throws GridException { + public void testNonSerializable2() throws IgniteCheckedException { IgniteOptimizedMarshaller marsh = new IgniteOptimizedMarshaller(); marsh.setRequireSerializable(false); @@ -94,9 +94,9 @@ public class GridOptimizedMarshallerTest extends GridCommonAbstractTest { /** * Tests ability to marshal non-serializable objects. * - * @throws GridException If marshalling failed. + * @throws IgniteCheckedException If marshalling failed. */ - public void testNonSerializable3() throws GridException { + public void testNonSerializable3() throws IgniteCheckedException { IgniteOptimizedMarshaller marsh = new IgniteOptimizedMarshaller(); marsh.setRequireSerializable(false); @@ -111,9 +111,9 @@ public class GridOptimizedMarshallerTest extends GridCommonAbstractTest { /** * Tests ability to marshal non-serializable objects. * - * @throws GridException If marshalling failed. + * @throws IgniteCheckedException If marshalling failed. */ - public void testNonSerializable4() throws GridException { + public void testNonSerializable4() throws IgniteCheckedException { IgniteOptimizedMarshaller marsh = new IgniteOptimizedMarshaller(); marsh.setRequireSerializable(false); @@ -130,9 +130,9 @@ public class GridOptimizedMarshallerTest extends GridCommonAbstractTest { /** * Tests ability to marshal non-serializable objects. * - * @throws GridException If marshalling failed. + * @throws IgniteCheckedException If marshalling failed. */ - public void testNonSerializable5() throws GridException { + public void testNonSerializable5() throws IgniteCheckedException { IgniteMarshaller marsh = new IgniteOptimizedMarshaller(); byte[] bytes = marsh.marshal(true); @@ -145,9 +145,9 @@ public class GridOptimizedMarshallerTest extends GridCommonAbstractTest { /** * Tests ability to marshal serializable objects. * - * @throws GridException If marshalling failed. + * @throws IgniteCheckedException If marshalling failed. */ - public void testSerializable() throws GridException { + public void testSerializable() throws IgniteCheckedException { IgniteMarshaller marsh = new IgniteOptimizedMarshaller(); SomeSerializable outObj = marsh.unmarshal(marsh.marshal(new SomeSerializable(null)), null); @@ -156,9 +156,9 @@ public class GridOptimizedMarshallerTest extends GridCommonAbstractTest { } /** - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ - public void testSerializableAfterChangingValue() throws GridException { + public void testSerializableAfterChangingValue() throws IgniteCheckedException { IgniteMarshaller marsh = new IgniteOptimizedMarshaller(); SomeSimpleSerializable newObj = new SomeSimpleSerializable(); @@ -177,9 +177,9 @@ public class GridOptimizedMarshallerTest extends GridCommonAbstractTest { /** * Tests ability to marshal externalizable objects. * - * @throws GridException If marshalling failed. + * @throws IgniteCheckedException If marshalling failed. */ - public void testExternalizable() throws GridException { + public void testExternalizable() throws IgniteCheckedException { IgniteMarshaller marsh = new IgniteOptimizedMarshaller(); ExternalizableA outObj = marsh.unmarshal(marsh.marshal(new ExternalizableA(null, true)), null); @@ -202,7 +202,7 @@ public class GridOptimizedMarshallerTest extends GridCommonAbstractTest { fail(); } - catch (GridException ignore) { + catch (IgniteCheckedException ignore) { // No-op. } } @@ -210,9 +210,9 @@ public class GridOptimizedMarshallerTest extends GridCommonAbstractTest { /** * Tests {@link IgniteOptimizedMarshaller#setClassNames(List)}. * - * @throws GridException If marshalling failed. + * @throws IgniteCheckedException If marshalling failed. */ - public void testUserPreregisteredNames() throws GridException { + public void testUserPreregisteredNames() throws IgniteCheckedException { Object obj = new SomeSerializable(null); // Clear caches. @@ -239,10 +239,10 @@ public class GridOptimizedMarshallerTest extends GridCommonAbstractTest { /** * Tests {@link IgniteOptimizedMarshaller#setClassNames(List)}. * - * @throws GridException If marshalling failed. + * @throws IgniteCheckedException If marshalling failed. * @throws IOException If an I/O error occurs. */ - public void testUserPreregisteredNamesPath() throws GridException, IOException { + public void testUserPreregisteredNamesPath() throws IgniteCheckedException, IOException { Object obj = new SomeSerializable(null); // Clear caches. @@ -273,9 +273,9 @@ public class GridOptimizedMarshallerTest extends GridCommonAbstractTest { /** * Tests {@link Proxy}. * - * @throws GridException If marshalling failed. + * @throws IgniteCheckedException If marshalling failed. */ - public void testProxy() throws GridException { + public void testProxy() throws IgniteCheckedException { IgniteOptimizedMarshaller marsh = new IgniteOptimizedMarshaller(); marsh.setRequireSerializable(false); @@ -625,7 +625,7 @@ public class GridOptimizedMarshallerTest extends GridCommonAbstractTest { } /** {@inheritDoc} */ - @Override public Object execute() throws GridException { + @Override public Object execute() throws IgniteCheckedException { assert false; return null; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/GridOptimizedObjectStreamSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/GridOptimizedObjectStreamSelfTest.java b/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/GridOptimizedObjectStreamSelfTest.java index 16c01f0..c197283 100644 --- a/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/GridOptimizedObjectStreamSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/GridOptimizedObjectStreamSelfTest.java @@ -9,11 +9,11 @@ package org.apache.ignite.marshaller.optimized; +import org.apache.ignite.*; import org.apache.ignite.marshaller.*; -import org.gridgain.grid.*; +import org.gridgain.grid.util.io.*; import org.gridgain.grid.util.typedef.*; import org.gridgain.grid.util.typedef.internal.*; -import org.gridgain.grid.util.io.*; import org.gridgain.testframework.*; import org.gridgain.testframework.junits.common.*; import org.jetbrains.annotations.*; @@ -212,7 +212,7 @@ public class GridOptimizedObjectStreamSelfTest extends GridCommonAbstractTest { assert false : "Exception not thrown."; } - catch (GridException e) { + catch (IgniteCheckedException e) { NotSerializableException serEx = e.getCause(NotSerializableException.class); if (serEx == null) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/spi/checkpoint/sharedfs/GridSharedFsCheckpointSpiMultipleDirectoriesSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/checkpoint/sharedfs/GridSharedFsCheckpointSpiMultipleDirectoriesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/checkpoint/sharedfs/GridSharedFsCheckpointSpiMultipleDirectoriesSelfTest.java index 1f58a43..56eb74b 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/checkpoint/sharedfs/GridSharedFsCheckpointSpiMultipleDirectoriesSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/checkpoint/sharedfs/GridSharedFsCheckpointSpiMultipleDirectoriesSelfTest.java @@ -9,8 +9,9 @@ package org.apache.ignite.spi.checkpoint.sharedfs; -import org.gridgain.grid.*; +import org.apache.ignite.*; import org.apache.ignite.spi.checkpoint.*; +import org.gridgain.grid.*; import org.gridgain.grid.util.typedef.internal.*; import org.gridgain.testframework.junits.spi.*; @@ -100,7 +101,7 @@ public class GridSharedFsCheckpointSpiMultipleDirectoriesSelfTest extends try { getSpi().saveCheckpoint(CHECK_POINT_KEY_PREFIX, GridTestIoUtils.serializeJdk(state), 0, true); } - catch (GridException ignored) { + catch (IgniteCheckedException ignored) { error = true; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/spi/collision/GridTestCollisionTaskSession.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/collision/GridTestCollisionTaskSession.java b/modules/core/src/test/java/org/apache/ignite/spi/collision/GridTestCollisionTaskSession.java index f686542..7817c02 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/collision/GridTestCollisionTaskSession.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/collision/GridTestCollisionTaskSession.java @@ -9,9 +9,9 @@ package org.apache.ignite.spi.collision; +import org.apache.ignite.*; import org.apache.ignite.compute.*; import org.apache.ignite.lang.*; -import org.gridgain.grid.*; import java.util.*; @@ -77,29 +77,29 @@ public class GridTestCollisionTaskSession implements ComputeTaskSession { } /** {@inheritDoc} */ - @Override public void saveCheckpoint(String key, Object state) throws GridException { + @Override public void saveCheckpoint(String key, Object state) throws IgniteCheckedException { assert false : "Not implemented"; } @Override public void saveCheckpoint(String key, Object state, ComputeTaskSessionScope scope, long timeout) - throws GridException { + throws IgniteCheckedException { assert false : "Not implemented"; } @Override public void saveCheckpoint(String key, Object state, ComputeTaskSessionScope scope, long timeout, - boolean overwrite) throws GridException { + boolean overwrite) throws IgniteCheckedException { assert false : "Not implemented"; } /** {@inheritDoc} */ - @Override public <T> T loadCheckpoint(String key) throws GridException { + @Override public <T> T loadCheckpoint(String key) throws IgniteCheckedException { assert false : "Not implemented"; return null; } /** {@inheritDoc} */ - @Override public boolean removeCheckpoint(String key) throws GridException { + @Override public boolean removeCheckpoint(String key) throws IgniteCheckedException { assert false : "Not implemented"; return false; @@ -139,7 +139,7 @@ public class GridTestCollisionTaskSession implements ComputeTaskSession { } /** {@inheritDoc} */ - @Override public Collection<ComputeJobSibling> refreshJobSiblings() throws GridException { + @Override public Collection<ComputeJobSibling> refreshJobSiblings() throws IgniteCheckedException { return getJobSiblings(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java index dc2ee2a..0dfb5fd 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java @@ -10,9 +10,9 @@ package org.apache.ignite.spi.communication; import mx4j.tools.adaptor.http.*; +import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.lang.*; -import org.gridgain.grid.*; import org.gridgain.grid.util.direct.*; import org.gridgain.testframework.*; import org.gridgain.testframework.config.*; @@ -61,7 +61,7 @@ public abstract class GridAbstractCommunicationSelfTest<T extends CommunicationS mBeanName = new ObjectName("mbeanAdaptor:protocol=HTTP"); } catch (MalformedObjectNameException e) { - throw new GridRuntimeException(e); + throw new IgniteException(e); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridCacheDhtLockBackupSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridCacheDhtLockBackupSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridCacheDhtLockBackupSelfTest.java index 703c5d8..5031b2f 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridCacheDhtLockBackupSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridCacheDhtLockBackupSelfTest.java @@ -265,7 +265,7 @@ public class GridCacheDhtLockBackupSelfTest extends GridCommonAbstractTest { U.sleep(delayTime); } } - catch (GridException e) { + catch (IgniteCheckedException e) { U.error(log, "Cannot process incoming message", e); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridOrderedMessageCancelSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridOrderedMessageCancelSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridOrderedMessageCancelSelfTest.java index ca76a8a..3684f5e 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridOrderedMessageCancelSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridOrderedMessageCancelSelfTest.java @@ -9,20 +9,20 @@ package org.apache.ignite.spi.communication.tcp; +import org.apache.ignite.*; import org.apache.ignite.compute.*; import org.apache.ignite.configuration.*; import org.apache.ignite.lang.*; import org.apache.ignite.marshaller.*; import org.apache.ignite.resources.*; -import org.gridgain.grid.*; +import org.apache.ignite.spi.discovery.tcp.*; +import org.apache.ignite.spi.discovery.tcp.ipfinder.*; +import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*; import org.gridgain.grid.cache.*; import org.gridgain.grid.cache.query.*; import org.gridgain.grid.kernal.*; import org.gridgain.grid.kernal.managers.communication.*; import org.gridgain.grid.kernal.processors.cache.query.*; -import org.apache.ignite.spi.discovery.tcp.*; -import org.apache.ignite.spi.discovery.tcp.ipfinder.*; -import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*; import org.gridgain.grid.util.direct.*; import org.gridgain.grid.util.typedef.internal.*; import org.gridgain.testframework.junits.common.*; @@ -169,7 +169,7 @@ public class GridOrderedMessageCancelSelfTest extends GridCommonAbstractTest { @ComputeTaskSessionFullSupport private static class Task extends ComputeTaskSplitAdapter<Void, Void> { /** {@inheritDoc} */ - @Override protected Collection<? extends ComputeJob> split(int gridSize, Void arg) throws GridException { + @Override protected Collection<? extends ComputeJob> split(int gridSize, Void arg) throws IgniteCheckedException { return Collections.singleton(new ComputeJobAdapter() { @Nullable @Override public Object execute() { return null; @@ -178,7 +178,7 @@ public class GridOrderedMessageCancelSelfTest extends GridCommonAbstractTest { } /** {@inheritDoc} */ - @Nullable @Override public Void reduce(List<ComputeJobResult> results) throws GridException { + @Nullable @Override public Void reduce(List<ComputeJobResult> results) throws IgniteCheckedException { return null; } } @@ -189,16 +189,16 @@ public class GridOrderedMessageCancelSelfTest extends GridCommonAbstractTest { @ComputeTaskSessionFullSupport private static class FailTask extends ComputeTaskSplitAdapter<Void, Void> { /** {@inheritDoc} */ - @Override protected Collection<? extends ComputeJob> split(int gridSize, Void arg) throws GridException { + @Override protected Collection<? extends ComputeJob> split(int gridSize, Void arg) throws IgniteCheckedException { return Collections.singleton(new ComputeJobAdapter() { - @Nullable @Override public Object execute() throws GridException { - throw new GridException("Task failed."); + @Nullable @Override public Object execute() throws IgniteCheckedException { + throw new IgniteCheckedException("Task failed."); } }); } /** {@inheritDoc} */ - @Nullable @Override public Void reduce(List<ComputeJobResult> results) throws GridException { + @Nullable @Override public Void reduce(List<ComputeJobResult> results) throws IgniteCheckedException { return null; } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiLanTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiLanTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiLanTest.java index a91d9a2..ff15986 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiLanTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiLanTest.java @@ -10,8 +10,8 @@ package org.apache.ignite.spi.communication.tcp; import mx4j.tools.adaptor.http.*; +import org.apache.ignite.*; import org.apache.ignite.lang.*; -import org.gridgain.grid.*; import org.apache.ignite.spi.communication.*; import org.gridgain.grid.util.direct.*; import org.gridgain.grid.util.typedef.internal.*; @@ -168,7 +168,7 @@ public class GridTcpCommunicationSpiLanTest extends GridSpiAbstractTest<TcpCommu spi.sendMessage(remoteNode, msg); } } - catch (GridException e) { + catch (IgniteCheckedException e) { fail("Unable to send message: " + e.getMessage()); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java index c49f104..80f2226 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java @@ -10,10 +10,11 @@ package org.apache.ignite.spi.communication.tcp; import mx4j.tools.adaptor.http.*; +import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.lang.*; -import org.gridgain.grid.*; import org.apache.ignite.spi.communication.*; +import org.gridgain.grid.*; import org.gridgain.grid.util.direct.*; import org.gridgain.grid.util.nio.*; import org.gridgain.grid.util.typedef.*; @@ -77,7 +78,7 @@ public abstract class GridTcpCommunicationSpiMultithreadedSelfTest extends GridS mBeanName = new ObjectName("mbeanAdaptor:protocol=HTTP"); } catch (MalformedObjectNameException e) { - throw new GridRuntimeException(e); + throw new IgniteException(e); } } @@ -203,7 +204,7 @@ public abstract class GridTcpCommunicationSpiMultithreadedSelfTest extends GridS queue.offer(msg); } } - catch (GridException e) { + catch (IgniteCheckedException e) { log().error("Unable to send message.", e); fail("Unable to send message: " + e.getMessage()); @@ -291,7 +292,7 @@ public abstract class GridTcpCommunicationSpiMultithreadedSelfTest extends GridS spis.get(from.id()).sendMessage(node, msg); } } - catch (GridException e) { + catch (IgniteCheckedException e) { log.warning(">>> Oops, unable to send message (safe to ignore).", e); } @@ -366,7 +367,7 @@ public abstract class GridTcpCommunicationSpiMultithreadedSelfTest extends GridS spi.sendMessage(to, msg); } } - catch (GridException e) { + catch (IgniteCheckedException e) { fail("Unable to send message: " + e.getMessage()); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/spi/deployment/local/GridLocalDeploymentSpiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/deployment/local/GridLocalDeploymentSpiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/deployment/local/GridLocalDeploymentSpiSelfTest.java index 3fe8d26..a1ef3a7 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/deployment/local/GridLocalDeploymentSpiSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/deployment/local/GridLocalDeploymentSpiSelfTest.java @@ -9,9 +9,9 @@ package org.apache.ignite.spi.deployment.local; +import org.apache.ignite.*; import org.apache.ignite.compute.*; import org.apache.ignite.spi.*; -import org.gridgain.grid.*; import org.apache.ignite.spi.deployment.*; import org.gridgain.testframework.junits.spi.*; @@ -148,12 +148,12 @@ public class GridLocalDeploymentSpiSelfTest extends GridSpiAbstractTest<LocalDep @ComputeTaskName(value="GridDeploymentTestTask") public class GridDeploymentTestTask extends ComputeTaskSplitAdapter<Object, Object> { /** {@inheritDoc} */ - @Override protected Collection<? extends ComputeJob> split(int gridSize, Object arg) throws GridException { + @Override protected Collection<? extends ComputeJob> split(int gridSize, Object arg) throws IgniteCheckedException { return null; } /** {@inheritDoc} */ - @Override public Serializable reduce(List<ComputeJobResult> results) throws GridException { + @Override public Serializable reduce(List<ComputeJobResult> results) throws IgniteCheckedException { return null; } } @@ -165,12 +165,12 @@ public class GridLocalDeploymentSpiSelfTest extends GridSpiAbstractTest<LocalDep @ComputeTaskName(value="GridDeploymentTestTask") public class GridDeploymentTestTask1 extends ComputeTaskSplitAdapter<Object, Object> { /** {@inheritDoc} */ - @Override protected Collection<? extends ComputeJob> split(int gridSize, Object arg) throws GridException { + @Override protected Collection<? extends ComputeJob> split(int gridSize, Object arg) throws IgniteCheckedException { return null; } /** {@inheritDoc} */ - @Override public Serializable reduce(List<ComputeJobResult> results) throws GridException { + @Override public Serializable reduce(List<ComputeJobResult> results) throws IgniteCheckedException { return null; } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/GridTcpDiscoveryMarshallerCheckSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/GridTcpDiscoveryMarshallerCheckSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/GridTcpDiscoveryMarshallerCheckSelfTest.java index fbe1e54..cc0f2ab 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/GridTcpDiscoveryMarshallerCheckSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/GridTcpDiscoveryMarshallerCheckSelfTest.java @@ -9,11 +9,11 @@ package org.apache.ignite.spi.discovery.tcp; +import org.apache.ignite.*; import org.apache.ignite.configuration.*; import org.apache.ignite.marshaller.jdk.*; import org.apache.ignite.marshaller.optimized.*; import org.apache.ignite.spi.*; -import org.gridgain.grid.*; import org.apache.ignite.spi.discovery.tcp.ipfinder.*; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*; import org.gridgain.testframework.junits.common.*; @@ -74,7 +74,7 @@ public class GridTcpDiscoveryMarshallerCheckSelfTest extends GridCommonAbstractT fail("Expected SPI exception was not thrown."); } - catch (GridException e) { + catch (IgniteCheckedException e) { Throwable ex = e.getCause().getCause(); assertTrue(ex instanceof IgniteSpiException); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/GridTcpDiscoverySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/GridTcpDiscoverySelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/GridTcpDiscoverySelfTest.java index 7483739..abba019 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/GridTcpDiscoverySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/GridTcpDiscoverySelfTest.java @@ -741,7 +741,7 @@ public class GridTcpDiscoverySelfTest extends GridCommonAbstractTest { return null; } }, - GridException.class, + IgniteCheckedException.class, null); } finally { @@ -761,7 +761,7 @@ public class GridTcpDiscoverySelfTest extends GridCommonAbstractTest { return null; } - }, GridException.class, null); + }, IgniteCheckedException.class, null); assert X.hasCause(t, IgniteSpiException.class) : "Unexpected exception: " + t; } @@ -812,7 +812,7 @@ public class GridTcpDiscoverySelfTest extends GridCommonAbstractTest { return null; } }, - GridException.class, + IgniteCheckedException.class, null); } finally { @@ -844,7 +844,7 @@ public class GridTcpDiscoverySelfTest extends GridCommonAbstractTest { return null; } }, - GridException.class, + IgniteCheckedException.class, null); } finally { @@ -873,7 +873,7 @@ public class GridTcpDiscoverySelfTest extends GridCommonAbstractTest { return null; } }, - GridException.class, + IgniteCheckedException.class, null); } finally { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/spi/failover/GridFailoverTestContext.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/failover/GridFailoverTestContext.java b/modules/core/src/test/java/org/apache/ignite/spi/failover/GridFailoverTestContext.java index cace3e2..7733d86 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/failover/GridFailoverTestContext.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/failover/GridFailoverTestContext.java @@ -9,9 +9,9 @@ package org.apache.ignite.spi.failover; +import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.compute.*; -import org.gridgain.grid.*; import java.util.*; @@ -56,7 +56,7 @@ public class GridFailoverTestContext implements FailoverContext { } /** {@inheritDoc} */ - @Override public ClusterNode getBalancedNode(List<ClusterNode> grid) throws GridException { + @Override public ClusterNode getBalancedNode(List<ClusterNode> grid) throws IgniteCheckedException { return grid.get(RAND.nextInt(grid.size())); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/roundrobin/GridRoundRobinLoadBalancingSpiNotPerTaskSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/roundrobin/GridRoundRobinLoadBalancingSpiNotPerTaskSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/roundrobin/GridRoundRobinLoadBalancingSpiNotPerTaskSelfTest.java index a46b75f..cc8a5e0 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/roundrobin/GridRoundRobinLoadBalancingSpiNotPerTaskSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/roundrobin/GridRoundRobinLoadBalancingSpiNotPerTaskSelfTest.java @@ -9,6 +9,7 @@ package org.apache.ignite.spi.loadbalancing.roundrobin; +import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.compute.*; import org.apache.ignite.events.*; @@ -114,7 +115,7 @@ public class GridRoundRobinLoadBalancingSpiNotPerTaskSelfTest try { getSpi().getBalancedNode(ses, notInTop, new GridTestJob()); } - catch (GridException e) { + catch (IgniteCheckedException e) { assertTrue(e.getMessage().contains("Task topology does not have alive nodes")); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/roundrobin/GridRoundRobinTestUtils.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/roundrobin/GridRoundRobinTestUtils.java b/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/roundrobin/GridRoundRobinTestUtils.java index fc3fbc4..4cd0ea7 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/roundrobin/GridRoundRobinTestUtils.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/roundrobin/GridRoundRobinTestUtils.java @@ -9,6 +9,7 @@ package org.apache.ignite.spi.loadbalancing.roundrobin; +import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.compute.*; import org.gridgain.grid.*; @@ -28,10 +29,10 @@ class GridRoundRobinTestUtils { * @param allNodes Topology nodes. * @param orderedNodes Balancing nodes. * @param ses Task session. - * @throws GridException If balancer failed. + * @throws IgniteCheckedException If balancer failed. */ static void checkCyclicBalancing(RoundRobinLoadBalancingSpi spi, List<ClusterNode> allNodes, - List<UUID> orderedNodes, ComputeTaskSession ses) throws GridException { + List<UUID> orderedNodes, ComputeTaskSession ses) throws IgniteCheckedException { ClusterNode firstNode = spi.getBalancedNode(ses, allNodes, new GridTestJob()); @@ -56,10 +57,10 @@ class GridRoundRobinTestUtils { * @param orderedNodes Balancing nodes. * @param ses1 First task session. * @param ses2 Second task session. - * @throws GridException If balancer failed. + * @throws IgniteCheckedException If balancer failed. */ static void checkCyclicBalancing(RoundRobinLoadBalancingSpi spi, List<ClusterNode> allNodes, - List<UUID> orderedNodes, ComputeTaskSession ses1, ComputeTaskSession ses2) throws GridException { + List<UUID> orderedNodes, ComputeTaskSession ses1, ComputeTaskSession ses2) throws IgniteCheckedException { ClusterNode firstNode = spi.getBalancedNode(ses1, allNodes, new GridTestJob()); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/streamer/index/GridStreamerIndexSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/streamer/index/GridStreamerIndexSelfTest.java b/modules/core/src/test/java/org/apache/ignite/streamer/index/GridStreamerIndexSelfTest.java index 75ac6de..2fdbe53 100644 --- a/modules/core/src/test/java/org/apache/ignite/streamer/index/GridStreamerIndexSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/streamer/index/GridStreamerIndexSelfTest.java @@ -9,6 +9,7 @@ package org.apache.ignite.streamer.index; +import org.apache.ignite.*; import org.apache.ignite.lang.*; import org.apache.ignite.streamer.index.hash.*; import org.apache.ignite.streamer.index.tree.*; @@ -85,7 +86,7 @@ public class GridStreamerIndexSelfTest extends GridCommonAbstractTest { fail("Exception should have been thrown."); } - catch (GridException e) { + catch (IgniteCheckedException e) { info("Caught expected exception: " + e); } @@ -166,9 +167,9 @@ public class GridStreamerIndexSelfTest extends GridCommonAbstractTest { * it discards event "A" and accepts event "B". * * @param updater Index updater. - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ - private void checkIndexUpdater(StreamerIndexUpdater<String, String, Integer> updater) throws GridException { + private void checkIndexUpdater(StreamerIndexUpdater<String, String, Integer> updater) throws IgniteCheckedException { List<StreamerIndexProvider<String, String, Integer>> idxps = Arrays.asList( indexProvider(true, "tree", updater, StreamerIndexPolicy.EVENT_TRACKING_ON, false), indexProvider(false, "hash", updater, StreamerIndexPolicy.EVENT_TRACKING_ON, false)); @@ -249,11 +250,11 @@ public class GridStreamerIndexSelfTest extends GridCommonAbstractTest { // Submit the same event in multiple threads. runMultiThreaded(new CAX() { - @Override public void applyx() throws GridException { + @Override public void applyx() throws IgniteCheckedException { try { win.enqueue(evt); } - catch (GridException e) { + catch (IgniteCheckedException e) { if (e.getMessage().contains("Index unique key violation")) nIdxErrors.incrementAndGet(); else @@ -294,7 +295,7 @@ public class GridStreamerIndexSelfTest extends GridCommonAbstractTest { // These threads poll evicted events from the window if it doesn't break // the test invariant. pollFut = runMultiThreadedAsync(new CAX() { - @Override public void applyx() throws GridException { + @Override public void applyx() throws IgniteCheckedException { try { while (!Thread.currentThread().isInterrupted()) { StreamerIndex<String, String, Integer> idx = win.index("idx"); @@ -324,7 +325,7 @@ public class GridStreamerIndexSelfTest extends GridCommonAbstractTest { // sorted by value and the value is a number of repeated events, so, this // should be invariant. IgniteFuture<Long> fut1 = runMultiThreadedAsync(new CAX() { - @Override public void applyx() throws GridException { + @Override public void applyx() throws IgniteCheckedException { final String evt = Thread.currentThread().getName(); int cntr = 1; @@ -351,7 +352,7 @@ public class GridStreamerIndexSelfTest extends GridCommonAbstractTest { // This thread generates a set of single non-repeating events from 0 to iters. IgniteFuture<Long> fut2 = runMultiThreadedAsync(new CAX() { - @Override public void applyx() throws GridException { + @Override public void applyx() throws IgniteCheckedException { for (int i = 0; i < iters && !Thread.currentThread().isInterrupted(); i++) win.enqueue(String.valueOf(i)); } @@ -368,9 +369,9 @@ public class GridStreamerIndexSelfTest extends GridCommonAbstractTest { /** * @param idx Index. - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ - private void checkNonUniqueIndex(StreamerIndexProvider<String, String, Integer> idx) throws GridException { + private void checkNonUniqueIndex(StreamerIndexProvider<String, String, Integer> idx) throws IgniteCheckedException { assert !idx.isUnique(); StreamerBoundedSizeWindow<String> win = new StreamerBoundedSizeWindow<>(); @@ -503,9 +504,9 @@ public class GridStreamerIndexSelfTest extends GridCommonAbstractTest { /** * @param idx Index. - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ - private void checkUniqueIndex(StreamerIndexProvider<String, String, String> idx) throws GridException { + private void checkUniqueIndex(StreamerIndexProvider<String, String, String> idx) throws IgniteCheckedException { assert idx.isUnique(); StreamerBoundedSizeWindow<String> win = new StreamerBoundedSizeWindow<>(); @@ -524,7 +525,7 @@ public class GridStreamerIndexSelfTest extends GridCommonAbstractTest { fail("Exception should have been thrown."); } - catch (GridException e) { + catch (IgniteCheckedException e) { info("Caught expected exception: " + e); } } @@ -668,8 +669,8 @@ public class GridStreamerIndexSelfTest extends GridCommonAbstractTest { /** {@inheritDoc} */ @Nullable @Override public String onAdded(StreamerIndexEntry<String, String, String> entry, String evt) - throws GridException { - throw new GridException("Unique key violation: " + evt); + throws IgniteCheckedException { + throw new IgniteCheckedException("Unique key violation: " + evt); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/apache/ignite/streamer/window/GridStreamerWindowSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/streamer/window/GridStreamerWindowSelfTest.java b/modules/core/src/test/java/org/apache/ignite/streamer/window/GridStreamerWindowSelfTest.java index ce864f9..bb8fbc6 100644 --- a/modules/core/src/test/java/org/apache/ignite/streamer/window/GridStreamerWindowSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/streamer/window/GridStreamerWindowSelfTest.java @@ -9,10 +9,9 @@ package org.apache.ignite.streamer.window; +import org.apache.ignite.*; import org.apache.ignite.lang.*; import org.apache.ignite.streamer.*; -import org.apache.ignite.streamer.window.*; -import org.gridgain.grid.*; import org.gridgain.grid.util.*; import org.gridgain.grid.util.typedef.*; import org.gridgain.grid.util.typedef.internal.*; @@ -43,7 +42,7 @@ public class GridStreamerWindowSelfTest extends GridCommonAbstractTest { return null; } - }, GridException.class, null); + }, IgniteCheckedException.class, null); } /** @@ -58,7 +57,7 @@ public class GridStreamerWindowSelfTest extends GridCommonAbstractTest { return null; } - }, GridException.class, null); + }, IgniteCheckedException.class, null); win.setTimeInterval(1); @@ -72,7 +71,7 @@ public class GridStreamerWindowSelfTest extends GridCommonAbstractTest { return null; } - }, GridException.class, null); + }, IgniteCheckedException.class, null); } /** @@ -87,7 +86,7 @@ public class GridStreamerWindowSelfTest extends GridCommonAbstractTest { return null; } - }, GridException.class, null); + }, IgniteCheckedException.class, null); win.setBatchSize(1); @@ -101,7 +100,7 @@ public class GridStreamerWindowSelfTest extends GridCommonAbstractTest { return null; } - }, GridException.class, null); + }, IgniteCheckedException.class, null); } /** @@ -116,7 +115,7 @@ public class GridStreamerWindowSelfTest extends GridCommonAbstractTest { return null; } - }, GridException.class, null); + }, IgniteCheckedException.class, null); win.setBatchSize(1); @@ -126,7 +125,7 @@ public class GridStreamerWindowSelfTest extends GridCommonAbstractTest { return null; } - }, GridException.class, null); + }, IgniteCheckedException.class, null); win.setBatchTimeInterval(1); win.setBatchSize(-1); @@ -137,7 +136,7 @@ public class GridStreamerWindowSelfTest extends GridCommonAbstractTest { return null; } - }, GridException.class, null); + }, IgniteCheckedException.class, null); win.setBatchSize(1); @@ -151,7 +150,7 @@ public class GridStreamerWindowSelfTest extends GridCommonAbstractTest { return null; } - }, GridException.class, null); + }, IgniteCheckedException.class, null); } /** @@ -279,7 +278,7 @@ public class GridStreamerWindowSelfTest extends GridCommonAbstractTest { return null; } - }, GridException.class, null); + }, IgniteCheckedException.class, null); win.setMaximumSize(60); win.setUnique(true); @@ -328,7 +327,7 @@ public class GridStreamerWindowSelfTest extends GridCommonAbstractTest { return null; } - }, GridException.class, null); + }, IgniteCheckedException.class, null); win.setBatchSize(10); win.setMaximumBatches(2); @@ -403,7 +402,7 @@ public class GridStreamerWindowSelfTest extends GridCommonAbstractTest { return null; } - }, GridException.class, null); + }, IgniteCheckedException.class, null); win.setMaximumSize(60); win.setTimeInterval(40); @@ -455,7 +454,7 @@ public class GridStreamerWindowSelfTest extends GridCommonAbstractTest { return null; } - }, GridException.class, null); + }, IgniteCheckedException.class, null); win.setBatchSize(50); win.setBatchTimeInterval(500); @@ -750,9 +749,9 @@ public class GridStreamerWindowSelfTest extends GridCommonAbstractTest { * * @param win Window to check. * @param maxSize Max window size. - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ - private void finalChecks(StreamerWindow<Integer> win, int maxSize) throws GridException { + private void finalChecks(StreamerWindow<Integer> win, int maxSize) throws IgniteCheckedException { int evictQueueSize = win.evictionQueueSize(); info("Eviction queue size for final checks: " + evictQueueSize); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/gridgain/grid/GridExceptionHelpLinksSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/GridExceptionHelpLinksSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/GridExceptionHelpLinksSelfTest.java index 9a2e369..4d7425c 100644 --- a/modules/core/src/test/java/org/gridgain/grid/GridExceptionHelpLinksSelfTest.java +++ b/modules/core/src/test/java/org/gridgain/grid/GridExceptionHelpLinksSelfTest.java @@ -1,6 +1,7 @@ package org.gridgain.grid; import junit.framework.*; +import org.apache.ignite.*; import org.jetbrains.annotations.*; import java.util.*; @@ -15,13 +16,13 @@ public class GridExceptionHelpLinksSelfTest extends TestCase { * @throws Exception If failed. */ public void testDefaultLinks() throws Exception { - assertTrue(hasLinksInMessage(new GridException("test"), DFLT_HELP_LINKS)); - assertTrue(hasLinksInMessage(new GridException(new Exception()), DFLT_HELP_LINKS)); - assertTrue(hasLinksInMessage(new GridException("test", new Exception()), DFLT_HELP_LINKS)); + assertTrue(hasLinksInMessage(new IgniteCheckedException("test"), DFLT_HELP_LINKS)); + assertTrue(hasLinksInMessage(new IgniteCheckedException(new Exception()), DFLT_HELP_LINKS)); + assertTrue(hasLinksInMessage(new IgniteCheckedException("test", new Exception()), DFLT_HELP_LINKS)); - assertTrue(hasLinksInMessage(new GridRuntimeException("test"), DFLT_HELP_LINKS)); - assertTrue(hasLinksInMessage(new GridRuntimeException(new Exception()), DFLT_HELP_LINKS)); - assertTrue(hasLinksInMessage(new GridRuntimeException("test", new Exception()), DFLT_HELP_LINKS)); + assertTrue(hasLinksInMessage(new IgniteException("test"), DFLT_HELP_LINKS)); + assertTrue(hasLinksInMessage(new IgniteException(new Exception()), DFLT_HELP_LINKS)); + assertTrue(hasLinksInMessage(new IgniteException("test", new Exception()), DFLT_HELP_LINKS)); } /** @@ -29,27 +30,27 @@ public class GridExceptionHelpLinksSelfTest extends TestCase { */ public void testLinksUniqueness() { assertLinksAppearOnce( - new GridException("test", - new GridException("test nested", - new GridException("last"))), + new IgniteCheckedException("test", + new IgniteCheckedException("test nested", + new IgniteCheckedException("last"))), DFLT_HELP_LINKS); assertLinksAppearOnce( - new GridRuntimeException("test", - new GridRuntimeException("test nested", - new GridRuntimeException("last"))), + new IgniteException("test", + new IgniteException("test nested", + new IgniteException("last"))), DFLT_HELP_LINKS); assertLinksAppearOnce( - new GridException("test", - new GridRuntimeException("test nested", - new GridException("last"))), + new IgniteCheckedException("test", + new IgniteException("test nested", + new IgniteCheckedException("last"))), DFLT_HELP_LINKS); assertLinksAppearOnce( - new GridRuntimeException("test", - new GridException("test nested", - new GridRuntimeException("last"))), + new IgniteException("test", + new IgniteCheckedException("test nested", + new IgniteException("last"))), DFLT_HELP_LINKS); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/gridgain/grid/GridSuppressedExceptionSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/GridSuppressedExceptionSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/GridSuppressedExceptionSelfTest.java index 1d4fa19..a0e79eb 100644 --- a/modules/core/src/test/java/org/gridgain/grid/GridSuppressedExceptionSelfTest.java +++ b/modules/core/src/test/java/org/gridgain/grid/GridSuppressedExceptionSelfTest.java @@ -10,6 +10,7 @@ package org.gridgain.grid; import junit.framework.*; +import org.apache.ignite.*; import org.gridgain.grid.util.typedef.*; import java.io.*; @@ -22,10 +23,10 @@ public class GridSuppressedExceptionSelfTest extends TestCase { * @throws Exception If failed. */ public void testHasCause() throws Exception { - GridException me = prepareMultiException(); + IgniteCheckedException me = prepareMultiException(); assertFalse(me.hasCause(IOException.class)); - assertTrue(me.hasCause(GridException.class)); + assertTrue(me.hasCause(IgniteCheckedException.class)); assertTrue(me.hasCause(IllegalArgumentException.class)); } @@ -33,12 +34,12 @@ public class GridSuppressedExceptionSelfTest extends TestCase { * @throws Exception If failed. */ public void testGetCause() throws Exception { - GridException me = prepareMultiException(); + IgniteCheckedException me = prepareMultiException(); assertNull(me.getCause(IOException.class)); - assertNotNull(me.getCause(GridException.class)); - assertTrue(me.getCause(GridException.class) instanceof GridException); + assertNotNull(me.getCause(IgniteCheckedException.class)); + assertTrue(me.getCause(IgniteCheckedException.class) instanceof IgniteCheckedException); assertNotNull(me.getCause(IllegalArgumentException.class)); assertTrue(me.getCause(IllegalArgumentException.class) instanceof IllegalArgumentException); @@ -48,14 +49,14 @@ public class GridSuppressedExceptionSelfTest extends TestCase { * @throws Exception If failed. */ public void testXHasCause() throws Exception { - GridException me = prepareMultiException(); + IgniteCheckedException me = prepareMultiException(); try { throw new RuntimeException("Test.", me); } catch (RuntimeException e) { assertFalse(X.hasCause(e, IOException.class)); - assertTrue(X.hasCause(e, GridException.class)); + assertTrue(X.hasCause(e, IgniteCheckedException.class)); assertTrue(X.hasCause(e, IllegalArgumentException.class)); } } @@ -64,7 +65,7 @@ public class GridSuppressedExceptionSelfTest extends TestCase { * @throws Exception If failed. */ public void testXCause() throws Exception { - GridException me = prepareMultiException(); + IgniteCheckedException me = prepareMultiException(); try { throw new RuntimeException("Test.", me); @@ -72,8 +73,8 @@ public class GridSuppressedExceptionSelfTest extends TestCase { catch (RuntimeException e) { assertNull(X.cause(e, IOException.class)); - assertNotNull(X.cause(e, GridException.class)); - assertTrue(X.cause(e, GridException.class) instanceof GridException); + assertNotNull(X.cause(e, IgniteCheckedException.class)); + assertTrue(X.cause(e, IgniteCheckedException.class) instanceof IgniteCheckedException); assertNotNull(X.cause(e, IllegalArgumentException.class)); assertTrue(X.cause(e, IllegalArgumentException.class) instanceof IllegalArgumentException); @@ -81,18 +82,18 @@ public class GridSuppressedExceptionSelfTest extends TestCase { } /** - * Made to demonstrate stack printing for {@link GridException}. Do not enable. + * Made to demonstrate stack printing for {@link IgniteCheckedException}. Do not enable. * * @throws Exception If failed. */ public void _testStackTrace() throws Exception { - GridException me = new GridException("Test message."); + IgniteCheckedException me = new IgniteCheckedException("Test message."); for (int i = 5; i < 20; i++) { try { generateException(i, null); } - catch (GridException e) { + catch (IgniteCheckedException e) { me.addSuppressed(e); } } @@ -104,14 +105,14 @@ public class GridSuppressedExceptionSelfTest extends TestCase { * @return A multi exception with few nested causes and * {@link IllegalAccessException} in hierarchy. */ - private GridException prepareMultiException() { - GridException me = new GridException("Test message."); + private IgniteCheckedException prepareMultiException() { + IgniteCheckedException me = new IgniteCheckedException("Test message."); for (int i = 0; i < 3; i++) { try { generateException(3, new IllegalArgumentException()); } - catch (GridException e) { + catch (IgniteCheckedException e) { me.addSuppressed(e); } } @@ -121,11 +122,11 @@ public class GridSuppressedExceptionSelfTest extends TestCase { /** * @param calls Stack depth to throw exception. * @param cause Cause for the generated exception. - * @throws GridException Exception. + * @throws IgniteCheckedException Exception. */ - private void generateException(int calls, Throwable cause) throws GridException { + private void generateException(int calls, Throwable cause) throws IgniteCheckedException { if (calls == 1) - throw new GridException("Demo exception.", cause); + throw new IgniteCheckedException("Demo exception.", cause); else generateException(calls - 1, cause); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/gridgain/grid/GridTestJob.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/GridTestJob.java b/modules/core/src/test/java/org/gridgain/grid/GridTestJob.java index de509c7..c86cce4 100644 --- a/modules/core/src/test/java/org/gridgain/grid/GridTestJob.java +++ b/modules/core/src/test/java/org/gridgain/grid/GridTestJob.java @@ -34,7 +34,7 @@ public class GridTestJob extends ComputeJobAdapter { } /** {@inheritDoc} */ - @Override public String execute() throws GridException { + @Override public String execute() throws IgniteCheckedException { if (log.isDebugEnabled()) log.debug("Executing job [job=" + this + ", arg=" + argument(0) + ']'); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/gridgain/grid/GridTestJobResult.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/GridTestJobResult.java b/modules/core/src/test/java/org/gridgain/grid/GridTestJobResult.java index 028414d..4f7563b 100644 --- a/modules/core/src/test/java/org/gridgain/grid/GridTestJobResult.java +++ b/modules/core/src/test/java/org/gridgain/grid/GridTestJobResult.java @@ -9,6 +9,7 @@ package org.gridgain.grid; +import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.compute.*; @@ -22,7 +23,7 @@ public class GridTestJobResult implements ComputeJobResult { private final Serializable data; /** */ - private final GridException e; + private final IgniteCheckedException e; /** */ private final ComputeJob job; @@ -49,7 +50,7 @@ public class GridTestJobResult implements ComputeJobResult { * @param node Grid node. * @param jobCtx Job context. */ - public GridTestJobResult(Serializable data, GridException e, ComputeJob job, ClusterNode node, ComputeJobContext jobCtx) { + public GridTestJobResult(Serializable data, IgniteCheckedException e, ComputeJob job, ClusterNode node, ComputeJobContext jobCtx) { this.data = data; this.e = e; this.job = job; @@ -71,7 +72,7 @@ public class GridTestJobResult implements ComputeJobResult { /** {@inheritDoc} */ @Override public Serializable getData() { return data; } - /** {@inheritDoc} */ @Override public GridException getException() { return e; } + /** {@inheritDoc} */ @Override public IgniteCheckedException getException() { return e; } /** {@inheritDoc} */ @Override public boolean isCancelled() { return false; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/test/java/org/gridgain/grid/GridTestTask.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/GridTestTask.java b/modules/core/src/test/java/org/gridgain/grid/GridTestTask.java index a509db4..a2958f8 100644 --- a/modules/core/src/test/java/org/gridgain/grid/GridTestTask.java +++ b/modules/core/src/test/java/org/gridgain/grid/GridTestTask.java @@ -37,7 +37,7 @@ public class GridTestTask extends ComputeTaskSplitAdapter<Object, Object> { } /** {@inheritDoc} */ - @Override public Object reduce(List<ComputeJobResult> results) throws GridException { + @Override public Object reduce(List<ComputeJobResult> results) throws IgniteCheckedException { if (log.isDebugEnabled()) log.debug("Reducing task [task=" + this + ", results=" + results + ']');