johnny 22
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # MES - Práctica 4 ## Pruebas unitarias Se ha creado un paquete pruebas en el que hay una clasePrueba para cada clase de la capa lógica. En cada clase de Pruebas se sigue una estructura similar, donde se utiliza un método con la anotación *@Before* para inicializar las variables necesarias antes de realizar las pruebas. Un ejemplo sería el siguiente: ```java @Before //El método con la anotación @Before se ejecutará el primero de todos . public void setup() { cliente = new Cliente("12345678X", "Juan", "calle 13", "Barrirera", "46005", LocalDateTime.of(2022, 10, 15, 0, 0), "1234567891234567", 12, 2023, 123, "VISA"); } ``` Tras esto se crea un método de prueba con la anotación *@Test* para cada método de la clase que estamos evaluando. Utilizamos *assertEquals* para comprobar que cada método realiza su función correctamente. Por ejemplo, en el siguiente método se verifica que el constructor de la clase Cliente asigne los valores correctamente: ```java @Test public void testConstructor1() { assertEquals("12345678X", cliente.getDNI()); assertEquals("Juan", cliente.getNombreyApellidos()); assertEquals("calle 13", cliente.getDireccion()); assertEquals("Barrirera", cliente.getPoblacion()); assertEquals("46005", cliente.getCodPostal()); assertEquals(LocalDateTime.of(2022, 10, 15, 0, 0), cliente.getFechaCarnetConducir()); assertEquals("1234567891234567", cliente.getDigitosTC()); assertEquals(12, cliente.getMesTC()); assertEquals(2023, cliente.getAnyoTC()); assertEquals(123, cliente.getCvcTC()); assertEquals("VISA", cliente.getTipoTC()); } ``` Otro ejemplo del test de un método sería: ```java @Test public void testGetDNI() { assertEquals("12345678X", cliente.getDNI()); } ``` # MES - Práctica 5 (Corrección de bugs) ## FindBugs Se ha utilizado la herramienta FindBugs para la detección de los errores que existían en el código. Como se ve en la imagen de abajo, la herramienta Findbugs proporciona una lista con todos los bugs a corregir ![](https://i.imgur.com/QQvgjLn.png). 1. Primero se han arreglado los bugs de *"Troubling"*, para ello se ha cambiado la forma en la que se pasan los parámetros a la función *queryDB*, antes se le pasa directamente la búsqueda a la función, tras la corrección, la búsqueda se asigna a una variable *string* y después esta variable se pasa a la función. ![](https://i.imgur.com/hCeAtDC.png) Tenemos un ejemplo de cómo se ha corregido a continuación: ```java public CategoriaDTO buscarCategoria(String nombre) throws DAOExcepcion { try{ connManager.connect(); ResultSet rs = connManager.queryDB("select * from CATEGORIA where NOMBRE= '"+nombre+"'"); connManager.close(); //---------------------------------------------------------- public CategoriaDTO buscarCategoria(String nombre) throws DAOExcepcion { try{ String sql =String.format("select * from CATEGORIA where NOMBRE= '%s'",nombre); connManager.connect(); ResultSet rs = connManager.queryDB(sql); connManager.close(); ``` 2. Seguidamente, se arreglaron los bugs de *"Dead store to local variable"*, provocados por una asignación a una variable que no se usa, los cuales se solucionan al quitar la asignación de la variable que no se usa después. ![](https://i.imgur.com/WiVqLVR.png) ```diff! public class TestCapaLogica { public static void main(String args[]) throws DAOExcepcion { AlquilerVehiculos av = AlquilerVehiculos.getSingleton(); av.cargaSistema(); -- ArrayList<Categoria> list = av.listarCategorias(); -- ArrayList<Sucursal> list1 = av.listarSucursales(); //System.out.print(av.listarVehiculosSucursal(2)); System.out.println(av.listarVehiculosCategoriaSucursal("luxury",2)); // for (int i = 0; i < list.size(); i++) // for (int j = 0; j < list1.size(); j++) // System.out.println(av.listarVehiculosCategoriaSucursal(list.get(i).getNombre(), list1.get(j).getIdSucursal())); } } ``` 3. También se han arreglado los bugs de *"May expose internal representation by returning reference to mutable object"* los cuales tienen lugar cuando se puede modificar una variable inintencionadamente, para corregir esto se debe hacer una *Deep-copy* antes del return. ![](https://i.imgur.com/yWbda7J.png) ```java public Hashtable<String, Danyo> getColeccionDanyos() { return this.coleccionDanyos; } //----------------------------------------------------------- public Hashtable<String, Danyo> getColeccionDanyos() { return new Hashtable<>(coleccionDanyos); } ``` 5. Agregado a lo anterior, se solucionó el bug *"Method names should start with a lower case letter"* al escribir en minúscula la primera letra del método, como se puede ver en la siguiente imagen: ![](https://i.imgur.com/tTHlLLR.png) ```diff -- public void EntregarCoche(Reserva reserva, String tseguro,Double Kma, -- Double combustible, Coche TCoche, String DNIEmpleado) { ++ public void entregarCoche(Reserva reserva, String tseguro,Double Kma, ++ Double combustible, Coche TCoche, String DNIEmpleado) { ``` 6. Asimismo, el bug *"Method may fail to close database"* se arregla al asegurar que se cierra completamente el *statement*, como se puede observar: ![](https://i.imgur.com/JRjCpb7.png) ```diff public ResultSet queryDB(String sql) throws SQLException { if (dbcon != null) { Statement sentencia = dbcon.createStatement(); ++ try { return sentencia.executeQuery(sql); ++ } finally { ++ sentencia.close(); ++ } } return null; } ``` 7. *"Unread file"* ocurre cuando una variable no es utilizada, por lo que la corrección es simplemente borrarla. ![](https://i.imgur.com/QKcXqNE.png) ```diff public Empleado(String dNI, String nombre, boolean administrador,Sucursal trabaja) { super(); DNI = dNI; this.nombre = nombre; this.administrador = administrador; -- this.trabaja=trabaja; } public Empleado(EmpleadoDTO e) { super(); DNI = e.getDni(); this.nombre = e.getNombreyApellidos(); this.administrador = e.getAdministrador(); -- this.trabaja=null; } ``` ## Bugs registrados en Bugzilla ### Bug 286 - Registro de cliente en menú equivocado Al acceder al menú de empleado, aparece la opción de registrar un cliente, opción que debería aparecer en el menú de cliente. **Para este bug no se puede crear test debido a ser un bug de visualización** **Identificador de commit: 74da03d2a85175894332c3a92e25891e7051a9a2** ![](https://i.imgur.com/nhCCjeh.png) En la capa presentación, en la clase *Principal.fxml* se ha eliminado el *MenuItem* que se corresponde con la opción de crear un cliente del menú de empleado. ```diff <Menu mnemonicParsing="false" text="Empleado"> <items> -- <MenuItem mnemonicParsing="false"onAction="#crearCliente" text="Crear Cliente"/> <MenuItem mnemonicParsing="false" onAction="#listarReservasSucursal" text="Listar Reservas" /> <MenuItem mnemonicParsing="false" onAction="#entregarVehiculoReserva" text="Entregar Vehiculo Reserva" /> <MenuItem mnemonicParsing="false" onAction="#listarCochesSucursal" text="Listar vehículos disponibles" /> <MenuItem mnemonicParsing="false" onAction="#listarCategorias" text="Listar categorias" /> </items> </Menu> ``` EL resultado sería el siguiente: ![](https://i.imgur.com/XS67FHq.png) ### Bug 290 - El campo "Archivo" solo tiene la opción de salir de la aplicación Al iniciar la aplicación y seleccionar el campo "Archivo" solo se muestra una opción llamada "Salir" que lo que hace es cerrar la aplicación. **Para este bug no se puede crear test debido a ser un bug de visualización** **Identificador de commit: 682dc2021453d6389f82d30e7a80275a639c450d** El campo "Archivo" de la *Menu Bar* es erróneo, por lo que se ha modificado el nombre del menú a "Opciones" ya que este ítem te permite salir de la aplicación, no acceder a archivos. ![](https://i.imgur.com/BCuJlHT.png) Tras modificar *text="Archivo"* por *text="Opciones"* se solucionaría el bug y quedaría así: ```java <Menu mnemonicParsing="false" text="Opciones"> ``` ![](https://i.imgur.com/opafXKP.png) ### Bug 294 - El botón de crear nuevo cliente no notifica al usuario del error al introducir una excepción La aplicación no es capaz de notificar el usuario de posibles errores que ocurran al introducir información. Por ejemplo, al intentar crear un usuario con todos sus campos a nulos, se puede visualizar una excepción por consola. **Para este bug no se puede crear test debido a ser un bug de visualización** **Identificador de commit: 3d870692d248f901e9dfb6bbc3ef9f38b44aa1f0** Para solucionar el bug, se han añadido unas comprobaciones para que salte el error en caso necesario. Así pues, se muestra una alerta indicando los errores en el caso de que se intente crear un cliente y alguno de los campos este vacío o tenga un formato erróneo. ```diff @Override public void initialize(URL location, ResourceBundle resources) { ++ LocalDateTime fechaC = null; ++ if (fechaCarnet.getValue() != null) { fechaC = fechaCarnet.getValue().atStartOfDay(); ++ } String digTC = digitosTC.getText(); ++ int mTC = -1; ++ if (esInt(mesTC.getText())) { mTC = Integer.parseInt(mesTC.getText()); ++ } ++ int aTC = -1; ++ if (esInt(anyoTC.getText())) { aTC = Integer.parseInt(anyoTC.getText()); ++ } ++ int CVC = -1; ++ if (esInt(cvc.getText())) { CVC = Integer.parseInt(cvc.getText()); ++ } tipoTarjeta.setItems(opciones); String tT = tipoTarjeta.getValue(); // fin isInputValid try { if (isInputValid(DNI, NyA, dir, pob, CP, fechaC, digTC, mTC, aTC, CVC, tT)) { crearCliente(DNI, NyA, dir, pob, CP, fechaC, digTC, mTC, aTC, CVC, tT); stage.close(); } } catch (NumberFormatException e) { e.printStackTrace(); } catch (DAOExcepcion e) { e.printStackTrace(); } }); } ``` Así quedaría el proyecto una vez solucionado: ![](https://i.imgur.com/hapgR3Z.png) ### Bug 295 - Caracteres ilegibles en mensaje de advertencia en Crear Reserva Cuando se intenta crear una reserva, si el campo "dni" o el de "dirección devolución" no han sido completados salta un mensaje de advertencia en el que los acentos no son caracteres legibles para el usuario. **Para este bug no se puede crear test debido a ser un bug de visualización** **Identificador de commit: dc971e938859a3e688214dff3dc5b709c431698c** ![](https://i.imgur.com/RlrPJCN.png) Para corregir los mensajes de error lo único que se ha realizado ha sido quitar las tildes de los mensajes de error que se muestran por pantalla. ![](https://i.imgur.com/hcmaXzZ.png) De esta manera, cuando se muestren los mensajes de error, no saldrán caracteres ilegibles. Cabe destacar que este bug ha sido corregido también en el resto de interfaces. ![](https://i.imgur.com/xYwO0zS.png) ### Bug 416 - El sistema no informa al usuario de la creación de una reserva Cuando se intenta crear una reserva introduciendo todos los datos correctamente el sistema no informa al usuario de que la reserva ha sido creada con éxito. **Para este bug no se puede crear test debido a ser un bug de visualización** **Identificador de commit: 60a4a464c0fe322654b819c8861163b11945caf9** Para solucionar el bug, una vez se ha creado la reserva, se muestra una alerta confirmando que se ha creado con éxito. Para ello, se ha añadido el siguiente código dentro del controlador de crear reserva: ```diff @Override public void initialize(URL location, ResourceBundle resources) { aceptar.setOnAction(event -> { try { if (isInputValid()) { // DATOS String DNI = dni.getText(); cRealiza=AlquilerVehiculos.getSingleton().getCliente(DNI); LocalDateTime fecRec = fechaRecogida.getValue().atStartOfDay(); LocalDateTime fecDev = fechaDevolucion.getValue().atStartOfDay(); Sucursal recogida = AlquilerVehiculos.getSingleton().getSucursal(idSucursalRec); Sucursal devolucion = AlquilerVehiculos.getSingleton().getSucursal(idSucursalDev); Categoria AlquilerVehiculos.getSingleton().crearReserva(fecRec,fecDev,mod, cRealiza, categoria,recogida,devolucion); ++ Alert alerta = new Alert(AlertType.CONFIRMATION); ++ alerta.setTitle("RESERVA CREADA!"); ++ alerta.setContentText("Reserva creada con éxito"); ++ alerta.showAndWait(); stage.close(); }// fin isInputValid } catch (DAOExcepcion e) { e.printStackTrace(); } }); } ``` Así se quedaría el bug una vez corregido: ![](https://i.imgur.com/VMsEp7P.png) ### Bug 419 - El campo Tipo de Tarjeta no es intuitivo En el campo tipo de tarjeta del formulario de crear usuario no queda claro qué hay que introducir. **Para este bug no se puede crear test debido a ser un bug de visualización** **Identificador de commit: d4964db035a04f60cf83991de29edbdb927ff399** ![](https://i.imgur.com/Fc5jYqg.png) Se cambia el *texField* de Tipo de tarjeta por un *comboBox* con las distintas opciones de pago. Se elimina el *textField* y se añade un *comboBox* en la clase fxml de crear cliente: ```diff -- <TextField fx:id="tipoTarjeta" maxWidth="1.7976931348623157E308" --minWidth="-Infinity" prefHeight="27.0" prefWidth="272.0"> -- <padding> -- <Insets bottom="4.0" left="4.0" right="4.0" top="4.0" /> -- </padding> -- </TextField> ++ <ComboBox fx:id="tipoTarjeta" prefWidth="150.0"> ++ <HBox.margin> ++ <Insets left="5.0" /> ++ </HBox.margin> ++ </ComboBox> ``` Se inicializa el *comboBox* junto a sus valores en el método *initialize* del controlador crear cliente: ```diff public void initialize(URL location, ResourceBundle resources) { stage = new Stage(StageStyle.DECORATED); stage.setTitle("CREAR CLIENTE"); fechaCarnet.setConverter(converter); ++ ObservableList<String> opcione ++ FXCollections.observableArrayList("Mastercard", "Visa", "Paypal"); ++ tipoTarjeta.setValue("Mastercard"); ++ tipoTarjeta.setItems(opciones); ``` El resultado sería el siguiente: ![](https://i.imgur.com/oBiyRzF.png) ### Bug 421 - Al listar reservas no aparece por defecto ninguna reserva Al entrar en listar reservas aparece como si no hubiese ninguna reserva registrada aunque si que hayan **Para este bug no se han creado tests porque se trata de una nueva funcionalidad.** **Identificador de commit: f60c6f830e4d33cc172fea5f50119c3d7a1130df** Para solucionar el bug, se ha creado un método nuevo *listarTodasLasSucursales()* en el que cargamos las reservas de todas las sucursales de la base de datos en la tabla en el *initialize*. ```diff ++private void listarTodasLasSucursales() { ++ this.reservaT.getItems().clear(); ++ ++ try { ++ for(Sucursal sucursal AlquilerVehiculos.getSingleton().listarSucursales()) { ++ this.reservaT.getItems().addAll( ++ AlquilerVehiculos.getSingleton(). ++ .listarReservasSucursal(sucursal.getIdSucursal()) ++ ); ++ } ++ } catch (DAOExcepcion e) { ++ // TODO Auto-generated catch block ++ e.printStackTrace(); ++ } ++ } ``` ```diff public void initialize(URL location, ResourceBundle resources) { entregado.setStyle("-fx-alignment: CENTER;"); buscarT.textProperty().addListener( (observable, oldValue, newValue) -> esInt(newValue)); buscarB.setOnAction(event -> listar()); ++ listarTodasLasSucursales(); } ``` El resultado sería el siguiente: ![](https://i.imgur.com/H06FwhI.png) ### Bug 431 - Al entregar un vehículo no comprueba que el kilometraje sea correcto Al rellenar los campos de la entrega de un vehículo y confirma, no comprueba que el kilometraje actual del coche sea mayor que el que ya tenía registrado previamente. Para solucionar el bug basta con añadir la comprobación de los kilómetros dentro del método *IsInputValid* como se ve a continuación: **Identificador de commit:2d46b459e18a51c44502125176808dfe28f96d60** ```java private boolean isInputValid(Reserva reserva, String tseguro,Double Kma, Double combustible, Coche TCoche, String DNIEmpleado) throws NumberFormatException, DAOExcepcion { String errorMessage = ""; if(reserva == null) errorMessage += "No ha seleccionado ninguna reserva en la tabla.\n"; if(TCoche == null) errorMessage += "No ha seleccionado un vehiculo en la tabla.\n"; if (tseguro == "") errorMessage += "No has seleccionado un tipo de seguro.\n"; if (Kma == null || Kma<TCoche.getKmsActuales()) errorMessage += "No has introducido un valor valido para el kilometraje.\n"; if (combustible == null || combustible<0)//combustible <0 errorMessage += "No has introducido un valor valido para el combustible.\n"; if (DNIEmpleado.length() == 0) { errorMessage += "DNI introducido no valido.\n"; } else { if (AlquilerVehiculos.getSingleton().getEmpleado(DNIEmpleado) == null) errorMessage += "No existe un empleado con el DNI introducido.\n"; } if (errorMessage.length() == 0) { return true; } else { MensajeDeError = errorMessage; return false; } } ``` No se puede conseguir imagen del bug ocurriendo, pues, al crearse la entrega, se cierra automáticamente sin notificar nada. ![](https://i.imgur.com/LOgxBIn.png) #### Ejecución del test Antes: ![](https://i.imgur.com/lDXUJNz.png) Después ![](https://i.imgur.com/PyFXLwq.png) ### Bug 435 - El sistema no es capaz de crear clientes **Para este bug no se puede crear test debido a ser un bug de visualización** **Identificador de commit: 20945bc4aaac548bea9131e4db1ab794b1ace0c7** Cuando se intenta dar de alta a un cliente al introducir correctamente cada uno de sus campos, el sistema queda bloqueado y no muestra nada por pantalla. Dentro del *initialize* del controlador de crear cliente se han añadido las líneas relacionadas con la alerta con el fin de mostrar por pantalla un mensaje en el caso de que el cliente haya sido creado con éxito ```diff try { if (isInputValid(DNI, NyA, dir, pob, CP, fechaC, digTC, mTC, aTC, CVC, tT)) { crearCliente(DNI, NyA, dir, pob, CP, fechaC, digTC, mTC, aTC, CVC, tT); ++ Alert alerta = new Alert(AlertType.CONFIRMATION); ++ alerta.setTitle("Cliente"); ++ alerta.setContentText("Cliente Creado Con éxito"); ++ alerta.showAndWait(); stage.close(); } } catch (NumberFormatException e) { e.printStackTrace(); ``` El resultado sería el siguiente: ![](https://i.imgur.com/uiA5ESf.png) ### Bug 441 - Ventanas emergentes no modales Las ventanas emergentes que dispara la aplicación no son modales, por lo que podemos abrir continuamente nuevas ventanas, pudiendo crear por ejemplo varios clientes a la vez. **Para este bug no se puede crear test debido a ser un bug de visualización** **Identificador de commit: c2a731358ec68f17b86d5e3cc352fe6a103910ce** Había que añadir la línea: *controlador.stage.initModality(Modality.APPLICATIONMODAL);* ```java public static <T extends ControladorCasoDeUso> T initCasoDeUso( String urlVista, Class<T> controlClass, Stage owner, ControladorPrincipal controladorPrincipal) { FXMLLoader fxmlLoader = new FXMLLoader( ControladorCasoDeUso.class.getResource(urlVista)); T controlador = null; try { Parent parent = fxmlLoader.load(); controlador = fxmlLoader.getController(); controlador.stage.setScene(new Scene(parent)); controlador.stage.initOwner(owner); controlador.stage.initModality(Modality.APPLICATION_MODAL); controlador.setControladorPrincipal(controladorPrincipal); } catch (NullPointerException | IOException e) { e.printStackTrace(); } return controlador; } ``` Antes: ![](https://i.imgur.com/P40WlvV.png) Después: ![](https://i.imgur.com/2JcMtTL.png) ### Bug 450 - El campo "Combustible" permite valores negativos Durante la comprobación para llevar la acción de crear la entrega no se tiene en cuenta que el valor del combustible pueda ser negativo. Para solucionar el bug basta con añadir la comprobación en el campo de combustible dentro del método *IsInputValid* como se ve a continuación: **Identificador del commit:dd1bc7db94c24edc8b3c2501be5c7358644732d5** ```java private boolean isInputValid(Reserva reserva, String tseguro,Double Kma, Double combustible, Coche TCoche, String DNIEmpleado) throws NumberFormatException, DAOExcepcion { String errorMessage = ""; if(reserva == null) errorMessage += "No ha seleccionado ninguna reserva en la tabla.\n"; if(TCoche == null) errorMessage += "No ha seleccionado un vehiculo en la tabla.\n"; if (tseguro == "") errorMessage += "No has seleccionado un tipo de seguro.\n"; if (Kma == null) errorMessage += "No has introducido un valor valido para el kilometraje.\n"; if (combustible == null || combustible<0)//combustible <0 errorMessage += "No has introducido un valor valido para el combustible.\n"; if (DNIEmpleado.length() == 0) { errorMessage += "DNI introducido no valido.\n"; } else { if (AlquilerVehiculos.getSingleton().getEmpleado(DNIEmpleado) == null) errorMessage += "No existe un empleado con el DNI introducido.\n"; } if (errorMessage.length() == 0) { return true; } else { MensajeDeError = errorMessage; return false; } } ``` No se puede conseguir imagen del bug ocurriendo, pues, al crearse la entrega, se cierra automáticamente sin notificar nada. ![](https://i.imgur.com/EggrxDL.png) El resultado después de arreglar el bug es una ventana emergente donde nos notifica que el valor no es correcto. #### Ejecución del test Antes: ![](https://i.imgur.com/9GiVU49.png) Después: ![](https://i.imgur.com/mxI0s7n.png) ## Historial * 8348036 (HEAD -> master, origin/master) Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git |\ | * 8105cdb Fn pruebas de integracion * | 6bfab2c Entrega final |/ * 276711c Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git |\ | * b79f211 Merge Aeerglado | * c55d88e Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git | |\ | * | d5cd812 Prueba de integracion CrearCliente * | | 06f8a9a JavaDOC | |/ |/| * | 770ff1d Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git |\ \ | * | 770d1e2 Correccion Pruebas | * | ca08a5e Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git | |\ \ | | * | 5cfbf10 JUnit correcci贸n | | * | 7f7946b JUnit | | |/ | | * be3ecec Final Junit | * | 2d46b45 Bug431 terminado y test correcto | * | fa64b82 Bug431 terminado con test | |/ | * 06c4ad9 BUG431 | * eceae83 Bug431 * | 6f902aa commit to merge * | f60c6f8 Soluci贸n bug 421 bugzilla |/ * 1ec5d89 Reserva JUnit corregido * 09f1cd3 Constructores JUnit * 20945bc Bug 435 corregido (sistema no es capaz de crear clientes) * d45617c arreglar merge * 8c886c2 Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git |\ | * dd1bc7d Bug450 Arreglado y pasando test * | 60a4a46 Solucion bug 416 del bugzilla * | 3d87069 Correcci贸n bug 294 de bugzilla. |/ * b168574 Bug450 * 21b4843 correccion controlador * c2a7313 Bug 441 Corregido (Ventanas emergentes no modales) * d4964db Bug 419 corregido (Tipo de tarjeta campo no intuituvo) * 74da03d Bug 286 corregido (crear cliente en apartado de empleado) * 44689b1 Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git * 2571f00 Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2 |\ | * d4e5c7e Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git | |\ | * | d7ce21b TestUnitarios * | | dc971e9 Bug 295 corregido. Car谩cteres ilegibles en mensaje de advertencia en crear reserva | |/ |/| * | 3c9244f Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2 |\ \ | * | 054c125 Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git | |\| | | * a0acf21 Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git | | |\ | | | * 682dc20 Bug 290 Corregido (El campo archivo solo tiene la opci贸n de salir de la aplicaci贸n) | | * | 9e70be3 Documentaci贸n | | |/ | * / e6b4daf pruebasEntrega actualizacion | |/ * / bbc2e28 Capa l贸gica comentaday revisada. |/ * adf5580 soluci贸n JUnit (pruebaSucursal) * a678c14 Con @before * 3cdb889 JUnit de las clases cliente y sucursal(da errores pero son de la clase, se solucionarlos pero creo que no debemos solucionarlos aun) * 9d07abe pruebasReserva junit toString * 50c12b4 Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git |\ | * 9f28614 Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git | |\ | | * e58d88a Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git | | |\ | | * | b06404b clase pruebas entrega | * | | cefcbcf JUnit | |/ / * | / b2e9c85 pruebasCategoria junit solucionado | |/ |/| * | 2756f98 Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git * | 0e7ef68 Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git |\| | * b384d88 Test junit * | 9e85ec9 pruebasEmpleado JUnit * | d371c02 PruebasCoche con junit |/ * 0d9d52d Junit * 913f1e4 Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git |\ | * 675fb24 Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git | * 11a4a94 Merge branch 'master' of https://gitlab2.dsic.upv.es/pcarsi/B2.git | |\ | | * 91a1131 AlquilerVehiculos comentado | * | ea9cad4 JavaDoc(Coche,Entrega,Sucursal) * | | 418808d Inicip pruebas unitarias ... (48 líneas restantes)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully