OrdineDAOImpl.java

1
package com.popx.persistenza;
2
3
import com.popx.modello.OrdineBean;
4
5
import javax.sql.DataSource;
6
import java.sql.*;
7
import java.util.ArrayList;
8
import java.util.List;
9
10
public class OrdineDAOImpl implements OrdineDAO {
11
12
    private DataSource ds;
13
14
    /*@ public model boolean available;
15
      @ public invariant ds != null && available;
16
      @ represents available <- ds != null;
17
      @*/
18
19
    public OrdineDAOImpl() {
20
        this.ds = DataSourceSingleton.getInstance();
21
    }
22
23
    @Override
24
    /*@ public normal_behavior
25
      @   requires ordine != null
26
      @        && ordine.getSubtotal() >= 0
27
      @        && ordine.getCustomerEmail() != null && !ordine.getCustomerEmail().isEmpty()
28
      @        && ordine.getStatus() != null && !ordine.getStatus().isEmpty()
29
      @        && ordine.getDataOrdine() != null;
30
      @   assignable \everything;
31
      @   ensures \result ==> ordine.getId() > 0;
32
      @*/
33
    public boolean insertOrdine(OrdineBean ordine) {
34
        String query = "INSERT INTO Ordine (subtotal, customer_email, status, data_ordine) VALUES (?, ?, ?, ?)";
35
36
        try (Connection con = ds.getConnection();
37
             PreparedStatement ps = con.prepareStatement(query, PreparedStatement.RETURN_GENERATED_KEYS)) {
38
39 1 1. insertOrdine : removed call to java/sql/PreparedStatement::setFloat → KILLED
            ps.setFloat(1, ordine.getSubtotal());
40 1 1. insertOrdine : removed call to java/sql/PreparedStatement::setString → KILLED
            ps.setString(2, ordine.getCustomerEmail());
41 1 1. insertOrdine : removed call to java/sql/PreparedStatement::setString → KILLED
            ps.setString(3, ordine.getStatus());
42 1 1. insertOrdine : removed call to java/sql/PreparedStatement::setDate → KILLED
            ps.setDate(4, new java.sql.Date(ordine.getDataOrdine().getTime()));
43
44
            int affectedRows = ps.executeUpdate();
45
46
            // Recupera l'ID auto-generato
47
            ResultSet rs = ps.getGeneratedKeys();
48 1 1. insertOrdine : negated conditional → KILLED
            if (rs.next()) {
49 1 1. insertOrdine : removed call to com/popx/modello/OrdineBean::setId → KILLED
                ordine.setId(rs.getInt(1));
50
            }
51
52
            // Restituisce true se sono state modificate righe (quindi l'inserimento è riuscito)
53 2 1. insertOrdine : changed conditional boundary → SURVIVED
2. insertOrdine : negated conditional → KILLED
            return affectedRows > 0;
54
55
        } catch (SQLException e) {
56 1 1. insertOrdine : removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE
            e.printStackTrace();
57 1 1. insertOrdine : replaced boolean return with true for com/popx/persistenza/OrdineDAOImpl::insertOrdine → NO_COVERAGE
            return false; // Restituisce false in caso di errore
58
        }
59
    }
60
61
62
    @Override
63
    /*@ public normal_behavior
64
      @   requires id > 0;
65
      @   assignable \everything;
66
      @   ensures \result == null || \result.getId() == id;
67
      @*/
68
    public OrdineBean getOrdineById(int id) {
69
        String query = "SELECT * FROM Ordine WHERE id = ?";
70
        OrdineBean ordine = null;
71
72
        try (Connection con = ds.getConnection();
73
             PreparedStatement ps = con.prepareStatement(query)) {
74
75 1 1. getOrdineById : removed call to java/sql/PreparedStatement::setInt → KILLED
            ps.setInt(1, id);
76
            ResultSet rs = ps.executeQuery();
77
78 1 1. getOrdineById : negated conditional → KILLED
            if (rs.next()) {
79
                ordine = new OrdineBean();
80 1 1. getOrdineById : removed call to com/popx/modello/OrdineBean::setId → KILLED
                ordine.setId(rs.getInt("id"));
81 1 1. getOrdineById : removed call to com/popx/modello/OrdineBean::setSubtotal → KILLED
                ordine.setSubtotal(rs.getFloat("subtotal"));
82 1 1. getOrdineById : removed call to com/popx/modello/OrdineBean::setCustomerEmail → KILLED
                ordine.setCustomerEmail(rs.getString("customer_email"));
83 1 1. getOrdineById : removed call to com/popx/modello/OrdineBean::setStatus → KILLED
                ordine.setStatus(rs.getString("status"));
84 1 1. getOrdineById : removed call to com/popx/modello/OrdineBean::setDataOrdine → KILLED
                ordine.setDataOrdine(rs.getDate("data_ordine"));
85
            }
86
87
        } catch (SQLException e) {
88 1 1. getOrdineById : removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE
            e.printStackTrace();
89
        }
90
91 1 1. getOrdineById : replaced return value with null for com/popx/persistenza/OrdineDAOImpl::getOrdineById → KILLED
        return ordine;
92
    }
93
94
    @Override
95
    /*@ public normal_behavior
96
      @   assignable \everything;
97
      @   ensures \result != null;
98
      @*/
99
    public List<OrdineBean> getAllOrdini() {
100
        String query = "SELECT * FROM Ordine";
101
        List<OrdineBean> ordini = new ArrayList<>();
102
103
        try (Connection con = ds.getConnection();
104
             PreparedStatement ps = con.prepareStatement(query);
105
             ResultSet rs = ps.executeQuery()) {
106
107 1 1. getAllOrdini : negated conditional → KILLED
            while (rs.next()) {
108
                OrdineBean ordine = new OrdineBean();
109 1 1. getAllOrdini : removed call to com/popx/modello/OrdineBean::setId → SURVIVED
                ordine.setId(rs.getInt("id"));
110 1 1. getAllOrdini : removed call to com/popx/modello/OrdineBean::setSubtotal → SURVIVED
                ordine.setSubtotal(rs.getFloat("subtotal"));
111 1 1. getAllOrdini : removed call to com/popx/modello/OrdineBean::setCustomerEmail → SURVIVED
                ordine.setCustomerEmail(rs.getString("customer_email"));
112 1 1. getAllOrdini : removed call to com/popx/modello/OrdineBean::setStatus → SURVIVED
                ordine.setStatus(rs.getString("status"));
113 1 1. getAllOrdini : removed call to com/popx/modello/OrdineBean::setDataOrdine → SURVIVED
                ordine.setDataOrdine(rs.getDate("data_ordine"));
114
                ordini.add(ordine);
115
            }
116
117
        } catch (SQLException e) {
118 1 1. getAllOrdini : removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE
            e.printStackTrace();
119
        }
120
121 1 1. getAllOrdini : replaced return value with Collections.emptyList for com/popx/persistenza/OrdineDAOImpl::getAllOrdini → KILLED
        return ordini;
122
    }
123
124
    @Override
125
    /*@ public normal_behavior
126
      @   requires clienteEmail != null && !clienteEmail.isEmpty();
127
      @   assignable \everything;
128
      @   ensures \result != null
129
      @        && (\forall int i; 0 <= i && i < \result.size();
130
      @              \result.get(i) != null
131
      @           && clienteEmail.equals(\result.get(i).getCustomerEmail()));
132
      @*/
133
    public List<OrdineBean> getOrdiniByCliente(String clienteEmail) {
134
        String query = "SELECT * FROM Ordine WHERE customer_email = ?";
135
        List<OrdineBean> ordini = new ArrayList<>();
136
137
        try (Connection con = ds.getConnection();
138
             PreparedStatement ps = con.prepareStatement(query)) {
139
140 1 1. getOrdiniByCliente : removed call to java/sql/PreparedStatement::setString → KILLED
            ps.setString(1, clienteEmail);
141
            ResultSet rs = ps.executeQuery();
142
143 1 1. getOrdiniByCliente : negated conditional → KILLED
            while (rs.next()) {
144
                OrdineBean ordine = new OrdineBean();
145 1 1. getOrdiniByCliente : removed call to com/popx/modello/OrdineBean::setId → SURVIVED
                ordine.setId(rs.getInt("id"));
146 1 1. getOrdiniByCliente : removed call to com/popx/modello/OrdineBean::setSubtotal → SURVIVED
                ordine.setSubtotal(rs.getFloat("subtotal"));
147 1 1. getOrdiniByCliente : removed call to com/popx/modello/OrdineBean::setCustomerEmail → KILLED
                ordine.setCustomerEmail(rs.getString("customer_email"));
148 1 1. getOrdiniByCliente : removed call to com/popx/modello/OrdineBean::setStatus → SURVIVED
                ordine.setStatus(rs.getString("status"));
149 1 1. getOrdiniByCliente : removed call to com/popx/modello/OrdineBean::setDataOrdine → SURVIVED
                ordine.setDataOrdine(rs.getDate("data_ordine"));
150
                ordini.add(ordine);
151
            }
152
153
        } catch (SQLException e) {
154 1 1. getOrdiniByCliente : removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE
            e.printStackTrace();
155
        }
156
157 1 1. getOrdiniByCliente : replaced return value with Collections.emptyList for com/popx/persistenza/OrdineDAOImpl::getOrdiniByCliente → KILLED
        return ordini;
158
    }
159
160
    @Override
161
    /*@ public normal_behavior
162
      @   requires email != null && !email.isEmpty();
163
      @   assignable \everything;
164
      @   ensures \result >= 0;
165
      @*/
166
    public int countOrdiniByCliente(String email) {
167
        int count = 0;
168
        try (Connection connection = ds.getConnection()) {
169
            String query = "SELECT COUNT(*) FROM Ordine WHERE customer_email = ?";
170
            try (PreparedStatement preparedStatement = connection.prepareStatement(query)) {
171 1 1. countOrdiniByCliente : removed call to java/sql/PreparedStatement::setString → NO_COVERAGE
                preparedStatement.setString(1, email);
172
                ResultSet resultSet = preparedStatement.executeQuery();
173 1 1. countOrdiniByCliente : negated conditional → NO_COVERAGE
                if (resultSet.next()) {
174
                    count = resultSet.getInt(1);
175
                }
176
            }
177
        } catch (SQLException e) {
178 1 1. countOrdiniByCliente : removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE
            e.printStackTrace();
179
        }
180 1 1. countOrdiniByCliente : replaced int return with 0 for com/popx/persistenza/OrdineDAOImpl::countOrdiniByCliente → NO_COVERAGE
        return count;
181
    }
182
183
    @Override
184
    /*@ public normal_behavior
185
      @   requires email != null && !email.isEmpty()
186
      @        && currentPage >= 1
187
      @        && itemsPerPage > 0;
188
      @   assignable \everything;
189
      @   ensures \result != null && \result.size() <= itemsPerPage;
190
      @*/
191
    public List<OrdineBean> getOrdiniByClientePaginati(String email, int currentPage, int itemsPerPage) {
192
        List<OrdineBean> ordini = new ArrayList<>();
193
        try (Connection connection = ds.getConnection()) {
194 2 1. getOrdiniByClientePaginati : Replaced integer subtraction with addition → NO_COVERAGE
2. getOrdiniByClientePaginati : Replaced integer multiplication with division → NO_COVERAGE
            int offset = (currentPage - 1) * itemsPerPage;
195
            String query = "SELECT id, subtotal, status, data_ordine FROM Ordine WHERE customer_email = ? ORDER BY data_ordine DESC LIMIT ? OFFSET ?";
196
            try (PreparedStatement preparedStatement = connection.prepareStatement(query)) {
197 1 1. getOrdiniByClientePaginati : removed call to java/sql/PreparedStatement::setString → NO_COVERAGE
                preparedStatement.setString(1, email);
198 1 1. getOrdiniByClientePaginati : removed call to java/sql/PreparedStatement::setInt → NO_COVERAGE
                preparedStatement.setInt(2, itemsPerPage);
199 1 1. getOrdiniByClientePaginati : removed call to java/sql/PreparedStatement::setInt → NO_COVERAGE
                preparedStatement.setInt(3, offset);
200
                ResultSet resultSet = preparedStatement.executeQuery();
201 1 1. getOrdiniByClientePaginati : negated conditional → NO_COVERAGE
                while (resultSet.next()) {
202
                    OrdineBean ordine = new OrdineBean();
203 1 1. getOrdiniByClientePaginati : removed call to com/popx/modello/OrdineBean::setId → NO_COVERAGE
                    ordine.setId(resultSet.getInt("id"));
204 1 1. getOrdiniByClientePaginati : removed call to com/popx/modello/OrdineBean::setSubtotal → NO_COVERAGE
                    ordine.setSubtotal(resultSet.getFloat("subtotal"));
205 1 1. getOrdiniByClientePaginati : removed call to com/popx/modello/OrdineBean::setStatus → NO_COVERAGE
                    ordine.setStatus(resultSet.getString("status"));
206 1 1. getOrdiniByClientePaginati : removed call to com/popx/modello/OrdineBean::setDataOrdine → NO_COVERAGE
                    ordine.setDataOrdine(resultSet.getDate("data_ordine"));
207
                    ordini.add(ordine);
208
                }
209
            }
210
        } catch (SQLException e) {
211 1 1. getOrdiniByClientePaginati : removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE
            e.printStackTrace();
212
        }
213 1 1. getOrdiniByClientePaginati : replaced return value with Collections.emptyList for com/popx/persistenza/OrdineDAOImpl::getOrdiniByClientePaginati → NO_COVERAGE
        return ordini;
214
    }
215
216
    @Override
217
    /*@ public normal_behavior
218
      @   requires currentPage >= 1 && recordsPerPage > 0;
219
      @   assignable \everything;
220
      @   ensures \result != null && \result.size() <= recordsPerPage;
221
      @*/
222
    public List<OrdineBean> getOrdiniPaginati(int currentPage, int recordsPerPage) {
223
        List<OrdineBean> ordini = new ArrayList<>();
224
        String query = "SELECT * FROM Ordine LIMIT ? OFFSET ?";
225
226
        try (Connection conn = ds.getConnection();
227
             PreparedStatement pstmt = conn.prepareStatement(query)) {
228
229 1 1. getOrdiniPaginati : removed call to java/sql/PreparedStatement::setInt → NO_COVERAGE
            pstmt.setInt(1, recordsPerPage);
230 3 1. getOrdiniPaginati : Replaced integer subtraction with addition → NO_COVERAGE
2. getOrdiniPaginati : removed call to java/sql/PreparedStatement::setInt → NO_COVERAGE
3. getOrdiniPaginati : Replaced integer multiplication with division → NO_COVERAGE
            pstmt.setInt(2, (currentPage - 1) * recordsPerPage);
231
232
            try (ResultSet rs = pstmt.executeQuery()) {
233 1 1. getOrdiniPaginati : negated conditional → NO_COVERAGE
                while (rs.next()) {
234
                    OrdineBean ordine = new OrdineBean();
235 1 1. getOrdiniPaginati : removed call to com/popx/modello/OrdineBean::setId → NO_COVERAGE
                    ordine.setId(rs.getInt("id"));
236 1 1. getOrdiniPaginati : removed call to com/popx/modello/OrdineBean::setSubtotal → NO_COVERAGE
                    ordine.setSubtotal(rs.getFloat("subtotal"));
237 1 1. getOrdiniPaginati : removed call to com/popx/modello/OrdineBean::setCustomerEmail → NO_COVERAGE
                    ordine.setCustomerEmail(rs.getString("customer_email"));
238 1 1. getOrdiniPaginati : removed call to com/popx/modello/OrdineBean::setStatus → NO_COVERAGE
                    ordine.setStatus(rs.getString("status"));
239 1 1. getOrdiniPaginati : removed call to com/popx/modello/OrdineBean::setDataOrdine → NO_COVERAGE
                    ordine.setDataOrdine(rs.getDate("data_ordine"));
240
                    ordini.add(ordine);
241
                }
242
            }
243
        } catch (SQLException e) {
244 1 1. getOrdiniPaginati : removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE
            e.printStackTrace();
245
        }
246
247 1 1. getOrdiniPaginati : replaced return value with Collections.emptyList for com/popx/persistenza/OrdineDAOImpl::getOrdiniPaginati → NO_COVERAGE
        return ordini;
248
    }
249
250
    @Override
251
    /*@ public normal_behavior
252
      @   assignable \everything;
253
      @   ensures \result >= 0;
254
      @*/
255
    public int countTuttiOrdini() {
256
        int count = 0;
257
        String query = "SELECT COUNT(*) FROM Ordine";
258
259
        try (Connection conn = ds.getConnection();
260
             Statement stmt = conn.createStatement();
261
             ResultSet rs = stmt.executeQuery(query)) {
262
263 1 1. countTuttiOrdini : negated conditional → NO_COVERAGE
            if (rs.next()) {
264
                count = rs.getInt(1);
265
            }
266
        } catch (SQLException e) {
267 1 1. countTuttiOrdini : removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE
            e.printStackTrace();
268
        }
269
270 1 1. countTuttiOrdini : replaced int return with 0 for com/popx/persistenza/OrdineDAOImpl::countTuttiOrdini → NO_COVERAGE
        return count;
271
    }
272
273
    @Override
274
    /*@ public normal_behavior
275
      @   requires ordineBean != null
276
      @        && ordineBean.getId() > 0
277
      @        && ordineBean.getStatus() != null && !ordineBean.getStatus().isEmpty();
278
      @   assignable \everything;
279
      @   ensures \result ==> true;
280
      @*/
281
    public boolean updateStatus(OrdineBean ordineBean) {
282
        String sql = "UPDATE Ordine SET status = ? WHERE id = ?";
283
        try (Connection conn = ds.getConnection();
284
             PreparedStatement preparedStatement = conn.prepareStatement(sql)) {
285
286
            // Impostazione dei parametri della query
287 1 1. updateStatus : removed call to java/sql/PreparedStatement::setString → KILLED
            preparedStatement.setString(1, ordineBean.getStatus());
288 1 1. updateStatus : removed call to java/sql/PreparedStatement::setInt → KILLED
            preparedStatement.setInt(2, ordineBean.getId());
289
290
            // Esecuzione dell'aggiornamento
291
            int rowsUpdated = preparedStatement.executeUpdate();
292 2 1. updateStatus : changed conditional boundary → SURVIVED
2. updateStatus : negated conditional → KILLED
            return rowsUpdated > 0; // Restituisce true se almeno una riga è stata aggiornata
293
        } catch (SQLException e) {
294 1 1. updateStatus : removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE
            e.printStackTrace();
295 1 1. updateStatus : replaced boolean return with true for com/popx/persistenza/OrdineDAOImpl::updateStatus → NO_COVERAGE
            return false; // Gestisce l'errore restituendo false
296
        }
297
    }
298
299
300
301
}

