ModificaIndirizzo.java

1
package control.ordine;
2
3
import model.utente.UtenteBean;
4
import model.utente.UtenteDAO;
5
6
import javax.servlet.ServletException;
7
import javax.servlet.annotation.WebServlet;
8
import javax.servlet.http.HttpServlet;
9
import javax.servlet.http.HttpServletRequest;
10
import javax.servlet.http.HttpServletResponse;
11
import java.io.IOException;
12
import java.sql.SQLException;
13
14
@WebServlet("/ModificaIndirizzo")
15
public class ModificaIndirizzo extends HttpServlet {
16
    @Override
17
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
18
        UtenteBean utenteBean = (UtenteBean) req.getSession().getAttribute("utente");
19
20
        String viaNuova = req.getParameter("viaNuova");
21
        String cittaNuova = req.getParameter("cittaNuova");
22
        String capNuova = req.getParameter("capNuova");
23
24 1 1. doPost : removed call to model/utente/UtenteBean::setVia → KILLED
        utenteBean.setVia(viaNuova);
25 1 1. doPost : removed call to model/utente/UtenteBean::setCitta → KILLED
        utenteBean.setCitta(cittaNuova);
26 1 1. doPost : removed call to model/utente/UtenteBean::setCap → KILLED
        utenteBean.setCap(capNuova);
27
28
        UtenteDAO utenteDAO = new UtenteDAO();
29
30
        try {
31 1 1. doPost : removed call to model/utente/UtenteDAO::doUpdate → KILLED
            utenteDAO.doUpdate(utenteBean);
32
        } catch (SQLException e) {
33 1 1. doPost : removed call to javax/servlet/RequestDispatcher::forward → KILLED
            req.getRequestDispatcher("/pages/errorpage.jsp").forward(req, resp);
34
        }
35
36 1 1. doPost : removed call to javax/servlet/http/HttpServletResponse::sendRedirect → KILLED
        resp.sendRedirect("StoricoOrdini");
37
38
    }
39
}

Mutations

24

1.1
Location : doPost
Killed by : control.ordine.ModificaIndirizzoTest.[engine:junit-jupiter]/[class:control.ordine.ModificaIndirizzoTest]/[method:doPost_ok_updatesBeanAndRedirects()]
removed call to model/utente/UtenteBean::setVia → KILLED

25

1.1
Location : doPost
Killed by : control.ordine.ModificaIndirizzoTest.[engine:junit-jupiter]/[class:control.ordine.ModificaIndirizzoTest]/[method:doPost_ok_updatesBeanAndRedirects()]
removed call to model/utente/UtenteBean::setCitta → KILLED

26

1.1
Location : doPost
Killed by : control.ordine.ModificaIndirizzoTest.[engine:junit-jupiter]/[class:control.ordine.ModificaIndirizzoTest]/[method:doPost_ok_updatesBeanAndRedirects()]
removed call to model/utente/UtenteBean::setCap → KILLED

31

1.1
Location : doPost
Killed by : control.ordine.ModificaIndirizzoTest.[engine:junit-jupiter]/[class:control.ordine.ModificaIndirizzoTest]/[method:doPost_dbException_forwardsError_thenRedirects()]
removed call to model/utente/UtenteDAO::doUpdate → KILLED

33

1.1
Location : doPost
Killed by : control.ordine.ModificaIndirizzoTest.[engine:junit-jupiter]/[class:control.ordine.ModificaIndirizzoTest]/[method:doPost_dbException_forwardsError_thenRedirects()]
removed call to javax/servlet/RequestDispatcher::forward → KILLED

36

1.1
Location : doPost
Killed by : control.ordine.ModificaIndirizzoTest.[engine:junit-jupiter]/[class:control.ordine.ModificaIndirizzoTest]/[method:doPost_dbException_forwardsError_thenRedirects()]
removed call to javax/servlet/http/HttpServletResponse::sendRedirect → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.0