public Description descriptionFor(IExecutionNode node, DescriptorStatus status) { Description newInstance = null; Constructor<Description> constructor; try { constructor = Description.class.getDeclaredConstructor(constructorParameterTypes()); constructor.setAccessible(true); newInstance = constructor.newInstance(constructorArguments(node, status)); } catch (final SecurityException e) { log.error(e.getMessage(), e); } catch (final NegativeArraySizeException e) { log.error(e.getMessage(), e); } catch (final NoSuchMethodException e) { log.error(e.getMessage(), e); } catch (final IllegalArgumentException e) { log.error(e.getMessage(), e); } catch (final InstantiationException e) { log.error(e.getMessage(), e); } catch (final IllegalAccessException e) { log.error(e.getMessage(), e); } catch (final InvocationTargetException e) { log.error(e.getMessage(), e); } Assert.assertNotNull(newInstance); return newInstance; }
@Override public Description descriptionFor(IExecutionNode node, DescriptorStatus status) { Description newInstance = null; Constructor<Description> constructor; try { constructor = Description.class.getDeclaredConstructor(constructorParameterTypes()); constructor.setAccessible(true); newInstance = constructor.newInstance(constructorArguments(node, status)); } catch (final SecurityException e) { log.error(e.getMessage(), e); } catch (final NegativeArraySizeException e) { log.error(e.getMessage(), e); } catch (final NoSuchMethodException e) { log.error(e.getMessage(), e); } catch (final IllegalArgumentException e) { log.error(e.getMessage(), e); } catch (final InstantiationException e) { log.error(e.getMessage(), e); } catch (final IllegalAccessException e) { log.error(e.getMessage(), e); } catch (final InvocationTargetException e) { log.error(e.getMessage(), e); } Assert.assertNotNull(newInstance); return newInstance; }
throw new IllegalAccessException(e.getMessage()); } catch (ClassNotFoundException e) { throw new IllegalAccessException(e.getMessage());
@Test public void testReadBytesThrowsNegativeArraySizeException() throws Throwable { InputStream in = new ByteArrayInputStream("testString".getBytes()); ISOFieldPackager iFEB_LLLNUM = new IFEB_LLLNUM(); try { iFEB_LLLNUM.readBytes(in, -1); fail("Expected NegativeArraySizeException to be thrown"); } catch (NegativeArraySizeException ex) { assertNull("ex.getMessage()", ex.getMessage()); assertEquals("(ByteArrayInputStream) in.available()", 10, in.available()); } }
@Test public void testUnpackThrowsNegativeArraySizeException() throws Throwable { byte[] bytes = new byte[0]; InputStream in = new ByteArrayInputStream(bytes); try { new Base1_BITMAP126(-1, "testISOFieldPackagerDescription").unpack(new IFB_AMOUNT().createComponent(100), in); fail("Expected NegativeArraySizeException to be thrown"); } catch (NegativeArraySizeException ex) { assertNull("ex.getMessage()", ex.getMessage()); assertEquals("(ByteArrayInputStream) in.available()", 0, in.available()); } }
@Test public void testUninterpretThrowsNegativeArraySizeException() throws Throwable { byte[] rawData = new byte[1]; try { new AsciiHexInterpreter().uninterpret(rawData, 100, -1); fail("Expected NegativeArraySizeException to be thrown"); } catch (NegativeArraySizeException ex) { assertNull("ex.getMessage()", ex.getMessage()); } }
@Test public void testUninterpretThrowsNegativeArraySizeException() throws Throwable { byte[] rawData = new byte[0]; try { new AsciiInterpreter().uninterpret(rawData, 100, -1); fail("Expected NegativeArraySizeException to be thrown"); } catch (NegativeArraySizeException ex) { assertNull("ex.getMessage()", ex.getMessage()); } }
@Test public void testReadHeaderThrowsNegativeArraySizeException() throws Throwable { BaseChannel nACChannel = new NACChannel(); try { nACChannel.readHeader(-1); fail("Expected NegativeArraySizeException to be thrown"); } catch (NegativeArraySizeException ex) { assertNull("ex.getMessage()", ex.getMessage()); assertNull("(NACChannel) nACChannel.serverIn", ((NACChannel) nACChannel).serverIn); } }
@Test public void testUnpackThrowsNegativeArraySizeException() throws Throwable { byte[] b = new byte[3]; ISOFieldPackager[] fld = new ISOFieldPackager[3]; fld[0] = new IFA_LLBNUM(); CTCSubElementPackager cTCSubElementPackager = new CTCSubElementPackager(); cTCSubElementPackager.setFieldPackager(fld); try { cTCSubElementPackager.unpack(new ISOBinaryField(), b); fail("Expected NegativeArraySizeException to be thrown"); } catch (NegativeArraySizeException ex) { assertNull("ex.getMessage()", ex.getMessage()); } }