Package org.jtester.exception

Examples of org.jtester.exception.JTesterException


        // remove the not-null constraint
        sqlHandler.executeUpdate("alter table " + qualified(tableName) + " alter column " + quoted(columnName)
            + " " + dataType + " null");
      }
    } catch (Throwable e) {
      throw new JTesterException("Error while disabling not null constraints. Table name: " + tableName, e);
    } finally {
      closeQuietly(connection, statement, resultSet);
    }
  }
View Full Code Here


        clazzes = ClazzFinder.findClazzInJarApp(classPath, packPath);
      }
      return clazzes;
    } catch (Throwable e) {
      String error = String.format("RunInIDE : %s , classpath : %s", String.valueOf(runInIDE), classPath);
      throw new JTesterException(error, e);
    }
  }
View Full Code Here

      resourceInputStream = ResourceHelper.class.getClassLoader().getResourceAsStream(classPathResourceName);
      mkFileParentDir(fileSystemResourceFile);
      fileOutputStream = new FileOutputStream(fileSystemResourceFile);
      IOUtils.copy(resourceInputStream, fileOutputStream);
    } catch (IOException e) {
      throw new JTesterException(e);
    } finally {
      closeQuietly(resourceInputStream);
      closeQuietly(fileOutputStream);
    }
  }
View Full Code Here

   */
  public static URL getUrl(File file) {
    try {
      return file.toURI().toURL();
    } catch (MalformedURLException e) {
      throw new JTesterException("Unable to create URL for file " + file.getName(), e);
    }
  }
View Full Code Here

  final String date;
  final SimpleDateFormat format;

  public DateFormatMatcher(String format, String date) {
    if (date == null) {
      throw new JTesterException("the expected value can't be null!");
    }
    this.date = date;
    try {
      this.format = new SimpleDateFormat(format);
    } catch (IllegalArgumentException e) {
View Full Code Here

    }
  }

  public DateFormatMatcher(SimpleDateFormat format, String date) {
    if (date == null) {
      throw new JTesterException("the expected value can't be null!");
    }
    this.date = date;
    try {
      this.format = format;
    } catch (IllegalArgumentException e) {
View Full Code Here

  String actualDate = null;

  public boolean matches(Object actual) {
    if (actual == null) {
      throw new JTesterException("the actual value can't be null");
    }

    if (actual instanceof Calendar) {
      Date cal = ((Calendar) actual).getTime();
      actualDate = format.format(cal);
    } else if (actual instanceof Date) {
      actualDate = format.format((Date) actual);
    } else {
      throw new JTesterException(
          "the actual value must be a java.util.Date instance or a java.util.Calendar instance");
    }
    boolean isEqual = this.date.equals(actualDate);
    return isEqual;
  }
View Full Code Here

    this.type = type;
  }

  public boolean matches(Object actual) {
    if (actual == null) {
      throw new JTesterException("the actual value can't be null");
    }
    Calendar cal = null;

    if (actual instanceof Calendar) {
      cal = (Calendar) actual;
    } else if (actual instanceof Date) {
      cal = Calendar.getInstance();
      cal.setTime((Date) actual);
    } else {
      throw new JTesterException(
          "the actual value must be a java.util.Date instance or a java.util.Calendar instance");
    }
    int value = cal.get(type.calendarField());
    if (type == DateFieldType.MONTH) {
      return expected == (value + 1);
View Full Code Here

    MatcherStyle;
  }

  @Override
  public boolean equals(Object obj) {
    throw new JTesterException("the method can't be used,please use isEqualTo() instead");
  }
View Full Code Here

    throw new JTesterException("the method can't be used,please use isEqualTo() instead");
  }

  @Override
  public int hashCode() {
    throw new JTesterException("the method can't be used!");
  }
View Full Code Here

TOP

Related Classes of org.jtester.exception.JTesterException

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.