Mutations

39

1.1
Location : insertOrdine
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:insertOrdine_persistsAndGeneratesId()]
removed call to java/sql/PreparedStatement::setFloat → KILLED

40

1.1
Location : insertOrdine
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:insertOrdine_persistsAndGeneratesId()]
removed call to java/sql/PreparedStatement::setString → KILLED

41

1.1
Location : insertOrdine
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:insertOrdine_persistsAndGeneratesId()]
removed call to java/sql/PreparedStatement::setString → KILLED

42

1.1
Location : insertOrdine
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:insertOrdine_persistsAndGeneratesId()]
removed call to java/sql/PreparedStatement::setDate → KILLED

48

1.1
Location : insertOrdine
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:insertOrdine_persistsAndGeneratesId()]
negated conditional → KILLED

49

1.1
Location : insertOrdine
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:insertOrdine_persistsAndGeneratesId()]
removed call to com/popx/modello/OrdineBean::setId → KILLED

53

1.1
Location : insertOrdine
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : insertOrdine
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:insertOrdine_persistsAndGeneratesId()]
negated conditional → KILLED

56

1.1
Location : insertOrdine
Killed by : none
removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE

57

1.1
Location : insertOrdine
Killed by : none
replaced boolean return with true for com/popx/persistenza/OrdineDAOImpl::insertOrdine → NO_COVERAGE

