Пример #1
0
 public virtual ProcessEngineException exceptionWhileGettingVirtualFolder(URL url, URISyntaxException e)
 {
     return(new ProcessEngineException(exceptionMessage("011", "Could not load virtual file for url '{}'", url), e));
 }
Пример #2
0
 public virtual ProcessEngineException cannotConvertUrlToUri(URL url, URISyntaxException e)
 {
     return(new ProcessEngineException(exceptionMessage("018", "Cannot convert URL[{}] to URI: {}", url, e.Message), e));
 }
Пример #3
0
        public virtual void test_propagate()
        {
            Exception error = new Exception("a");

            System.ArgumentException argEx = new System.ArgumentException("b");
            IOException        ioEx        = new IOException("c");
            URISyntaxException namingEx    = new URISyntaxException("d", "e");

            // use old-style try-catch to ensure test really working
            try
            {
                Unchecked.propagate(error);
                fail();
            }
            catch (Exception ex)
            {
                assertSame(ex, error);
            }
            try
            {
                Unchecked.propagate(argEx);
                fail();
            }
            catch (System.ArgumentException ex)
            {
                assertSame(ex, argEx);
            }
            try
            {
                Unchecked.propagate(ioEx);
                fail();
            }
            catch (UncheckedIOException ex)
            {
                assertEquals(ex.GetType(), typeof(UncheckedIOException));
                assertSame(ex.InnerException, ioEx);
            }
            try
            {
                Unchecked.propagate(namingEx);
                fail();
            }
            catch (Exception ex)
            {
                assertEquals(ex.GetType(), typeof(Exception));
                assertSame(ex.InnerException, namingEx);
            }

            try
            {
                Unchecked.propagate(new InvocationTargetException(error));
                fail();
            }
            catch (Exception ex)
            {
                assertSame(ex, error);
            }
            try
            {
                Unchecked.propagate(new InvocationTargetException(argEx));
                fail();
            }
            catch (System.ArgumentException ex)
            {
                assertSame(ex, argEx);
            }
            try
            {
                Unchecked.propagate(new InvocationTargetException(ioEx));
                fail();
            }
            catch (UncheckedIOException ex)
            {
                assertEquals(ex.GetType(), typeof(UncheckedIOException));
                assertSame(ex.InnerException, ioEx);
            }
            try
            {
                Unchecked.propagate(new InvocationTargetException(namingEx));
                fail();
            }
            catch (Exception ex)
            {
                assertEquals(ex.GetType(), typeof(Exception));
                assertSame(ex.InnerException, namingEx);
            }
        }