1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
package issrg.test.ds; |
55 |
|
|
56 |
|
import issrg.pba.rbac.Clock; |
57 |
|
import issrg.pba.rbac.Time; |
58 |
|
import java.io.FileOutputStream; |
59 |
|
import java.io.PrintStream; |
60 |
|
import java.util.Calendar; |
61 |
|
import java.util.Date; |
62 |
|
import java.util.GregorianCalendar; |
63 |
|
import org.apache.log4j.Logger; |
64 |
|
import org.apache.log4j.BasicConfigurator; |
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
@author |
70 |
|
|
|
|
| 92.3% |
Uncovered Elements: 3 (39) |
Complexity: 4 |
Complexity Density: 0.35 |
|
71 |
|
public class PermisRBACDISTest extends Clock { |
72 |
|
static Logger root = Logger.getRootLogger(); |
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
78 |
1
|
public PermisRBACDISTest() {... |
79 |
|
} |
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
@param |
84 |
|
|
|
|
| 87.5% |
Uncovered Elements: 2 (16) |
Complexity: 3 |
Complexity Density: 0.19 |
|
85 |
1
|
public static void main(String[] args) { ... |
86 |
|
|
87 |
1
|
System.setProperty("line.separator", "\r\n"); |
88 |
|
|
89 |
1
|
try { |
90 |
1
|
System.setOut(new PrintStream(new FileOutputStream(args[1]))); |
91 |
0
|
} catch (Exception e) { e.printStackTrace();} |
92 |
1
|
System.setErr(System.out); |
93 |
|
|
94 |
1
|
root.setLevel(org.apache.log4j.Level.OFF); |
95 |
1
|
root.removeAllAppenders(); |
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
|
100 |
1
|
java.util.TimeZone tz = java.util.TimeZone.getDefault(); |
101 |
1
|
tz.setRawOffset(0); |
102 |
1
|
java.util.TimeZone.setDefault(tz); |
103 |
1
|
try{ |
104 |
1
|
try{ |
105 |
|
|
106 |
1
|
doIssuing(args[2]); |
107 |
|
|
108 |
1
|
testPDP(args); |
109 |
|
}finally{ |
110 |
|
|
111 |
1
|
System.out.close(); |
112 |
|
|
113 |
|
} |
114 |
|
}catch (NullPointerException e){ |
115 |
0
|
System.out.println("NullPointerException at line 112, PermisRBACDISTest.java"); |
116 |
|
} |
117 |
|
|
118 |
|
} |
119 |
|
|
120 |
|
protected static TestDS test; |
121 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
122 |
1
|
public static void doIssuing(String path) {... |
123 |
1
|
try { |
124 |
|
|
125 |
1
|
test = new TestDS(path); |
126 |
|
|
127 |
1
|
test.testIssuing(); |
128 |
|
} catch (Exception e) { |
129 |
0
|
e.printStackTrace(System.out); |
130 |
|
} |
131 |
|
|
132 |
|
} |
133 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
134 |
1
|
public static void testPDP(String [] args){... |
135 |
1
|
test.testPDP(args); |
136 |
|
} |
137 |
|
|
138 |
|
static final Date STARTUP=new GregorianCalendar().getTime(); |
139 |
|
Date time=STARTUP; |
140 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
141 |
248
|
public Date latch(){... |
142 |
248
|
return getTime(); |
143 |
|
} |
144 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
145 |
1182
|
public Date getTime(){... |
146 |
1182
|
return time; |
147 |
|
} |
148 |
|
|
149 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
|
150 |
124
|
public static Date toTime(String timeString) throws IllegalArgumentException{... |
151 |
124
|
int [] t = new Time(timeString).getEvaluationTime(); |
152 |
124
|
Calendar c = new GregorianCalendar(); |
153 |
124
|
c.set(Calendar.DST_OFFSET, 0); |
154 |
124
|
c.set(Calendar.ZONE_OFFSET, 0); |
155 |
|
|
156 |
124
|
c.set(t[0], t[1]-1, t[2], t[3], t[4], t[5]); |
157 |
124
|
c.set(Calendar.MILLISECOND, 0); |
158 |
|
|
159 |
124
|
return c.getTime(); |
160 |
|
} |
161 |
|
|
162 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
163 |
124
|
public void setTime(Date time){... |
164 |
124
|
this.time=time; |
165 |
|
} |
166 |
|
} |