75

1.1
Location : getOrdineById
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:getOrdineById_existingOrder_returnsOrder()]
removed call to java/sql/PreparedStatement::setInt → KILLED

78

1.1
Location : getOrdineById
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:getOrdineById_notExisting_returnsNull()]
negated conditional → KILLED

80

1.1
Location : getOrdineById
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:getOrdineById_existingOrder_returnsOrder()]
removed call to com/popx/modello/OrdineBean::setId → KILLED

81

1.1
Location : getOrdineById
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:getOrdineById_existingOrder_returnsOrder()]
removed call to com/popx/modello/OrdineBean::setSubtotal → KILLED

82

1.1
Location : getOrdineById
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:getOrdineById_existingOrder_returnsOrder()]
removed call to com/popx/modello/OrdineBean::setCustomerEmail → KILLED

83

1.1
Location : getOrdineById
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:getOrdineById_existingOrder_returnsOrder()]
removed call to com/popx/modello/OrdineBean::setStatus → KILLED

84

1.1
Location : getOrdineById
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:getOrdineById_existingOrder_returnsOrder()]
removed call to com/popx/modello/OrdineBean::setDataOrdine → KILLED

88

1.1
Location : getOrdineById
Killed by : none
removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE

91

1.1
Location : getOrdineById
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:getOrdineById_existingOrder_returnsOrder()]
replaced return value with null for com/popx/persistenza/OrdineDAOImpl::getOrdineById → KILLED

