@Test(expected = MojoExecutionException.class) public void testValidateDbType_WRONG_postgresql9() throws Exception { System.out.println("WRONG_"); Generator instance = new Generator(); instance.dbType = "postgresql9"; instance.validateDbType(); }
protected void validateDbType() throws MojoExecutionException { if (dbType == null || dbType.trim().length() == 0) { throw new MojoExecutionException("EasyDao engine configuration exception: wrong dbType. Valid values are: ORACLE10, ORACLE11, POSTGRESQL9"); } else { try { EngineConfiguration.DATABASE_TYPE.valueOf(dbType); } catch (IllegalArgumentException ex) { throw new MojoExecutionException("EasyDao engine configuration exception: wrong dbType. Valid values are: ORACLE10, ORACLE11, POSTGRESQL9"); } } }
Generator extends AbstractMojo { protected void validateDbType() throws MojoExecutionException { if (dbType == null || dbType.trim().length() == 0) { throw new MojoExecutionException("EasyDao engine configuration exception: wrong dbType. Valid values are: ORACLE10, ORACLE11, POSTGRESQL9"); } else { try { EngineConfiguration.DATABASE_TYPE.valueOf(dbType); } catch (IllegalArgumentException ex) { throw new MojoExecutionException("EasyDao engine configuration exception: wrong dbType. Valid values are: ORACLE10, ORACLE11, POSTGRESQL9"); } } } }
Generator extends AbstractMojo { protected void validateDbType() throws MojoExecutionException { if (dbType == null || dbType.trim().length() == 0) { throw new MojoExecutionException("EasyDao engine configuration exception: wrong dbType. Valid values are: ORACLE10, ORACLE11, POSTGRESQL9"); } else { try { EngineConfiguration.DATABASE_TYPE.valueOf(dbType); } catch (IllegalArgumentException ex) { throw new MojoExecutionException("EasyDao engine configuration exception: wrong dbType. Valid values are: ORACLE10, ORACLE11, POSTGRESQL9"); } } }  }
Generator extends AbstractMojo { protected void validateDbType() throws MojoExecutionException { if (dbType == null || dbType.trim().length() == 0) { throw new MojoExecutionException("EasyDao engine configuration exception: wrong dbType. Valid values are: ORACLE10, ORACLE11, POSTGRESQL9"); } else { try { EngineConfiguration.DATABASE_TYPE.valueOf(dbType); } catch (IllegalArgumentException ex) { throw new MojoExecutionException("EasyDao engine configuration exception: wrong dbType. Valid values are: ORACLE10, ORACLE11, POSTGRESQL9"); } } }  void execute(); }
Generator extends AbstractMojo { protected void validateDbType() throws MojoExecutionException { if (dbType == null || dbType.trim().length() == 0) { throw new MojoExecutionException("EasyDao engine configuration exception: wrong dbType. Valid values are: ORACLE10, ORACLE11, POSTGRESQL9"); } else { try { EngineConfiguration.DATABASE_TYPE.valueOf(dbType); } catch (IllegalArgumentException ex) { throw new MojoExecutionException("EasyDao engine configuration exception: wrong dbType. Valid values are: ORACLE10, ORACLE11, POSTGRESQL9"); } } }  void execute();  }