Coverage Report - br.mia.test.view.tabelas.TabelaModeloCasoUsoDetalhe
 
Classes in this File Line Coverage Branch Coverage Complexity
TabelaModeloCasoUsoDetalhe
0%
0/62
0%
0/24
0
 
 1  
 package br.mia.test.view.tabelas;
 2  
 
 3  
 import java.util.List;
 4  
 
 5  
 import javax.swing.JTable;
 6  
 import javax.swing.table.AbstractTableModel;
 7  
 
 8  
 import br.mia.test.controler.ControladorErro;
 9  
 import br.mia.test.model.CasoUso;
 10  
 import br.mia.test.model.dao.DAOTestCase;
 11  
 
 12  0
 public class TabelaModeloCasoUsoDetalhe extends AbstractTableModel {
 13  0
 
 14  
         /**
 15  
          *
 16  
          */
 17  
         private static final long serialVersionUID = 1L;
 18  
 
 19  
         private List<CasoUso> useCases;
 20  
 
 21  
         private JTable tabelaCasoUso;
 22  
 
 23  
         public JTable getTabelaCasoUso() {
 24  0
                 return tabelaCasoUso;
 25  0
         }
 26  
 
 27  
         public void setTabelaCasoUso(JTable tabelaCasoUso) {
 28  0
                 this.tabelaCasoUso = tabelaCasoUso;
 29  0
         }
 30  0
 
 31  
         public List<CasoUso> getUseCases() {
 32  0
                 return useCases;
 33  0
         }
 34  
 
 35  
         public void setUseCases(List<CasoUso> useCases2) {
 36  0
                 this.useCases = useCases2;
 37  0
         }
 38  0
 
 39  
         public int getRowCount() {
 40  
 
 41  0
                 return 5;
 42  0
         }
 43  
 
 44  
         public int getColumnCount() {
 45  0
                 return 1;
 46  0
         }
 47  
 
 48  
         public Object getValueAt(int rowIndex, int columnIndex) {
 49  
 
 50  0
                 int select = this.tabelaCasoUso.getSelectedRow();
 51  0
                 if (select >= 0) {
 52  0
                         CasoUso useCase = (CasoUso) this.useCases.get(select);
 53  0
 
 54  0
                         DAOTestCase dao = new DAOTestCase();
 55  0
                         try {
 56  0
                                 int total = dao.selectCount(useCase);
 57  0
                                 int flows = useCase.getNumeroFluxos();
 58  0
                                 int passos = useCase.getNumeroPassos();
 59  0
                                 int totalExecutados = dao.contadorExecutado(useCase);
 60  0
                                 double divisao = total / (double) flows;
 61  0
                                 if (rowIndex == 0) {
 62  0
 
 63  0
                                         return "Total de Casos de teste " + total;
 64  0
 
 65  
                                 }
 66  0
                                 if (rowIndex == 1) {
 67  0
                                         try {
 68  
 
 69  0
                                                 return "N�mero de Fluxos " + flows;
 70  0
                                         } catch (Exception e) {
 71  0
                                                 ControladorErro.trata(e, this);
 72  0
                                         }
 73  
 
 74  
                                 }
 75  0
                                 if (rowIndex == 2) {
 76  0
                                         try {
 77  
 
 78  0
                                                 return "N�mero de Casos de Teste por Fluxos " + divisao;
 79  0
                                         } catch (Exception e) {
 80  0
                                                 ControladorErro.trata(e, this);
 81  0
                                         }
 82  
 
 83  
                                 }
 84  0
                                 if (rowIndex == 3) {
 85  0
                                         try {
 86  
 
 87  0
                                                 return "N�mero de Passos " + passos;
 88  0
                                         } catch (Exception e) {
 89  0
                                                 ControladorErro.trata(e, this);
 90  0
                                         }
 91  
 
 92  
                                 }
 93  0
                                 if (rowIndex == 4) {
 94  0
                                         try {
 95  
 
 96  0
                                                 return "Casos de Testes Executados " + totalExecutados;
 97  0
                                         } catch (Exception e) {
 98  0
                                                 ControladorErro.trata(e, this);
 99  0
                                         }
 100  
 
 101  
                                 }
 102  0
                         } catch (Exception e) {
 103  0
                                 ControladorErro.trata(e, this);
 104  0
                         }
 105  
                 }
 106  0
                 return -1;
 107  0
         }
 108  
 
 109  
         @Override
 110  
         public String getColumnName(int column) {
 111  0
                 return "Indicadores";
 112  0
         }
 113  
 
 114  
 }