107

1.1
Location : getAllOrdini
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:getAllOrdini_returnsAllInsertedOrders()]
negated conditional → KILLED

109

1.1
Location : getAllOrdini
Killed by : none
removed call to com/popx/modello/OrdineBean::setId → SURVIVED

110

1.1
Location : getAllOrdini
Killed by : none
removed call to com/popx/modello/OrdineBean::setSubtotal → SURVIVED

111

1.1
Location : getAllOrdini
Killed by : none
removed call to com/popx/modello/OrdineBean::setCustomerEmail → SURVIVED

112

1.1
Location : getAllOrdini
Killed by : none
removed call to com/popx/modello/OrdineBean::setStatus → SURVIVED

113

1.1
Location : getAllOrdini
Killed by : none
removed call to com/popx/modello/OrdineBean::setDataOrdine → SURVIVED

118

1.1
Location : getAllOrdini
Killed by : none
removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE

121

1.1
Location : getAllOrdini
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:getAllOrdini_returnsAllInsertedOrders()]
replaced return value with Collections.emptyList for com/popx/persistenza/OrdineDAOImpl::getAllOrdini → KILLED

140

1.1
Location : getOrdiniByCliente
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:getOrdiniByCliente_returnsOnlyThatClientOrders()]
removed call to java/sql/PreparedStatement::setString → KILLED

