Package: Message

Message

nameinstructionbranchcomplexitylinemethod
Message(String, int, int, int, String)
M: 0 C: 18
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 7
100%
M: 0 C: 1
100%
equals(Object)
M: 4 C: 31
89%
M: 1 C: 9
90%
M: 1 C: 5
83%
M: 1 C: 6
86%
M: 0 C: 1
100%
getCol()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getLine()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getMessage()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getNumber()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getResource()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
setCol(int)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setLine(int)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setMessage(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setNumber(int)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setResource(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
toString()
M: 0 C: 28
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*
2: * #%~
3: * Test Framework for Overture
4: * %%
5: * Copyright (C) 2008 - 2014 Overture
6: * %%
7: * This program is free software: you can redistribute it and/or modify
8: * it under the terms of the GNU General Public License as
9: * published by the Free Software Foundation, either version 3 of the
10: * License, or (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public
18: * License along with this program. If not, see
19: * <http://www.gnu.org/licenses/gpl-3.0.html>.
20: * #~%
21: */
22: package org.overture.test.framework.results;
23:
24: public class Message implements IMessage
25: {
26:         private int number;
27:
28:         private int line;
29:
30:         private int col;
31:
32:         private String message;
33:
34:         private String resource;
35:
36:         public Message(String resource, int number, int line, int col,
37:                         String message)
38:         {
39:                 this.resource = resource;
40:                 this.number = number;
41:                 this.line = line;
42:                 this.col = col;
43:                 this.message = message;
44:         }
45:
46:         public void setNumber(int number)
47:         {
48:                 this.number = number;
49:         }
50:
51:         public int getNumber()
52:         {
53:                 return number;
54:         }
55:
56:         public void setLine(int line)
57:         {
58:                 this.line = line;
59:         }
60:
61:         public int getLine()
62:         {
63:                 return line;
64:         }
65:
66:         public void setCol(int col)
67:         {
68:                 this.col = col;
69:         }
70:
71:         public int getCol()
72:         {
73:                 return col;
74:         }
75:
76:         public void setMessage(String message)
77:         {
78:                 this.message = message;
79:         }
80:
81:         public String getMessage()
82:         {
83:                 return message;
84:         }
85:
86:         @Override
87:         public boolean equals(Object obj)
88:         {
89:•                if (obj instanceof IMessage)
90:                 {
91:                         IMessage other = (IMessage) obj;
92:                         return // this.resource.equals(other.getResource()) && //removed the resource
93:•                        this.number == other.getNumber() && this.col == other.getCol()
94:•                                        && this.line == other.getLine()
95:•                                        && this.message.equals(other.getMessage());
96:                 }
97:                 return super.equals(obj);
98:         }
99:
100:         @Override
101:         public String toString()
102:         {
103:                 return number + " " + resource + " at " + line + ":" + col + " "
104:                                 + message;
105:         }
106:
107:         public void setResource(String resource)
108:         {
109:                 this.resource = resource;
110:         }
111:
112:         public String getResource()
113:         {
114:                 return resource;
115:         }
116:
117: }