| 1 |  | package org.apache.torque.mojo; | 
            
  
    | 2 |  |  | 
            
  
    | 3 |  | import java.util.Properties; | 
            
  
    | 4 |  |  | 
            
  
    | 5 |  | import org.apache.commons.lang.StringUtils; | 
            
  
    | 6 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 69 (69) | Complexity: 20 | Complexity Density: 0.47 |  | 
  
  
    | 7 |  | public class ImpexError { | 
            
  
    | 8 |  | Throwable throwable; | 
            
  
    | 9 |  | String message; | 
            
  
    | 10 |  | Properties info; | 
            
  
    | 11 |  | String url; | 
            
  
    | 12 |  | String driver; | 
            
  
    | 13 |  | boolean showPassword; | 
            
  
    | 14 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 15 | 0 |  public Throwable getThrowable() {... | 
            
  
    | 16 | 0 | return throwable; | 
            
  
    | 17 |  | } | 
            
  
    | 18 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 19 | 0 |  public void setThrowable(Throwable throwable) {... | 
            
  
    | 20 | 0 | this.throwable = throwable; | 
            
  
    | 21 |  | } | 
            
  
    | 22 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 23 | 0 |  public String getMessage() {... | 
            
  
    | 24 | 0 | return message; | 
            
  
    | 25 |  | } | 
            
  
    | 26 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 27 | 0 |  public void setMessage(String message) {... | 
            
  
    | 28 | 0 | this.message = message; | 
            
  
    | 29 |  | } | 
            
  
    | 30 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 31 | 0 |  public Properties getInfo() {... | 
            
  
    | 32 | 0 | return info; | 
            
  
    | 33 |  | } | 
            
  
    | 34 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 35 | 0 |  public void setInfo(Properties info) {... | 
            
  
    | 36 | 0 | this.info = info; | 
            
  
    | 37 |  | } | 
            
  
    | 38 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 18 (18) | Complexity: 4 | Complexity Density: 0.33 |  | 
  
  
    | 39 | 0 |  public String toString() {... | 
            
  
    | 40 | 0 | StringBuffer sb = new StringBuffer(); | 
            
  
    | 41 | 0 | sb.append("\n\n"); | 
            
  
    | 42 | 0 | if (!StringUtils.isEmpty(message)) { | 
            
  
    | 43 | 0 | sb.append(message + "\n\n"); | 
            
  
    | 44 |  | } | 
            
  
    | 45 | 0 | if (getThrowable() != null) { | 
            
  
    | 46 | 0 | sb.append("------------------------------------------------------\n"); | 
            
  
    | 47 | 0 | String emsg = getThrowable().getMessage(); | 
            
  
    | 48 | 0 | sb.append(emsg); | 
            
  
    | 49 | 0 | if (!emsg.endsWith("\n")) { | 
            
  
    | 50 | 0 | sb.append("\n"); | 
            
  
    | 51 |  | } | 
            
  
    | 52 |  | } | 
            
  
    | 53 | 0 | sb.append(toString(getInfo())); | 
            
  
    | 54 | 0 | return sb.toString(); | 
            
  
    | 55 |  | } | 
            
  
    | 56 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 25 (25) | Complexity: 4 | Complexity Density: 0.21 |  | 
  
  
    | 57 | 0 |  public String toString(Properties info) {... | 
            
  
    | 58 | 0 | StringBuffer sb = new StringBuffer(); | 
            
  
    | 59 | 0 | sb.append("------------------------------------------------------\n\n"); | 
            
  
    | 60 | 0 | sb.append("The following information was provided to JDBC:\n"); | 
            
  
    | 61 | 0 | sb.append("------------------------------------------------------\n"); | 
            
  
    | 62 | 0 | sb.append("URL: " + getUrl() + "\n"); | 
            
  
    | 63 | 0 | sb.append("Driver: " + getDriver() + "\n"); | 
            
  
    | 64 | 0 | String username = info.getProperty(AbstractSQLExecutorMojo.DRIVER_INFO_PROPERTIES_USER); | 
            
  
    | 65 | 0 | if (StringUtils.isEmpty(username)) { | 
            
  
    | 66 | 0 | sb.append("Username: [No username was supplied]\n"); | 
            
  
    | 67 |  | } else { | 
            
  
    | 68 | 0 | sb.append("Username: " + username + "\n"); | 
            
  
    | 69 |  | } | 
            
  
    | 70 | 0 | String password = info.getProperty(AbstractSQLExecutorMojo.DRIVER_INFO_PROPERTIES_PASSWORD); | 
            
  
    | 71 | 0 | if (isShowPassword()) { | 
            
  
    | 72 | 0 | sb.append("Password: " + password + "\n"); | 
            
  
    | 73 |  | } else { | 
            
  
    | 74 | 0 | if (StringUtils.isEmpty(password)) { | 
            
  
    | 75 | 0 | sb.append("Password: [No password was supplied]\n"); | 
            
  
    | 76 |  | } else { | 
            
  
    | 77 | 0 | sb.append("Password: *******\n"); | 
            
  
    | 78 |  | } | 
            
  
    | 79 |  | } | 
            
  
    | 80 | 0 | sb.append("------------------------------------------------------\n"); | 
            
  
    | 81 | 0 | sb.append("\n"); | 
            
  
    | 82 | 0 | return sb.toString(); | 
            
  
    | 83 |  |  | 
            
  
    | 84 |  | } | 
            
  
    | 85 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 86 | 0 |  public String getUrl() {... | 
            
  
    | 87 | 0 | return url; | 
            
  
    | 88 |  | } | 
            
  
    | 89 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 90 | 0 |  public void setUrl(String url) {... | 
            
  
    | 91 | 0 | this.url = url; | 
            
  
    | 92 |  | } | 
            
  
    | 93 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 94 | 0 |  public String getDriver() {... | 
            
  
    | 95 | 0 | return driver; | 
            
  
    | 96 |  | } | 
            
  
    | 97 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 98 | 0 |  public void setDriver(String driver) {... | 
            
  
    | 99 | 0 | this.driver = driver; | 
            
  
    | 100 |  | } | 
            
  
    | 101 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 102 | 0 |  public boolean isShowPassword() {... | 
            
  
    | 103 | 0 | return showPassword; | 
            
  
    | 104 |  | } | 
            
  
    | 105 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 106 | 0 |  public void setShowPassword(boolean showPassword) {... | 
            
  
    | 107 | 0 | this.showPassword = showPassword; | 
            
  
    | 108 |  | } | 
            
  
    | 109 |  |  | 
            
  
    | 110 |  | } |