/** */ private void checkCacheStartupError(final String name) { GridTestUtils.assertThrows(log, new Callable<Void>() { @Override public Void call() throws Exception { startGrid(name); return null; } }, IgniteCheckedException.class, null); }
/** * @param r Runnable to check support. */ protected void checkNotSupported(final RunnableX r) { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { r.run(); return null; } }, SQLFeatureNotSupportedException.class, null); }
/** * @param r Runnable to check on closed statement. */ protected void checkStatementClosed(final RunnableX r) { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { r.run(); return null; } }, SQLException.class, "Statement is closed"); }
/** * @throws Exception If failed. */ @Test public void testAffinityExecute() throws Exception { assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { return compute.affinityExecute(null, "cache", "key", null); } }, NullPointerException.class, "Ouch! Argument cannot be null: taskName"); }
/** * @throws Exception If failed. */ @Test public void testNode() throws Exception { assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { return compute.node(null); } }, NullPointerException.class, "Ouch! Argument cannot be null: id"); }
/** * @throws Exception If failed. */ @Test public void testNodesByFilter() throws Exception { assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { return compute.nodes((GridClientPredicate<GridClientNode>)null); } }, NullPointerException.class, "Ouch! Argument cannot be null: filter"); }
/** @throws Exception If failed. */ @SuppressWarnings("NullableProblems") @Test public void testInitializeCheckParametersCfgIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { new IgniteHadoopFileSystem().initialize(new URI(""), null); return null; } }, NullPointerException.class, "Ouch! Argument cannot be null: cfg"); }
/** @throws Exception If failed. */ @Test public void testRenameCheckParametersDstPathIsNull() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "someFile"); GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { return fs.rename(file, null); } }, NullPointerException.class, "Ouch! Argument cannot be null: dst"); }
/** @throws Exception If failed. */ @Test public void testGetFileStatusIfPathDoesNotExist() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { return fs.getFileStatus(new Path("someDir")); } }, FileNotFoundException.class, "File not found: someDir"); }
/** @throws Exception If failed. */ @Test public void testOpenCheckParametersPathIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { return fs.open(null, 1024); } }, NullPointerException.class, "Ouch! Argument cannot be null: f"); }
/** @throws Exception If failed. */ @Test public void testRenameCheckParametersSrcPathIsNull() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "someFile"); GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { fs.rename(null, file); return null; } }, NullPointerException.class, "Ouch! Argument cannot be null: f"); }
/** @throws Exception If failed. */ @Test public void testMkdirsIfPathIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { fs.mkdir(null, FsPermission.getDefault(), true); return null; } }, NullPointerException.class, "Ouch! Argument cannot be null: f"); }
/** * @throws Exception If failed. */ @Test public void testExecute() throws Exception { assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { return compute.execute(null, null); } }, NullPointerException.class, "Ouch! Argument cannot be null: taskName"); }
/** * Test object creation with invalid class name. */ @Test public void testCustomFactoryInvalidClassName() { GridTestUtils.assertThrows(null, new Callable<Object>() { @Override public Object call() throws Exception { return proxyForCustom("invalid", null).factory(ctx).create(); } }, IgniteException.class, null); }
/** * @throws Exception If failed. */ @Test public void testTransformIfArgumentIsnull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @SuppressWarnings("NullArgumentToVariableArgMethod") @Override public Object call() throws Exception { return CommandLineTransformer.transform(null); } }, AssertionError.class, null); }
/** * @throws Exception If failed. */ @Test public void testRemove() throws Exception { assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { data.remove(null); return null; } }, NullPointerException.class, "Ouch! Argument cannot be null: key"); }
/** * @throws Exception If failed. */ @Test public void testRemoveAsync() throws Exception { assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { return data.removeAsync(null); } }, NullPointerException.class, "Ouch! Argument cannot be null: key"); }
/** * @throws Exception If failed. */ @Test public void testAffinity() throws Exception { assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { return data.affinity(null); } }, NullPointerException.class, "Ouch! Argument cannot be null: key"); } }
/** * @throws Exception If failed. */ @Test public void testNodeStartFailedFsync() throws Exception { fsync = true; failMtdNameRef.set(formatFile); checkCause(GridTestUtils.assertThrows(log, () -> startGrid(0), IgniteCheckedException.class, null)); }
/** * Check forgotten key fields. * If we've forgotten to specify key fields and we don't specify _key, then default key is inserted. */ @Test public void testIncorrectComplex() { execute("INSERT INTO FORGOTTEN_KEY_FLDS(FK1, FK2, FV1, FV2) VALUES (2,3,4,5)"); GridTestUtils.assertThrows(log(), () -> execute("INSERT INTO FORGOTTEN_KEY_FLDS(FK1, FK2, FV1, FV2) VALUES (8,9,10,11)"), IgniteSQLException.class, "Duplicate key during INSERT"); }