Package ch.inftec.ju.util

Examples of ch.inftec.ju.util.JuRuntimeException


    @Override
    public ValueConverter getAttribute(String attributeName) {
      try {
        return ValueConverterFactory.createNewValueConverter(this.server.getAttribute(this.objectName, attributeName));
      } catch (Exception ex) {
        throw new JuRuntimeException("Couldn't get attribute %s from MBean object %s", ex, attributeName, this.objectName);
      }
    }
View Full Code Here


        AssertUtil.assertNotEmpty("Encryption password must not be empty", password);
       
        // We'll trim the password to avoid problems with new lines and the like
        return this.password(password.trim());
      } catch (Exception ex) {
        throw new JuRuntimeException("Couldn't load password from resource %s", ex, keyFile);
      }
    }
View Full Code Here

   * @return Instance of class type.
   * @throws JuRuntimeException If no object exists
   */
  public <T> T evalObject(Class<T> clazz) {
    T obj = this.getObject(clazz);
    if (obj == null) throw new JuRuntimeException("Object not defined in generic context: " + clazz);
    return obj;
  }
View Full Code Here

      }
     
      try {
        return bos.toString("utf-8");
      } catch (Exception ex) {
        throw new JuRuntimeException("Couldn't convert byte array to String", ex);
      }
    }
View Full Code Here

          }
         
          Liquibase liquibase = new Liquibase(changeLogResourceName, resourceAccessor, db);
          liquibase.update((String)null);
        } catch (Exception ex) {
          throw new JuRuntimeException("Couldn't run Liquibase Update %s", ex, changeLogResourceName);
        }
      }
    });
   
//    this.tx.begin(); // Start a new transaction so we won't get problems with EntityManager calls after this method
View Full Code Here

 
  private Class<?> getTestClass() {
    try {
      return Class.forName(this.testClassName);
    } catch (Exception ex) {
      throw new JuRuntimeException("Couldn't get test class. Make sure it's on the classpath: " + this.testClassName);
    }
  }
View Full Code Here

                : "";
           
            logger.debug("Setting system property for test context: {}={}", key, val);
            tempSetter.setProperty(key, val);
          } else {
            throw new JuRuntimeException("SystemProperty String must be of type key=val, but was: %s", keyValStr);
          }
        }
      }
    } catch (Exception ex) {
      // When an exception occurrs, make sure we reset the properties to their original values
View Full Code Here

      url = JuUrl.resource().relativeTo(this.getTestClass()).get(actualResource);
      if (url == null) url = JuUrl.resource(actualResource);
    }
   
    if (url == null) {
      throw new JuRuntimeException(String.format("Couldn't find resource %s, relative to class %s"
          , actualResource
          , this.getTestClass()));
    }
   
    return url;
View Full Code Here

          break;
        }
      }
     
      if (cause != null) {
        throw new JuRuntimeException(causes.toString(), cause);
      } else {
        causes.addLine("Check Server log for more details");
        throw new JuRuntimeException(causes.toString());
      }
    } else {
      throw t;
    }
  }
View Full Code Here

    try {
      @SuppressWarnings("unchecked")
      T res = (T) testRunnerFacade.runMethodInEjbContext(className, methodName, new Class<?>[] {}, new Object[] {});
      return res;
    } catch (Exception ex) {
      throw new JuRuntimeException("Couldn't run method in EjbContext", ex);
    }
  }
View Full Code Here

TOP

Related Classes of ch.inftec.ju.util.JuRuntimeException

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.