@@ -18,7 +18,6 @@ package com.ckkloverdos.resource
18
18
19
19
import org .junit .Assert
20
20
import org .junit .Test
21
- import com .ckkloverdos .runmode .{StageMode , RunMode , TestMode , StandardRunModeContext }
22
21
import com .ckkloverdos .props .Props
23
22
import com .ckkloverdos .maybe .Just
24
23
import com .ckkloverdos .convert .Converters
@@ -47,8 +46,6 @@ class ResourceTest {
47
46
val rcKeyListComma = " listComma"
48
47
val rcKeyListColon = " listColon"
49
48
50
- val rmc = new StandardRunModeContext (DefaultResourceContext )
51
-
52
49
implicit val converters = Converters .DefaultConverters
53
50
54
51
private [this ] def _exists (context : StreamResourceContext , rc_path : String , rc_name : String ) {
@@ -77,125 +74,51 @@ class ResourceTest {
77
74
_exists(DefaultResourceContext , rcA_path, rcA_name)
78
75
}
79
76
80
- @ Test
81
- def testExistsA_rmp {
82
- _exists(rmc.resourceContext, rcA_path, rcA_name)
83
- }
84
-
85
77
@ Test
86
78
def testExistsA2 {
87
79
_exists(DefaultResourceContext / " " , rcA_path, rcA_name)
88
80
}
89
81
90
- @ Test
91
- def testExistsA2_rmp {
92
- _exists(rmc.resourceContext / " " , rcA_path, rcA_name)
93
- }
94
-
95
82
@ Test
96
83
def testExistsB {
97
84
_exists(DefaultResourceContext , rcB_path, rcB_name)
98
85
}
99
86
100
- @ Test
101
- def testExistsB_rmp {
102
- _exists(rmc.resourceContext, rcB_path, rcB_name)
103
- }
104
-
105
87
@ Test
106
88
def testExistsB2 {
107
89
_exists(DefaultResourceContext / " b" , rcB_pathSeenFromB, rcB_name)
108
90
}
109
91
110
- @ Test
111
- def testExistsB2_rmp {
112
- _exists(rmc.resourceContext / " b" , rcB_pathSeenFromB, rcB_name)
113
- }
114
-
115
92
@ Test
116
93
def testExistsC {
117
94
_exists(DefaultResourceContext , rcC_path, rcC_name)
118
95
}
119
96
120
- @ Test
121
- def testExistsC_rmp {
122
- _exists(rmc.resourceContext, rcC_path, rcC_name)
123
- }
124
-
125
97
@ Test
126
98
def testExistsC2 {
127
99
_exists(DefaultResourceContext / " b" , rcC_pathSeenFromB, rcC_name)
128
100
}
129
101
130
- @ Test
131
- def testExistsC2_rmp {
132
- _exists(rmc.resourceContext / " b" , rcC_pathSeenFromB, rcC_name)
133
- }
134
-
135
102
@ Test
136
103
def testExistsC3 {
137
104
_exists(DefaultResourceContext / " b" / " c" , rcC_pathSeenFromC, rcC_name)
138
105
}
139
106
140
- @ Test
141
- def testExistsC3_rmp {
142
- _exists(rmc.resourceContext / " b" / " c" , rcC_pathSeenFromC, rcC_name)
143
- }
144
-
145
107
@ Test
146
108
def testContentOfA {
147
109
_content(DefaultResourceContext , rcA_path, rcA_content)
148
110
}
149
111
150
- @ Test
151
- def testContentOfA_rmp {
152
- _content(rmc.resourceContext, rcA_path, rcA_content)
153
- }
154
-
155
112
@ Test
156
113
def testContentOfB {
157
114
_content(DefaultResourceContext , rcB_path, rcB_content)
158
115
}
159
116
160
- @ Test
161
- def testContentOfB_rmp {
162
- _content(rmc.resourceContext, rcB_path, rcB_content)
163
- }
164
-
165
117
@ Test
166
118
def testContentOfC {
167
119
_content(DefaultResourceContext , rcC_path, rcC_content)
168
120
}
169
121
170
- @ Test
171
- def testContentOfC_rmp {
172
- _content(rmc.resourceContext, rcC_path, rcC_content)
173
- }
174
-
175
- @ Test
176
- def testActualRunMode {
177
- val runMode = rmc.runMode
178
- Assert .assertEquals(TestMode , runMode)
179
- }
180
-
181
- @ Test
182
- def testFakeRunMode {
183
- val saveValue = RunMode .RunModeSysProp .rawValue
184
-
185
- try {
186
- // set new run.mode
187
- RunMode .RunModeSysProp .update(StageMode .name)
188
- // get a context that will pick up the new run.mode
189
- val rmc = new StandardRunModeContext (DefaultResourceContext )
190
- val runMode = rmc.runMode
191
- // And although we are in *test*, we infer *stage* because it was explicitly set as such!
192
- Assert .assertEquals(StageMode , runMode)
193
- } finally {
194
- // clean up the mess and let the other tests proceed accordingly
195
- RunMode .RunModeSysProp .update(saveValue)
196
- }
197
- }
198
-
199
122
@ Test
200
123
def testPropsGetList {
201
124
val maybeProps = Props (rcConfProps)
0 commit comments