### Question:
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();  }### Answer:
@Test public void testValidateDbType_ORACLE11() throws Exception { System.out.println("testValidateDbType_ORACLE11"); Generator instance = new Generator(); instance.dbType = "ORACLE11"; instance.validateDbType(); }
@Test public void testValidateDbType_POSTGRESQL9() throws Exception { System.out.println("testValidateDbType_POSTGRESQL9"); Generator instance = new Generator(); instance.dbType = "POSTGRESQL9"; instance.validateDbType(); }
@Test(expected = MojoExecutionException.class) public void testValidateDbType_WRONG_postgresql9() throws Exception { System.out.println("WRONG_"); Generator instance = new Generator(); instance.dbType = "postgresql9"; instance.validateDbType(); }
@Test(expected = MojoExecutionException.class) public void testValidateDbType_WRONG_postgres() throws Exception { System.out.println("testValidateDbType_WRONG_postgres"); Generator instance = new Generator(); instance.dbType = "postgres"; instance.validateDbType(); }