143

1.1
Location : getOrdiniByCliente
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:getOrdiniByCliente_returnsOnlyThatClientOrders()]
negated conditional → KILLED

145

1.1
Location : getOrdiniByCliente
Killed by : none
removed call to com/popx/modello/OrdineBean::setId → SURVIVED

146

1.1
Location : getOrdiniByCliente
Killed by : none
removed call to com/popx/modello/OrdineBean::setSubtotal → SURVIVED

147

1.1
Location : getOrdiniByCliente
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:getOrdiniByCliente_returnsOnlyThatClientOrders()]
removed call to com/popx/modello/OrdineBean::setCustomerEmail → KILLED

148

1.1
Location : getOrdiniByCliente
Killed by : none
removed call to com/popx/modello/OrdineBean::setStatus → SURVIVED

149

1.1
Location : getOrdiniByCliente
Killed by : none
removed call to com/popx/modello/OrdineBean::setDataOrdine → SURVIVED

154

1.1
Location : getOrdiniByCliente
Killed by : none
removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE

157

1.1
Location : getOrdiniByCliente
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:getOrdiniByCliente_returnsOnlyThatClientOrders()]
replaced return value with Collections.emptyList for com/popx/persistenza/OrdineDAOImpl::getOrdiniByCliente → KILLED

