Examples of TeiidException


Examples of org.teiid.core.TeiidException

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

    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

Examples of org.teiid.core.TeiidException

    public void testConfigurationException() {
        NullPointerException npe = new NullPointerException("problem1"); //$NON-NLS-1$
        ConfigurationException configException = new ConfigurationException("problem2"); //$NON-NLS-1$
        configException.setRootCause(npe);
        TeiidException e = new TeiidException(configException, "problem3"); //$NON-NLS-1$
        assertEquals("TeiidException-problem3->ConfigurationException-problem2->NullPointerException-problem1", ExceptionUtil.getLinkedMessagesVerbose(e)); //$NON-NLS-1$
    assertEquals("problem3problem2problem1", ExceptionUtil.getLinkedMessages(e)); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.teiid.core.TeiidException

            success = tmpFile.createNewFile();
        } catch (IOException e) {
        }
        if (!success) {
            final String msg = CorePlugin.Util.getString("FileUtils.Unable_to_create_file_in", dirPath); //$NON-NLS-1$           
            throw new TeiidException(msg);
        }
       

        //test if file can be written to
        if (!tmpFile.canWrite()) {
            final String msg = CorePlugin.Util.getString("FileUtils.Unable_to_write_file_in", dirPath); //$NON-NLS-1$           
            throw new TeiidException(msg);
        }

        //test if file can be read
        if (!tmpFile.canRead()) {
            final String msg = CorePlugin.Util.getString("FileUtils.Unable_to_read_file_in", dirPath); //$NON-NLS-1$           
            throw new TeiidException(msg);
        }

        //test if file can be renamed
        File newFile = new File(dirPath + File.separatorChar + TEMP_FILE_RENAMED);
        success = false;
        try {
            success = tmpFile.renameTo(newFile);
        } catch (Exception e) {
        }
        if (!success) {
            final String msg = CorePlugin.Util.getString("FileUtils.Unable_to_rename_file_in", dirPath); //$NON-NLS-1$           
            throw new TeiidException(msg);
        }

        //test if file can be deleted
        success = false;
        try {
            success = newFile.delete();
        } catch (Exception e) {
        }
        if (!success) {
            final String msg = CorePlugin.Util.getString("FileUtils.Unable_to_delete_file_in", dirPath); //$NON-NLS-1$           
            throw new TeiidException(msg);
        }
    }
View Full Code Here

Examples of org.teiid.core.TeiidException

     */
    public void setException(Throwable e) {
        if(e instanceof TeiidException) {
            this.exception = (TeiidException)e;
        } else {
            this.exception = new TeiidException(e, e.getMessage());
        }
    }
View Full Code Here

Examples of org.teiid.core.TeiidException

        Collection<RequestMetadata> actualReqs = rm.getRequestsForSession(SESSION_STRING);
        compareReqInfos(reqs, actualReqs);
    }
   
    private SourceWarning getSourceFailures(String model, String binding, String message) {
      return new SourceWarning(model, binding, new TeiidException(message), true);
    }
View Full Code Here

Examples of org.teiid.core.TeiidException

        SQLStates.CONNECTION_EXCEPTION_STALE_CONNECTION);
    testCreateThrowable(
        new MalformedURLException(
            "A test java.net.MalformedURLException"), //$NON-NLS-1$
        SQLStates.CONNECTION_EXCEPTION_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION);
    testCreateThrowable(new TeiidException(
        "A test Generic MM Core Exception"), SQLStates.DEFAULT); //$NON-NLS-1$
    testCreateThrowable(new TeiidException("A test MM Exception"), //$NON-NLS-1$
        SQLStates.DEFAULT);
    testCreateThrowable(new TeiidProcessingException(
        "A test Generic MM Query Processing Exception"), //$NON-NLS-1$
        SQLStates.USAGE_ERROR);
    testCreateThrowable(new TeiidRuntimeException(
View Full Code Here

Examples of org.teiid.core.TeiidException

    testCreateThrowable(new CommunicationException(new SocketException(
        "A test java.net.SocketException"), //$NON-NLS-1$
        "Test Communication Exception with a SocketException in it"), //$NON-NLS-1$
        SQLStates.CONNECTION_EXCEPTION_STALE_CONNECTION);
    testCreateThrowable(
        new TeiidException(new SocketTimeoutException(
            "A test java.net.SocketTimeoutException"), //$NON-NLS-1$
            "Test MetaMatrixException with a SocketTimeoutException in it"), //$NON-NLS-1$
        SQLStates.CONNECTION_EXCEPTION_STALE_CONNECTION);
  }
View Full Code Here

Examples of org.teiid.core.TeiidException

        SQLStates.CONNECTION_EXCEPTION_STALE_CONNECTION);
  }
   
    public void testCreateThrowable3() {
        TeiidSQLException e = testCreateThrowable(
                            new TeiidException(
                                    new TeiidRuntimeException(
                                            new SocketTimeoutException(
                                                    "A test MM Invalid Session Exception"), //$NON-NLS-1$
                                            "Test MetaMatrixRuntimeException with a InvalidSessionException in it"), //$NON-NLS-1$
                                    "Test MM Core Exception with an MM Runtime Exception in it and an InvalidSessionException nested within"), //$NON-NLS-1$
View Full Code Here

Examples of org.teiid.core.TeiidException

        SQLStates.CONNECTION_EXCEPTION_STALE_CONNECTION);
    testCreateThrowable(
        new MalformedURLException(
            "A test java.net.MalformedURLException"), //$NON-NLS-1$
        SQLStates.CONNECTION_EXCEPTION_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION);
    testCreateThrowable(new TeiidException(
        "A test Generic MM Core Exception"), SQLStates.DEFAULT); //$NON-NLS-1$
    testCreateThrowable(new TeiidException("A test MM Exception"), //$NON-NLS-1$
        SQLStates.DEFAULT);
    testCreateThrowable(new TeiidProcessingException(
        "A test Generic MM Query Processing Exception"), //$NON-NLS-1$
        SQLStates.USAGE_ERROR);
    testCreateThrowable(new TeiidRuntimeException(
View Full Code Here

Examples of org.teiid.core.TeiidException

    testCreateThrowable(new CommunicationException(new SocketException(
        "A test java.net.SocketException"), //$NON-NLS-1$
        "Test Communication Exception with a SocketException in it"), //$NON-NLS-1$
        SQLStates.CONNECTION_EXCEPTION_STALE_CONNECTION);
    testCreateThrowable(
        new TeiidException(new SocketTimeoutException(
            "A test java.net.SocketTimeoutException"), //$NON-NLS-1$
            "Test MetaMatrixException with a SocketTimeoutException in it"), //$NON-NLS-1$
        SQLStates.CONNECTION_EXCEPTION_STALE_CONNECTION);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.