Package org.teiid.core

Examples of org.teiid.core.TeiidException


        assertEquals("Error Code:Code Message:Test", err.getMessage()); //$NON-NLS-1$
       
    }

    public void testMetaMatrixExceptionWithExceptionAndMessage() {
        final TeiidException child = new TeiidException("propertyValuePhrase", "Child"); //$NON-NLS-1$ //$NON-NLS-2$
        final TeiidException err = new TeiidException(child, "Test"); //$NON-NLS-1$
        assertSame(child, err.getChild());
        assertEquals("propertyValuePhrase", err.getCode()); //$NON-NLS-1$
        assertEquals("Error Code:propertyValuePhrase Message:Test", err.getMessage()); //$NON-NLS-1$
       
    }
View Full Code Here


        assertEquals("Error Code:propertyValuePhrase Message:Test", err.getMessage()); //$NON-NLS-1$
       
    }

    public void testMetaMatrixExceptionWithExceptionAndCodeAndMessage() {
        final TeiidException child = new TeiidException("propertyValuePhrase", "Child"); //$NON-NLS-1$ //$NON-NLS-2$
        final TeiidException err = new TeiidException(child, "Code", "Test"); //$NON-NLS-1$ //$NON-NLS-2$
        assertSame(child, err.getChild());
        assertEquals("Code", err.getCode()); //$NON-NLS-1$
        assertEquals("Error Code:Code Message:Test", err.getMessage()); //$NON-NLS-1$
       
    }
View Full Code Here

              // Open a stream to read the BLOB data
              InputStream l_blobStream = data.getBinaryStream();
              return convertToByteArray(l_blobStream);
          } catch (IOException ioe) {
                final Object[] params = new Object[]{data.getClass().getName()};
                throw new TeiidException(ioe,CorePlugin.Util.getString("ObjectConverterUtil.Error_translating_results_from_data_type_to_a_byte[]._1",params)); //$NON-NLS-1$
          } catch (SQLException sqe) {
                final Object[] params = new Object[]{data.getClass().getName()};
                throw new TeiidException(sqe,CorePlugin.Util.getString("ObjectConverterUtil.Error_translating_results_from_data_type_to_a_byte[]._2",params)); //$NON-NLS-1$
          }
    }
View Full Code Here

            return convertBlobToByteArray((java.sql.Blob) data);
        } else if (data instanceof File) {
          return convertFileToByteArray((File)data);
        }
        final Object[] params = new Object[]{data.getClass().getName()};
        throw new TeiidException(CorePlugin.Util.getString("ObjectConverterUtil.Object_type_not_supported_for_object_conversion._3",params)); //$NON-NLS-1$
    }
View Full Code Here

  // ################################## ACTUAL TESTS ################################

    public void testFailMetaMatrixExceptionWithNullMessage() {
        Throwable e = null;
        try {
            new TeiidException((String)null)// should throw NPE
            fail("Should not get here"); //$NON-NLS-1$
        } catch ( Throwable ex ) {
            e = ex;
        }
        assertNotNull(e);
View Full Code Here

        }
        assertNotNull(e);
    }

    public void testMetaMatrixExceptionWithNullThrowable() {
        final TeiidException err = new TeiidException((Throwable)null);
        assertNull(err.getChild());
        assertNull(err.getCode());
        assertNull(err.getMessage());
       
    }
View Full Code Here

        assertNull(err.getMessage());
       
    }

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

        assertEquals("Test", err.getMessage()); //$NON-NLS-1$
       
    }

    public void testMetaMatrixExceptionWithCodeAndMessage() {
        final TeiidException err = new TeiidException("Code", "Test"); //$NON-NLS-1$ //$NON-NLS-2$
        assertNull(err.getChild());
        assertEquals("Code", err.getCode()); //$NON-NLS-1$
        assertEquals("Error Code:Code Message:Test", err.getMessage()); //$NON-NLS-1$
       
    }
View Full Code Here

                  i++;
              }
          }
          return create(className, objArray, names, classLoader);
      } catch (Exception e) {
        throw new TeiidException(e);
      }
    }
View Full Code Here

                final ClassLoader classLoader) throws TeiidException {
      Class<?> cls;
        try {
            cls = loadClass(className,classLoader);
        } catch(Exception e) {
            throw new TeiidException(e);
        }
        Constructor<?> ctor = null;
        try {
          ctor = cls.getDeclaredConstructor(argTypes);
        } catch (NoSuchMethodException e) {
         
        }
       
        if (ctor == null && argTypes != null && argTypes.length > 0) {
          List<Class<?>> argumentsClasses = Arrays.asList(argTypes);
          List<Class<?>> argumentsClassList = convertArgumentClassesToPrimitives(argumentsClasses);
          for (Constructor<?> possible : cls.getDeclaredConstructors()) {
            if (argsMatch(argumentsClasses, argumentsClassList, possible.getParameterTypes())) {
              ctor = possible;
              break;
            }
          }
        }
       
        if (ctor == null) {
          throw new TeiidException(className + " Args: " + Arrays.toString(argTypes)); //$NON-NLS-1$
        }
       
        try {
      return ctor.newInstance(ctorObjs);
    } catch (Exception e) {
      throw new TeiidException(e);
    }
    }
View Full Code Here

TOP

Related Classes of org.teiid.core.TeiidException

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.