171

1.1
Location : countOrdiniByCliente
Killed by : none
removed call to java/sql/PreparedStatement::setString → NO_COVERAGE

173

1.1
Location : countOrdiniByCliente
Killed by : none
negated conditional → NO_COVERAGE

178

1.1
Location : countOrdiniByCliente
Killed by : none
removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE

180

1.1
Location : countOrdiniByCliente
Killed by : none
replaced int return with 0 for com/popx/persistenza/OrdineDAOImpl::countOrdiniByCliente → NO_COVERAGE

194

1.1
Location : getOrdiniByClientePaginati
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : getOrdiniByClientePaginati
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

197

1.1
Location : getOrdiniByClientePaginati
Killed by : none
removed call to java/sql/PreparedStatement::setString → NO_COVERAGE

198

1.1
Location : getOrdiniByClientePaginati
Killed by : none
removed call to java/sql/PreparedStatement::setInt → NO_COVERAGE

199

1.1
Location : getOrdiniByClientePaginati
Killed by : none
removed call to java/sql/PreparedStatement::setInt → NO_COVERAGE

201

1.1
Location : getOrdiniByClientePaginati
Killed by : none
negated conditional → NO_COVERAGE

203

1.1
Location : getOrdiniByClientePaginati
Killed by : none
removed call to com/popx/modello/OrdineBean::setId → NO_COVERAGE

