Coverage Report - br.mia.test.model.CasoUso
 
Classes in this File Line Coverage Branch Coverage Complexity
CasoUso
17%
43/255
0%
0/38
0
 
 1  
 package br.mia.test.model;
 2  
 
 3  
 import java.io.Serializable;
 4  
 import java.util.ArrayList;
 5  
 import java.util.Collection;
 6  
 import java.util.HashMap;
 7  
 import java.util.Iterator;
 8  
 import java.util.LinkedHashMap;
 9  
 import java.util.List;
 10  
 
 11  
 import javax.jmi.reflect.RefClass;
 12  
 import javax.jmi.reflect.RefException;
 13  
 import javax.jmi.reflect.RefFeatured;
 14  
 import javax.jmi.reflect.RefObject;
 15  0
 import javax.jmi.reflect.RefPackage;
 16  
 import javax.persistence.Entity;
 17  
 import javax.persistence.GeneratedValue;
 18  
 import javax.persistence.GenerationType;
 19  0
 import javax.persistence.Id;
 20  0
 import javax.persistence.JoinColumn;
 21  
 import javax.persistence.ManyToOne;
 22  
 import javax.persistence.OneToMany;
 23  0
 import javax.persistence.Table;
 24  
 import javax.persistence.Transient;
 25  
 
 26  
 import org.hibernate.annotations.NotFound;
 27  0
 import org.hibernate.annotations.NotFoundAction;
 28  0
 
 29  
 import br.mia.test.model.jmi.Flow;
 30  
 import br.mia.test.model.jmi.NormalFlow;
 31  
 import br.mia.test.testcase.CasosTeste;
 32  
 import br.mia.test.testcase.DadosTeste;
 33  
 
 34  
 @Entity
 35  
 @Table(name = "useCase")
 36  4
 public class CasoUso implements br.mia.test.model.jmi.UseCase, Serializable
 37  
 {
 38  
 
 39  
     private int numeroPassos;
 40  
 
 41  0
     private List<CasosTeste> casosTeste;
 42  
 
 43  
     @OneToMany(targetEntity = CasosTeste.class)
 44  
     @JoinColumn(name = "iduseCase")
 45  0
     public List<CasosTeste> getCasosTeste() {
 46  0
         return casosTeste;
 47  
     }
 48  
 
 49  0
     public void setCasosTeste(List<CasosTeste> casosTeste) {
 50  0
         this.casosTeste = casosTeste;
 51  0
     }
 52  
 
 53  0
     private List<DadosTeste> dados;
 54  0
 
 55  0
     @OneToMany
 56  
     @JoinColumn(name = "idUseCase")
 57  
     @NotFound(action=NotFoundAction.IGNORE)
 58  0
     public List<DadosTeste> getDados() {
 59  0
         return dados;
 60  0
     }
 61  
 
 62  0
     public void setDados(List<DadosTeste> dados) {
 63  0
         this.dados = dados;
 64  0
     }
 65  
 
 66  0
     @ManyToOne
 67  
     @NotFound(action=NotFoundAction.IGNORE)
 68  4
     @JoinColumn(name = "idProjeto")
 69  0
     public Projeto getProjeto() {
 70  4
         return projeto;
 71  0
     }
 72  
 
 73  0
     public void setProjeto(Projeto projeto) {
 74  0
         this.projeto = projeto;
 75  0
     }
 76  
 
 77  
     private Projeto projeto;
 78  0
 
 79  0
     public int getNumeroPassos() {
 80  0
         return numeroPassos;
 81  0
     }
 82  
 
 83  0
     public void setNumeroPassos(int numeroPassos) {
 84  0
         this.numeroPassos = numeroPassos;
 85  0
     }
 86  0
 
 87  2
     public int getNumeroFluxos() {
 88  0
         return numeroFluxos;
 89  
     }
 90  0
 
 91  0
     public void setNumeroFluxos(int numeroFluxos) {
 92  0
         this.numeroFluxos = numeroFluxos;
 93  0
     }
 94  0
 
 95  0
     private int numeroFluxos;
 96  0
 
 97  0
     private static HashMap<Object, Object> resultadosValidos;
 98  
 
 99  
     private List<RegraNegocio> regras;
 100  2
 
 101  2
     private String complexidade = "Simples";
 102  
 
 103  0
     private int numeroCasosTeste;
 104  
 
 105  0
     public int getNumeroCasosTeste() {
 106  0
         return numeroCasosTeste;
 107  0
     }
 108  
 
 109  0
     public void setNumeroCasosTeste(int numeroCasosTeste) {
 110  0
         this.numeroCasosTeste = numeroCasosTeste;
 111  0
     }
 112  0
 
 113  
     @Transient
 114  0
     public int getNumeroCasosTestesExecutados() {
 115  2
         return numeroCasosTestesExecutados;
 116  
     }
 117  
 
 118  0
     public void setNumeroCasosTestesExecutados(int numeroCasosTestesExecutados) {
 119  0
         this.numeroCasosTestesExecutados = numeroCasosTestesExecutados;
 120  2
     }
 121  
 
 122  2
     private int numeroCasosTestesExecutados;
 123  0
 
 124  
     private int id;
 125  
 
 126  
     private String setUp;
 127  0
 
 128  0
     private String tearDown;
 129  
 
 130  
     private String name;
 131  0
 
 132  
     public NormalFlow normalFlow;
 133  2
 
 134  2
     public LinkedHashMap<String, RegraNegocio> ruleMapaGlobal = new LinkedHashMap<String, RegraNegocio>();
 135  2
 
 136  2
     public LinkedHashMap<String, DadosTeste> dataMapaGlobal = new LinkedHashMap<String, DadosTeste>();
 137  0
 
 138  0
     public ArrayList<Flow> alternativeFlow;
 139  0
 
 140  
     public ArrayList<Flow> exceptioFlow;
 141  
 
 142  0
     public List<Fluxo> flows;
 143  0
 
 144  0
     @Transient
 145  
     public int getStepNumber() {
 146  4
 
 147  4
         ArrayList<Flow> flows = new ArrayList<Flow>();
 148  4
         flows.addAll(this.getFlows());
 149  4
 
 150  4
         int stepNumber = 0;
 151  4
         for (int i = 0; i < this.getFlows().size() - 1; i++) {
 152  0
             Fluxo flow = (Fluxo) flows.get(i);
 153  0
             stepNumber = stepNumber + flow.getSteps().size();
 154  0
 
 155  0
         }
 156  0
         return stepNumber;
 157  
     }
 158  
 
 159  
     @Transient
 160  6
     public int getStepNumberCover() {
 161  0
         int stepNumber = 0;
 162  0
         ArrayList<Flow> flows = new ArrayList<Flow>();
 163  0
         flows.addAll(this.getFlows());
 164  0
         for (int i = 0; i < this.getFlows().size() - 1; i++) {
 165  0
             Fluxo flow = (Fluxo) flows.get(i);
 166  0
             for (Iterator<Step> iterator = flow.getSteps().iterator(); iterator
 167  0
                     .hasNext();) {
 168  0
                 Step step = (Step) iterator.next();
 169  0
                 if (step.isCoberto()) {
 170  0
                     stepNumber++;
 171  
                 }
 172  0
 
 173  0
             }
 174  
 
 175  0
         }
 176  1
         return stepNumber;
 177  
     }
 178  
 
 179  
     @OneToMany(targetEntity = Fluxo.class)
 180  0
     @JoinColumn(name = "idUseCase")
 181  0
     public List<Fluxo> getFlows() {
 182  0
         return flows;
 183  
     }
 184  0
 
 185  0
     public void setFlows(List<Fluxo> flows) {
 186  0
         this.flows = flows;
 187  0
     }
 188  0
 
 189  1
     public String getName() {
 190  1
         return name;
 191  
     }
 192  0
 
 193  0
     public void setName(String name) {
 194  0
         this.name = name;
 195  0
     }
 196  
 
 197  0
     @Transient
 198  0
     public br.mia.test.model.jmi.NormalFlow getNormalFlow() {
 199  0
         return normalFlow;
 200  
     }
 201  0
 
 202  0
     public void setNormalFlow(br.mia.test.model.jmi.NormalFlow normalFlow) {
 203  0
         this.normalFlow = normalFlow;
 204  0
     }
 205  
 
 206  0
     @Transient
 207  0
     public ArrayList<Flow> getAlternativeFlow() {
 208  0
         return alternativeFlow;
 209  
     }
 210  2
 
 211  2
     public void setAlternativeFlow(ArrayList<Flow> alternativeFlow) {
 212  2
         this.alternativeFlow = alternativeFlow;
 213  2
     }
 214  2
 
 215  2
     @Transient
 216  2
     public ArrayList<Flow> getExceptioFlow() {
 217  0
         return exceptioFlow;
 218  0
     }
 219  0
 
 220  0
     public void setExceptioFlow(ArrayList<Flow> exceptioFlow) {
 221  0
         this.exceptioFlow = exceptioFlow;
 222  0
     }
 223  2
 
 224  4
     public CasoUso() {
 225  4
         this.casosTeste=new ArrayList<CasosTeste>();
 226  4
         this.flows = new ArrayList<Fluxo>();
 227  7
         this.dados = new ArrayList<DadosTeste>();
 228  4
         this.regras = new ArrayList<RegraNegocio>();
 229  4
         this.dataMapaGlobal = new LinkedHashMap<String, DadosTeste>();
 230  4
         this.ruleMapaGlobal = new LinkedHashMap<String, RegraNegocio>();
 231  4
         this.regras = new ArrayList<RegraNegocio>();
 232  4
         CasoUso.resultadosValidos = new HashMap<Object, Object>();
 233  2
     }
 234  
 
 235  0
     @Override
 236  
     public String toString() {
 237  0
 
 238  0
         return this.getName();
 239  0
     }
 240  0
 
 241  
     @Id
 242  
     @GeneratedValue(strategy = GenerationType.AUTO)    
 243  3
     public int getId() {
 244  3
         return id;
 245  
     }
 246  
 
 247  0
     public void setId(int id) {
 248  0
         this.id = id;
 249  0
     }
 250  
 
 251  0
     public String getSetUp() {
 252  0
         return setUp;
 253  
     }
 254  
 
 255  0
     public void setSetUp(String setUp) {
 256  0
         this.setUp = setUp;
 257  0
     }
 258  
 
 259  0
     public String getTearDown() {
 260  0
         return tearDown;
 261  
     }
 262  
 
 263  0
     public void setTearDown(String tearDown) {
 264  0
         this.tearDown = tearDown;
 265  0
     }
 266  0
 
 267  0
     public String getComplexidade() {
 268  0
         return complexidade;
 269  
     }
 270  0
 
 271  0
     public void setComplexidade(String complexidade) {
 272  0
         this.complexidade = complexidade;
 273  0
     }
 274  
 
 275  0
     @Transient
 276  0
     public LinkedHashMap<String, DadosTeste> getDataMapaGlobal() {
 277  0
         return dataMapaGlobal;
 278  
     }
 279  
 
 280  
     public void setDataMapaGlobal(
 281  0
             LinkedHashMap<String, DadosTeste> dataMapaGlobal) {
 282  0
         this.dataMapaGlobal = dataMapaGlobal;
 283  0
     }
 284  
 
 285  0
     @Transient
 286  0
     public LinkedHashMap<String, RegraNegocio> getRuleMapaGlobal() {
 287  0
         return ruleMapaGlobal;
 288  
     }
 289  0
 
 290  0
     public void setRuleMapaGlobal(
 291  0
             LinkedHashMap<String, RegraNegocio> ruleMapaGlobal) {
 292  0
         this.ruleMapaGlobal = ruleMapaGlobal;
 293  0
     }
 294  
 
 295  
     @OneToMany
 296  
     @JoinColumn(name = "idUseCase")
 297  0
     public List<RegraNegocio> getRegras() {
 298  0
         return regras;
 299  0
     }
 300  
 
 301  0
     public void setRegras(List<RegraNegocio> rules) {
 302  0
         this.regras = rules;
 303  0
     }
 304  
 
 305  0
     public static HashMap<Object, Object> getResultadosValidos() {
 306  0
         if (resultadosValidos == null) {
 307  0
             resultadosValidos = new HashMap<Object, Object>();
 308  0
         }
 309  0
 
 310  0
         return resultadosValidos;
 311  
     }
 312  0
 
 313  
     public static void setResultadosValidos(
 314  0
             HashMap<Object, Object> resultadosValidos) {
 315  0
         CasoUso.resultadosValidos = resultadosValidos;
 316  0
     }
 317  0
 
 318  0
     public RefClass refClass() {
 319  0
         return null;
 320  
     }
 321  
 
 322  0
     public void refDelete() {
 323  
         // TODO Auto-generated method stub
 324  0
 
 325  0
     }
 326  
 
 327  0
     public RefFeatured refImmediateComposite() {
 328  0
         // TODO Auto-generated method stub
 329  0
         return null;
 330  
     }
 331  
 
 332  0
     public boolean refIsInstanceOf(RefObject arg0, boolean arg1) {
 333  0
         // TODO Auto-generated method stub
 334  0
         return false;
 335  
     }
 336  
 
 337  
     public RefFeatured refOutermostComposite() {
 338  0
         // TODO Auto-generated method stub
 339  0
         return null;
 340  
     }
 341  
 
 342  
     public Object refGetValue(RefObject arg0) {
 343  0
         // TODO Auto-generated method stub
 344  0
         return null;
 345  
     }
 346  
 
 347  
     public Object refGetValue(String arg0) {
 348  0
         // TODO Auto-generated method stub
 349  0
         return null;
 350  0
     }
 351  
 
 352  
     public Object refInvokeOperation(RefObject arg0, List arg1)
 353  
             throws RefException {
 354  0
         // TODO Auto-generated method stub
 355  0
         return null;
 356  
     }
 357  
 
 358  
     public Object refInvokeOperation(String arg0, List arg1)
 359  0
             throws RefException {
 360  0
         // TODO Auto-generated method stub
 361  0
         return null;
 362  
     }
 363  
 
 364  0
     public void refSetValue(RefObject arg0, Object arg1) {
 365  
         // TODO Auto-generated method stub
 366  0
 
 367  0
     }
 368  
 
 369  0
     public void refSetValue(String arg0, Object arg1) {
 370  
         // TODO Auto-generated method stub
 371  0
 
 372  0
     }
 373  
 
 374  0
     public RefPackage refImmediatePackage() {
 375  0
         // TODO Auto-generated method stub
 376  0
         return null;
 377  
     }
 378  
 
 379  0
     public RefObject refMetaObject() {
 380  0
         // TODO Auto-generated method stub
 381  0
         return null;
 382  
     }
 383  
 
 384  
     public String refMofId() {
 385  0
         // TODO Auto-generated method stub
 386  0
         return null;
 387  
     }
 388  
 
 389  
     public RefPackage refOutermostPackage() {
 390  0
         // TODO Auto-generated method stub
 391  0
         return null;
 392  
     }
 393  
 
 394  
     public Collection refVerifyConstraints(boolean arg0) {
 395  0
         // TODO Auto-generated method stub
 396  0
         return null;
 397  
     }
 398  
 
 399  
     @Transient
 400  
     public ArrayList<Flow> getExceptionFlow() {
 401  0
         // TODO Auto-generated method stub
 402  0
         return null;
 403  
     }
 404  
 
 405  
     @Transient
 406  
     public int getNumeroCasosTesteExecutados() {
 407  0
         // TODO Auto-generated method stub
 408  0
         return 0;
 409  
     }
 410  
 
 411  
 }