Package org.teiid.core

Examples of org.teiid.core.TeiidRuntimeException


       
    }

    public void testMetaMatrixRuntimeExceptionWithCodeAndMessage() {
        final String code = "1234"; //$NON-NLS-1$
        final TeiidRuntimeException err = new TeiidRuntimeException(code, "Test"); //$NON-NLS-1$
        assertNull(err.getChild());
        assertEquals(code, err.getCode());
        assertEquals("Test", err.getMessage()); //$NON-NLS-1$
       
    }
View Full Code Here


       
    }

    public void testMetaMatrixRuntimeExceptionWithExceptionAndMessage() {
        final String code = "1234"; //$NON-NLS-1$
        final TeiidRuntimeException child = new TeiidRuntimeException(code, "Child"); //$NON-NLS-1$
        final TeiidRuntimeException err = new TeiidRuntimeException(child, "Test"); //$NON-NLS-1$
        assertSame(child, err.getChild());
        assertEquals(code, err.getCode());
        assertEquals("Test", err.getMessage()); //$NON-NLS-1$
       
    }
View Full Code Here

       
    }

    public void testMetaMatrixRuntimeExceptionWithExceptionAndCodeAndMessage() {
        final String code = "1234"; //$NON-NLS-1$
        final TeiidRuntimeException child = new TeiidRuntimeException(code, "Child"); //$NON-NLS-1$
        final TeiidRuntimeException err = new TeiidRuntimeException(child, "Code", "Test"); //$NON-NLS-1$ //$NON-NLS-2$
        assertSame(child, err.getChild());
        assertEquals("Code", err.getCode()); //$NON-NLS-1$
        assertEquals("Test", err.getMessage()); //$NON-NLS-1$
       
    }
View Full Code Here

            public int length() {
                long result;
                try {
                    result = ClobType.this.length();
                } catch (SQLException err) {
                    throw new TeiidRuntimeException(err);
                }
                if (((int)result) != result) {
                    throw new TeiidRuntimeException("Clob value is not representable by CharSequence"); //$NON-NLS-1$                   
                }
                return (int)result;
            }

            public char charAt(int index) {
                try {
                  if (buffer == null || index < beginPosition || index >= beginPosition + buffer.length()) {
                    buffer = ClobType.this.getSubString(index + 1, CHAR_SEQUENCE_BUFFER_SIZE);
                    beginPosition = index;
                  }
                  return buffer.charAt(index - beginPosition);
                } catch (SQLException err) {
                    throw new TeiidRuntimeException(err);
                }
            }

            public CharSequence subSequence(int start,
                                            int end) {
                try {
                    return ClobType.this.getSubString(start + 1, end - start);
                } catch (SQLException err) {
                    throw new TeiidRuntimeException(err);
                }
            }
           
        };
    }
View Full Code Here

 
  public static SerialClob createClob(char[] chars) {
    try {
      return new SerialClob(chars);
    } catch (SQLException e) {
      throw new TeiidRuntimeException(e);
    }
  }
View Full Code Here

        props.load(is);
      } finally {
        is.close();
      }
    } catch (IOException e) {
      throw new TeiidRuntimeException(e);
    }
    }
View Full Code Here

      StringWriter writer = new StringWriter();
      marshaller.marshal(this, writer);
      return writer.toString();
      } catch (JAXBException e) {
        //shouldn't happen
        throw new TeiidRuntimeException(e);
      }
    }
View Full Code Here

        super(name);
    }

    public void testWithoutMessage() {
        NullPointerException npe = new NullPointerException();
        TeiidRuntimeException e = new TeiidRuntimeException(npe);
        assertEquals("TeiidRuntimeException->NullPointerException", ExceptionUtil.getLinkedMessagesVerbose(e)); //$NON-NLS-1$
    assertEquals("nullnull", ExceptionUtil.getLinkedMessages(e)); //$NON-NLS-1$
    }
View Full Code Here

    assertEquals("nullnull", ExceptionUtil.getLinkedMessages(e)); //$NON-NLS-1$
    }

    public void testWithMessage() {
        NullPointerException npe = new NullPointerException("problem"); //$NON-NLS-1$
        TeiidRuntimeException e = new TeiidRuntimeException(npe);
        assertEquals("TeiidRuntimeException-problem->NullPointerException", ExceptionUtil.getLinkedMessagesVerbose(e)); //$NON-NLS-1$
    assertEquals("problemproblem", ExceptionUtil.getLinkedMessages(e)); //$NON-NLS-1$
    }
View Full Code Here

    }

    public void testWithAndWithoutMessage() {
        NullPointerException npe = new NullPointerException();
        TeiidException ce = new TeiidException(npe, "problem"); //$NON-NLS-1$
        TeiidRuntimeException e = new TeiidRuntimeException(ce);
        assertEquals("TeiidRuntimeException-problem->TeiidException->NullPointerException", ExceptionUtil.getLinkedMessagesVerbose(e)); //$NON-NLS-1$
    assertEquals("problemproblemnull", ExceptionUtil.getLinkedMessages(e)); //$NON-NLS-1$
    }
View Full Code Here

TOP

Related Classes of org.teiid.core.TeiidRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.