204

1.1
Location : getOrdiniByClientePaginati
Killed by : none
removed call to com/popx/modello/OrdineBean::setSubtotal → NO_COVERAGE

205

1.1
Location : getOrdiniByClientePaginati
Killed by : none
removed call to com/popx/modello/OrdineBean::setStatus → NO_COVERAGE

206

1.1
Location : getOrdiniByClientePaginati
Killed by : none
removed call to com/popx/modello/OrdineBean::setDataOrdine → NO_COVERAGE

211

1.1
Location : getOrdiniByClientePaginati
Killed by : none
removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE

213

1.1
Location : getOrdiniByClientePaginati
Killed by : none
replaced return value with Collections.emptyList for com/popx/persistenza/OrdineDAOImpl::getOrdiniByClientePaginati → NO_COVERAGE

229

1.1
Location : getOrdiniPaginati
Killed by : none
removed call to java/sql/PreparedStatement::setInt → NO_COVERAGE

230

1.1
Location : getOrdiniPaginati
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : getOrdiniPaginati
Killed by : none
removed call to java/sql/PreparedStatement::setInt → NO_COVERAGE

3.3
Location : getOrdiniPaginati
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

233

1.1
Location : getOrdiniPaginati
Killed by : none
negated conditional → NO_COVERAGE

235

1.1
Location : getOrdiniPaginati
Killed by : none
removed call to com/popx/modello/OrdineBean::setId → NO_COVERAGE

236

1.1
Location : getOrdiniPaginati
Killed by : none
removed call to com/popx/modello/OrdineBean::setSubtotal → NO_COVERAGE

237

1.1
Location : getOrdiniPaginati
Killed by : none
removed call to com/popx/modello/OrdineBean::setCustomerEmail → NO_COVERAGE

238

1.1
Location : getOrdiniPaginati
Killed by : none
removed call to com/popx/modello/OrdineBean::setStatus → NO_COVERAGE

239

1.1
Location : getOrdiniPaginati
Killed by : none
removed call to com/popx/modello/OrdineBean::setDataOrdine → NO_COVERAGE

244

1.1
Location : getOrdiniPaginati
Killed by : none
removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE

247

1.1
Location : getOrdiniPaginati
Killed by : none
replaced return value with Collections.emptyList for com/popx/persistenza/OrdineDAOImpl::getOrdiniPaginati → NO_COVERAGE

263

1.1
Location : countTuttiOrdini
Killed by : none
negated conditional → NO_COVERAGE

267

1.1
Location : countTuttiOrdini
Killed by : none
removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE

270

1.1
Location : countTuttiOrdini
Killed by : none
replaced int return with 0 for com/popx/persistenza/OrdineDAOImpl::countTuttiOrdini → NO_COVERAGE

287

1.1
Location : updateStatus
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:updateStatus_updatesCorrectly()]
removed call to java/sql/PreparedStatement::setString → KILLED

288

1.1
Location : updateStatus
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:updateStatus_updatesCorrectly()]
removed call to java/sql/PreparedStatement::setInt → KILLED

292

1.1
Location : updateStatus
Killed by : com.popx.integration.persistenza.OrdineDAOImplTest.[engine:junit-jupiter]/[class:com.popx.integration.persistenza.OrdineDAOImplTest]/[method:updateStatus_updatesCorrectly()]
negated conditional → KILLED

2.2
Location : updateStatus
Killed by : none
changed conditional boundary → SURVIVED

294

1.1
Location : updateStatus
Killed by : none
removed call to java/sql/SQLException::printStackTrace → NO_COVERAGE

295

1.1
Location : updateStatus
Killed by : none
replaced boolean return with true for com/popx/persistenza/OrdineDAOImpl::updateStatus → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.15.2