Commit 2814060b34eb3d7e35737ef1fa7aeb9574697527
1 parent
4daf7b46
Exists in
master
Remoção de warnings
Showing
4 changed files
with
104 additions
and
110 deletions
Show diff stats
impl/core/src/test/java/br/gov/frameworkdemoiselle/internal/configuration/SecurityConfigTest.java
@@ -9,7 +9,6 @@ import br.gov.frameworkdemoiselle.internal.implementation.DefaultAuthenticator; | @@ -9,7 +9,6 @@ import br.gov.frameworkdemoiselle.internal.implementation.DefaultAuthenticator; | ||
9 | import br.gov.frameworkdemoiselle.internal.implementation.DefaultAuthorizer; | 9 | import br.gov.frameworkdemoiselle.internal.implementation.DefaultAuthorizer; |
10 | import br.gov.frameworkdemoiselle.security.Authenticator; | 10 | import br.gov.frameworkdemoiselle.security.Authenticator; |
11 | import br.gov.frameworkdemoiselle.security.Authorizer; | 11 | import br.gov.frameworkdemoiselle.security.Authorizer; |
12 | -import br.gov.frameworkdemoiselle.security.User; | ||
13 | 12 | ||
14 | public class SecurityConfigTest { | 13 | public class SecurityConfigTest { |
15 | 14 | ||
@@ -38,7 +37,7 @@ public class SecurityConfigTest { | @@ -38,7 +37,7 @@ public class SecurityConfigTest { | ||
38 | assertEquals("br.gov.frameworkdemoiselle.internal.implementation.DefaultAuthenticator", config | 37 | assertEquals("br.gov.frameworkdemoiselle.internal.implementation.DefaultAuthenticator", config |
39 | .getAuthenticatorClass().getName()); | 38 | .getAuthenticatorClass().getName()); |
40 | } | 39 | } |
41 | - | 40 | + |
42 | @Test | 41 | @Test |
43 | public void testSetAuthorizerClass() { | 42 | public void testSetAuthorizerClass() { |
44 | Authorizer authorizer = new DefaultAuthorizer(); | 43 | Authorizer authorizer = new DefaultAuthorizer(); |
impl/core/src/test/java/br/gov/frameworkdemoiselle/internal/implementation/MessageContextImplTest.java
@@ -38,7 +38,6 @@ package br.gov.frameworkdemoiselle.internal.implementation; | @@ -38,7 +38,6 @@ package br.gov.frameworkdemoiselle.internal.implementation; | ||
38 | 38 | ||
39 | import static org.easymock.EasyMock.expect; | 39 | import static org.easymock.EasyMock.expect; |
40 | import static org.powermock.api.easymock.PowerMock.mockStatic; | 40 | import static org.powermock.api.easymock.PowerMock.mockStatic; |
41 | -import static org.powermock.api.easymock.PowerMock.replay; | ||
42 | import static org.powermock.api.easymock.PowerMock.replayAll; | 41 | import static org.powermock.api.easymock.PowerMock.replayAll; |
43 | 42 | ||
44 | import java.util.Locale; | 43 | import java.util.Locale; |
@@ -51,10 +50,8 @@ import org.junit.runner.RunWith; | @@ -51,10 +50,8 @@ import org.junit.runner.RunWith; | ||
51 | import org.powermock.api.easymock.PowerMock; | 50 | import org.powermock.api.easymock.PowerMock; |
52 | import org.powermock.core.classloader.annotations.PrepareForTest; | 51 | import org.powermock.core.classloader.annotations.PrepareForTest; |
53 | import org.powermock.modules.junit4.PowerMockRunner; | 52 | import org.powermock.modules.junit4.PowerMockRunner; |
54 | -import org.powermock.reflect.Whitebox; | ||
55 | import org.slf4j.Logger; | 53 | import org.slf4j.Logger; |
56 | 54 | ||
57 | -import br.gov.frameworkdemoiselle.internal.producer.ResourceBundleProducer; | ||
58 | import br.gov.frameworkdemoiselle.message.Message; | 55 | import br.gov.frameworkdemoiselle.message.Message; |
59 | import br.gov.frameworkdemoiselle.message.MessageContext; | 56 | import br.gov.frameworkdemoiselle.message.MessageContext; |
60 | import br.gov.frameworkdemoiselle.message.SeverityType; | 57 | import br.gov.frameworkdemoiselle.message.SeverityType; |
@@ -68,19 +65,19 @@ public class MessageContextImplTest { | @@ -68,19 +65,19 @@ public class MessageContextImplTest { | ||
68 | MessageContext messageContext; | 65 | MessageContext messageContext; |
69 | 66 | ||
70 | Message m1; | 67 | Message m1; |
71 | - | 68 | + |
72 | private ResourceBundle bundle; | 69 | private ResourceBundle bundle; |
73 | 70 | ||
74 | @SuppressWarnings("unused") | 71 | @SuppressWarnings("unused") |
75 | @Before | 72 | @Before |
76 | public void before() { | 73 | public void before() { |
77 | messageContext = new MessageContextImpl(); | 74 | messageContext = new MessageContextImpl(); |
78 | - | 75 | + |
79 | Locale locale = Locale.getDefault(); | 76 | Locale locale = Locale.getDefault(); |
80 | - | 77 | + |
81 | mockStatic(Beans.class); | 78 | mockStatic(Beans.class); |
82 | expect(Beans.getReference(Locale.class)).andReturn(locale).anyTimes(); | 79 | expect(Beans.getReference(Locale.class)).andReturn(locale).anyTimes(); |
83 | - | 80 | + |
84 | expect(Beans.getReference(ResourceBundle.class)).andReturn(bundle).anyTimes(); | 81 | expect(Beans.getReference(ResourceBundle.class)).andReturn(bundle).anyTimes(); |
85 | replayAll(Beans.class); | 82 | replayAll(Beans.class); |
86 | 83 | ||
@@ -150,20 +147,20 @@ public class MessageContextImplTest { | @@ -150,20 +147,20 @@ public class MessageContextImplTest { | ||
150 | messageContext.add(m1); | 147 | messageContext.add(m1); |
151 | Assert.assertTrue(messageContext.getMessages().size() == 1); | 148 | Assert.assertTrue(messageContext.getMessages().size() == 1); |
152 | Assert.assertTrue(messageContext.getMessages().get(0).getText().equals(m1.getText())); | 149 | Assert.assertTrue(messageContext.getMessages().get(0).getText().equals(m1.getText())); |
153 | - Assert.assertTrue(messageContext.getMessages().get(0).getSeverity().equals(m1.getSeverity())); | 150 | + Assert.assertTrue(messageContext.getMessages().get(0).getSeverity().equals(m1.getSeverity())); |
154 | } | 151 | } |
155 | - | 152 | + |
156 | @Test | 153 | @Test |
157 | public void testClearMessages() { | 154 | public void testClearMessages() { |
158 | Assert.assertTrue(messageContext.getMessages().isEmpty()); | 155 | Assert.assertTrue(messageContext.getMessages().isEmpty()); |
159 | 156 | ||
160 | messageContext.add(m1); | 157 | messageContext.add(m1); |
161 | - messageContext.add(m1, null); | ||
162 | - | 158 | + messageContext.add(m1, (Object[]) null); |
159 | + | ||
163 | Assert.assertTrue(messageContext.getMessages().size() == 2); | 160 | Assert.assertTrue(messageContext.getMessages().size() == 2); |
164 | - | 161 | + |
165 | messageContext.clear(); | 162 | messageContext.clear(); |
166 | - | 163 | + |
167 | Assert.assertTrue(messageContext.getMessages().isEmpty()); | 164 | Assert.assertTrue(messageContext.getMessages().isEmpty()); |
168 | } | 165 | } |
169 | 166 | ||
@@ -171,88 +168,87 @@ public class MessageContextImplTest { | @@ -171,88 +168,87 @@ public class MessageContextImplTest { | ||
171 | public void testGetMessages() { | 168 | public void testGetMessages() { |
172 | Assert.assertNotNull(messageContext.getMessages()); | 169 | Assert.assertNotNull(messageContext.getMessages()); |
173 | Assert.assertTrue(messageContext.getMessages().isEmpty()); | 170 | Assert.assertTrue(messageContext.getMessages().isEmpty()); |
174 | - | 171 | + |
175 | messageContext.add("key1"); | 172 | messageContext.add("key1"); |
176 | Assert.assertTrue(messageContext.getMessages().size() == 1); | 173 | Assert.assertTrue(messageContext.getMessages().size() == 1); |
177 | - | 174 | + |
178 | messageContext.add("key2"); | 175 | messageContext.add("key2"); |
179 | Assert.assertTrue(messageContext.getMessages().size() == 2); | 176 | Assert.assertTrue(messageContext.getMessages().size() == 2); |
180 | - | 177 | + |
181 | Assert.assertTrue(messageContext.getMessages().get(0).getText().equals("key1")); | 178 | Assert.assertTrue(messageContext.getMessages().get(0).getText().equals("key1")); |
182 | Assert.assertTrue(messageContext.getMessages().get(1).getText().equals("key2")); | 179 | Assert.assertTrue(messageContext.getMessages().get(1).getText().equals("key2")); |
183 | } | 180 | } |
184 | 181 | ||
185 | -// @Test | ||
186 | -// public void testAddMessageObjectArray() { | ||
187 | -// Object[] param = { "1", "2" }; | ||
188 | -// messageContext.add(m1, param); | ||
189 | - | ||
190 | -// Assert.assertTrue(messageContext.getMessages().size() == 1); | ||
191 | -// Assert.assertTrue(messageContext.getMessages().contains(m1)); | ||
192 | -// Assert.assertNotNull(messageContext.getMessages().get(0).getParameters()); | ||
193 | -// Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[0] == param[0]); | ||
194 | -// Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[1] == param[1]); | ||
195 | -// } | ||
196 | - | ||
197 | -// @Test | ||
198 | -// public void testAddStringObjectArray() { | ||
199 | -// String key = "my.key"; | ||
200 | -// Object[] param = { "1", "2" }; | ||
201 | -// messageContext.add(key, param); | ||
202 | -// | ||
203 | -// Assert.assertTrue(messageContext.getMessages().size() == 1); | ||
204 | -// Assert.assertTrue(messageContext.getMessages().get(0).getText().equals(key)); | ||
205 | -// Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[0] == param[0]); | ||
206 | -// Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[1] == param[1]); | ||
207 | -// } | ||
208 | -// | ||
209 | -// @Test | ||
210 | -// public void testAddStringLocaleObjectArray() { | ||
211 | -// String key = "my.key"; | ||
212 | -// Object[] param = { "1", "2" }; | ||
213 | -// Locale locale = Locale.CANADA_FRENCH; | ||
214 | -// messageContext.add(key, locale, param); | ||
215 | -// | ||
216 | -// Assert.assertTrue(messageContext.getMessages().size() == 1); | ||
217 | -// Assert.assertTrue(messageContext.getMessages().get(0).getText().equals(key)); | ||
218 | -// Assert.assertTrue(messageContext.getMessages().get(0).getLocale().equals(locale)); | ||
219 | -// Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[0] == param[0]); | ||
220 | -// Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[1] == param[1]); | ||
221 | -// } | ||
222 | -// | ||
223 | -// @Test | ||
224 | -// public void testAddStringLocaleSeverityTypeObjectArray() { | ||
225 | -// String key = "my.key"; | ||
226 | -// Object[] param = { "1", "2" }; | ||
227 | -// Locale locale = Locale.CANADA_FRENCH; | ||
228 | -// SeverityType severity = SeverityType.ERROR; | ||
229 | -// messageContext.add(key, locale, severity, param); | ||
230 | -// | ||
231 | -// Assert.assertTrue(messageContext.getMessages().size() == 1); | ||
232 | -// Assert.assertTrue(messageContext.getMessages().get(0).getText().equals(key)); | ||
233 | -// Assert.assertTrue(messageContext.getMessages().get(0).getLocale().equals(locale)); | ||
234 | -// Assert.assertTrue(messageContext.getMessages().get(0).getSeverity().equals(severity)); | ||
235 | -// Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[0] == param[0]); | ||
236 | -// Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[1] == param[1]); | ||
237 | -// } | ||
238 | -// | ||
239 | -// @Test | ||
240 | -// public void testAddStringLocaleSeverityTypeStringObjectArray() { | ||
241 | -// String key = "my.key"; | ||
242 | -// Object[] param = { "1", "2" }; | ||
243 | -// Locale locale = Locale.CANADA_FRENCH; | ||
244 | -// SeverityType severity = SeverityType.ERROR; | ||
245 | -// String resource = "myresourcename"; | ||
246 | -// messageContext.add(key, locale, severity, resource, param); | ||
247 | -// | ||
248 | -// Assert.assertTrue(messageContext.getMessages().size() == 1); | ||
249 | -// Assert.assertTrue(messageContext.getMessages().get(0).getText().equals(key)); | ||
250 | -// Assert.assertTrue(messageContext.getMessages().get(0).getLocale().equals(locale)); | ||
251 | -// Assert.assertTrue(messageContext.getMessages().get(0).getSeverity().equals(severity)); | ||
252 | -// Assert.assertTrue(messageContext.getMessages().get(0).getResourceName().equals(resource)); | ||
253 | -// Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[0] == param[0]); | ||
254 | -// Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[1] == param[1]); | ||
255 | -// } | ||
256 | - | ||
257 | - | ||
258 | -} | ||
259 | \ No newline at end of file | 182 | \ No newline at end of file |
183 | + // @Test | ||
184 | + // public void testAddMessageObjectArray() { | ||
185 | + // Object[] param = { "1", "2" }; | ||
186 | + // messageContext.add(m1, param); | ||
187 | + | ||
188 | + // Assert.assertTrue(messageContext.getMessages().size() == 1); | ||
189 | + // Assert.assertTrue(messageContext.getMessages().contains(m1)); | ||
190 | + // Assert.assertNotNull(messageContext.getMessages().get(0).getParameters()); | ||
191 | + // Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[0] == param[0]); | ||
192 | + // Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[1] == param[1]); | ||
193 | + // } | ||
194 | + | ||
195 | + // @Test | ||
196 | + // public void testAddStringObjectArray() { | ||
197 | + // String key = "my.key"; | ||
198 | + // Object[] param = { "1", "2" }; | ||
199 | + // messageContext.add(key, param); | ||
200 | + // | ||
201 | + // Assert.assertTrue(messageContext.getMessages().size() == 1); | ||
202 | + // Assert.assertTrue(messageContext.getMessages().get(0).getText().equals(key)); | ||
203 | + // Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[0] == param[0]); | ||
204 | + // Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[1] == param[1]); | ||
205 | + // } | ||
206 | + // | ||
207 | + // @Test | ||
208 | + // public void testAddStringLocaleObjectArray() { | ||
209 | + // String key = "my.key"; | ||
210 | + // Object[] param = { "1", "2" }; | ||
211 | + // Locale locale = Locale.CANADA_FRENCH; | ||
212 | + // messageContext.add(key, locale, param); | ||
213 | + // | ||
214 | + // Assert.assertTrue(messageContext.getMessages().size() == 1); | ||
215 | + // Assert.assertTrue(messageContext.getMessages().get(0).getText().equals(key)); | ||
216 | + // Assert.assertTrue(messageContext.getMessages().get(0).getLocale().equals(locale)); | ||
217 | + // Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[0] == param[0]); | ||
218 | + // Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[1] == param[1]); | ||
219 | + // } | ||
220 | + // | ||
221 | + // @Test | ||
222 | + // public void testAddStringLocaleSeverityTypeObjectArray() { | ||
223 | + // String key = "my.key"; | ||
224 | + // Object[] param = { "1", "2" }; | ||
225 | + // Locale locale = Locale.CANADA_FRENCH; | ||
226 | + // SeverityType severity = SeverityType.ERROR; | ||
227 | + // messageContext.add(key, locale, severity, param); | ||
228 | + // | ||
229 | + // Assert.assertTrue(messageContext.getMessages().size() == 1); | ||
230 | + // Assert.assertTrue(messageContext.getMessages().get(0).getText().equals(key)); | ||
231 | + // Assert.assertTrue(messageContext.getMessages().get(0).getLocale().equals(locale)); | ||
232 | + // Assert.assertTrue(messageContext.getMessages().get(0).getSeverity().equals(severity)); | ||
233 | + // Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[0] == param[0]); | ||
234 | + // Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[1] == param[1]); | ||
235 | + // } | ||
236 | + // | ||
237 | + // @Test | ||
238 | + // public void testAddStringLocaleSeverityTypeStringObjectArray() { | ||
239 | + // String key = "my.key"; | ||
240 | + // Object[] param = { "1", "2" }; | ||
241 | + // Locale locale = Locale.CANADA_FRENCH; | ||
242 | + // SeverityType severity = SeverityType.ERROR; | ||
243 | + // String resource = "myresourcename"; | ||
244 | + // messageContext.add(key, locale, severity, resource, param); | ||
245 | + // | ||
246 | + // Assert.assertTrue(messageContext.getMessages().size() == 1); | ||
247 | + // Assert.assertTrue(messageContext.getMessages().get(0).getText().equals(key)); | ||
248 | + // Assert.assertTrue(messageContext.getMessages().get(0).getLocale().equals(locale)); | ||
249 | + // Assert.assertTrue(messageContext.getMessages().get(0).getSeverity().equals(severity)); | ||
250 | + // Assert.assertTrue(messageContext.getMessages().get(0).getResourceName().equals(resource)); | ||
251 | + // Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[0] == param[0]); | ||
252 | + // Assert.assertTrue(messageContext.getMessages().get(0).getParameters()[1] == param[1]); | ||
253 | + // } | ||
254 | + | ||
255 | +} |
impl/extension/jsf/src/test/java/br/gov/frameworkdemoiselle/internal/implementation/AuthorizationExceptionHandlerFactoryTest.java
@@ -35,7 +35,7 @@ | @@ -35,7 +35,7 @@ | ||
35 | * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | 35 | * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. |
36 | */ | 36 | */ |
37 | package br.gov.frameworkdemoiselle.internal.implementation; | 37 | package br.gov.frameworkdemoiselle.internal.implementation; |
38 | -import org.junit.Ignore; | 38 | + |
39 | import static junit.framework.Assert.assertEquals; | 39 | import static junit.framework.Assert.assertEquals; |
40 | import static org.easymock.EasyMock.expect; | 40 | import static org.easymock.EasyMock.expect; |
41 | import static org.powermock.api.easymock.PowerMock.replayAll; | 41 | import static org.powermock.api.easymock.PowerMock.replayAll; |
@@ -54,7 +54,7 @@ public class AuthorizationExceptionHandlerFactoryTest { | @@ -54,7 +54,7 @@ public class AuthorizationExceptionHandlerFactoryTest { | ||
54 | 54 | ||
55 | @Test | 55 | @Test |
56 | public void testGetExceptionHandler() { | 56 | public void testGetExceptionHandler() { |
57 | - | 57 | + |
58 | ExceptionHandler jsfExceptionHandler = PowerMock.createMock(ExceptionHandler.class); | 58 | ExceptionHandler jsfExceptionHandler = PowerMock.createMock(ExceptionHandler.class); |
59 | 59 | ||
60 | ExceptionHandlerFactory jsfFactory = PowerMock.createMock(ExceptionHandlerFactory.class); | 60 | ExceptionHandlerFactory jsfFactory = PowerMock.createMock(ExceptionHandlerFactory.class); |
@@ -69,7 +69,7 @@ public class AuthorizationExceptionHandlerFactoryTest { | @@ -69,7 +69,7 @@ public class AuthorizationExceptionHandlerFactoryTest { | ||
69 | assertEquals(handler.getWrapped(), jsfExceptionHandler); | 69 | assertEquals(handler.getWrapped(), jsfExceptionHandler); |
70 | 70 | ||
71 | verifyAll(); | 71 | verifyAll(); |
72 | - | 72 | + |
73 | } | 73 | } |
74 | 74 | ||
75 | } | 75 | } |
impl/extension/jsf/src/test/java/br/gov/frameworkdemoiselle/internal/implementation/ParameterImplTest.java
@@ -54,7 +54,6 @@ import javax.enterprise.inject.spi.InjectionPoint; | @@ -54,7 +54,6 @@ import javax.enterprise.inject.spi.InjectionPoint; | ||
54 | import javax.faces.convert.Converter; | 54 | import javax.faces.convert.Converter; |
55 | import javax.servlet.http.HttpServletRequest; | 55 | import javax.servlet.http.HttpServletRequest; |
56 | import javax.servlet.http.HttpSession; | 56 | import javax.servlet.http.HttpSession; |
57 | -import javax.swing.text.View; | ||
58 | 57 | ||
59 | import org.easymock.EasyMock; | 58 | import org.easymock.EasyMock; |
60 | import org.junit.Before; | 59 | import org.junit.Before; |
@@ -155,7 +154,7 @@ public class ParameterImplTest { | @@ -155,7 +154,7 @@ public class ParameterImplTest { | ||
155 | public void testGetValueWhenSessionScopedAndParameterValueNotNull() { | 154 | public void testGetValueWhenSessionScopedAndParameterValueNotNull() { |
156 | this.prepareForTestWithKeyFromNameAnnotation(); | 155 | this.prepareForTestWithKeyFromNameAnnotation(); |
157 | expect(Faces.getConverter(EasyMock.anyObject(Class.class))).andReturn(converter); | 156 | expect(Faces.getConverter(EasyMock.anyObject(Class.class))).andReturn(converter); |
158 | - | 157 | + |
159 | mockStatic(Beans.class); | 158 | mockStatic(Beans.class); |
160 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); | 159 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); |
161 | 160 | ||
@@ -179,7 +178,7 @@ public class ParameterImplTest { | @@ -179,7 +178,7 @@ public class ParameterImplTest { | ||
179 | @Test | 178 | @Test |
180 | public void testGetValueWhenSessionScopedAndParameterValueNull() { | 179 | public void testGetValueWhenSessionScopedAndParameterValueNull() { |
181 | this.prepareForTestWithKeyFromNameAnnotation(); | 180 | this.prepareForTestWithKeyFromNameAnnotation(); |
182 | - | 181 | + |
183 | mockStatic(Beans.class); | 182 | mockStatic(Beans.class); |
184 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); | 183 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); |
185 | 184 | ||
@@ -200,17 +199,17 @@ public class ParameterImplTest { | @@ -200,17 +199,17 @@ public class ParameterImplTest { | ||
200 | public void testGetValueWhenRequestScoped() { | 199 | public void testGetValueWhenRequestScoped() { |
201 | this.prepareForTestWithKeyFromNameAnnotation(); | 200 | this.prepareForTestWithKeyFromNameAnnotation(); |
202 | expect(Faces.getConverter(EasyMock.anyObject(Class.class))).andReturn(converter); | 201 | expect(Faces.getConverter(EasyMock.anyObject(Class.class))).andReturn(converter); |
203 | - | 202 | + |
204 | mockStatic(Beans.class); | 203 | mockStatic(Beans.class); |
205 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); | 204 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); |
206 | - | 205 | + |
207 | expect(annotated.isAnnotationPresent(SessionScoped.class)).andReturn(false); | 206 | expect(annotated.isAnnotationPresent(SessionScoped.class)).andReturn(false); |
208 | expect(annotated.isAnnotationPresent(RequestScoped.class)).andReturn(true); | 207 | expect(annotated.isAnnotationPresent(RequestScoped.class)).andReturn(true); |
209 | expect(annotated.isAnnotationPresent(ViewScoped.class)).andReturn(false); | 208 | expect(annotated.isAnnotationPresent(ViewScoped.class)).andReturn(false); |
210 | expect(request.getParameter(EasyMock.anyObject(String.class))).andReturn("1"); | 209 | expect(request.getParameter(EasyMock.anyObject(String.class))).andReturn("1"); |
211 | expect(request.getSession()).andReturn(session).anyTimes(); | 210 | expect(request.getSession()).andReturn(session).anyTimes(); |
212 | expect(Faces.convert("1", converter)).andReturn("return"); | 211 | expect(Faces.convert("1", converter)).andReturn("return"); |
213 | - | 212 | + |
214 | replayAll(); | 213 | replayAll(); |
215 | param = new ParameterImpl<Long>(ip); | 214 | param = new ParameterImpl<Long>(ip); |
216 | assertEquals("return", param.getValue()); | 215 | assertEquals("return", param.getValue()); |
@@ -221,11 +220,11 @@ public class ParameterImplTest { | @@ -221,11 +220,11 @@ public class ParameterImplTest { | ||
221 | public void testGetValueWhenViewScopedWithParamValueNotNull() { | 220 | public void testGetValueWhenViewScopedWithParamValueNotNull() { |
222 | this.prepareForTestWithKeyFromNameAnnotation(); | 221 | this.prepareForTestWithKeyFromNameAnnotation(); |
223 | expect(Faces.getConverter(EasyMock.anyObject(Class.class))).andReturn(converter); | 222 | expect(Faces.getConverter(EasyMock.anyObject(Class.class))).andReturn(converter); |
224 | - Map<String, Object> map = new HashMap<String,Object>(); | ||
225 | - | 223 | + Map<String, Object> map = new HashMap<String, Object>(); |
224 | + | ||
226 | mockStatic(Beans.class); | 225 | mockStatic(Beans.class); |
227 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); | 226 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); |
228 | - | 227 | + |
229 | expect(annotated.isAnnotationPresent(SessionScoped.class)).andReturn(false); | 228 | expect(annotated.isAnnotationPresent(SessionScoped.class)).andReturn(false); |
230 | expect(annotated.isAnnotationPresent(RequestScoped.class)).andReturn(false); | 229 | expect(annotated.isAnnotationPresent(RequestScoped.class)).andReturn(false); |
231 | expect(annotated.isAnnotationPresent(ViewScoped.class)).andReturn(true); | 230 | expect(annotated.isAnnotationPresent(ViewScoped.class)).andReturn(true); |
@@ -243,12 +242,12 @@ public class ParameterImplTest { | @@ -243,12 +242,12 @@ public class ParameterImplTest { | ||
243 | @Test | 242 | @Test |
244 | public void testGetValueWhenViewScopedWithParamValueNull() { | 243 | public void testGetValueWhenViewScopedWithParamValueNull() { |
245 | this.prepareForTestWithKeyFromNameAnnotation(); | 244 | this.prepareForTestWithKeyFromNameAnnotation(); |
246 | - Map<String, Object> map = new HashMap<String,Object>(); | 245 | + Map<String, Object> map = new HashMap<String, Object>(); |
247 | map.put("name", "ops"); | 246 | map.put("name", "ops"); |
248 | 247 | ||
249 | mockStatic(Beans.class); | 248 | mockStatic(Beans.class); |
250 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); | 249 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); |
251 | - | 250 | + |
252 | expect(annotated.isAnnotationPresent(SessionScoped.class)).andReturn(false); | 251 | expect(annotated.isAnnotationPresent(SessionScoped.class)).andReturn(false); |
253 | expect(annotated.isAnnotationPresent(RequestScoped.class)).andReturn(false); | 252 | expect(annotated.isAnnotationPresent(RequestScoped.class)).andReturn(false); |
254 | expect(annotated.isAnnotationPresent(ViewScoped.class)).andReturn(true); | 253 | expect(annotated.isAnnotationPresent(ViewScoped.class)).andReturn(true); |
@@ -269,13 +268,13 @@ public class ParameterImplTest { | @@ -269,13 +268,13 @@ public class ParameterImplTest { | ||
269 | 268 | ||
270 | mockStatic(Beans.class); | 269 | mockStatic(Beans.class); |
271 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); | 270 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); |
272 | - | 271 | + |
273 | expect(annotated.isAnnotationPresent(SessionScoped.class)).andReturn(false); | 272 | expect(annotated.isAnnotationPresent(SessionScoped.class)).andReturn(false); |
274 | expect(annotated.isAnnotationPresent(RequestScoped.class)).andReturn(false); | 273 | expect(annotated.isAnnotationPresent(RequestScoped.class)).andReturn(false); |
275 | expect(annotated.isAnnotationPresent(ViewScoped.class)).andReturn(false); | 274 | expect(annotated.isAnnotationPresent(ViewScoped.class)).andReturn(false); |
276 | expect(request.getParameter(EasyMock.anyObject(String.class))).andReturn("1"); | 275 | expect(request.getParameter(EasyMock.anyObject(String.class))).andReturn("1"); |
277 | expect(Faces.convert("1", converter)).andReturn("return"); | 276 | expect(Faces.convert("1", converter)).andReturn("return"); |
278 | - | 277 | + |
279 | replayAll(); | 278 | replayAll(); |
280 | param = new ParameterImpl<Long>(ip); | 279 | param = new ParameterImpl<Long>(ip); |
281 | assertEquals("return", param.getValue()); | 280 | assertEquals("return", param.getValue()); |
@@ -288,7 +287,7 @@ public class ParameterImplTest { | @@ -288,7 +287,7 @@ public class ParameterImplTest { | ||
288 | 287 | ||
289 | mockStatic(Beans.class); | 288 | mockStatic(Beans.class); |
290 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); | 289 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); |
291 | - | 290 | + |
292 | expect(annotated.isAnnotationPresent(SessionScoped.class)).andReturn(false); | 291 | expect(annotated.isAnnotationPresent(SessionScoped.class)).andReturn(false); |
293 | expect(annotated.isAnnotationPresent(RequestScoped.class)).andReturn(false); | 292 | expect(annotated.isAnnotationPresent(RequestScoped.class)).andReturn(false); |
294 | expect(annotated.isAnnotationPresent(ViewScoped.class)).andReturn(false); | 293 | expect(annotated.isAnnotationPresent(ViewScoped.class)).andReturn(false); |
@@ -307,7 +306,7 @@ public class ParameterImplTest { | @@ -307,7 +306,7 @@ public class ParameterImplTest { | ||
307 | 306 | ||
308 | mockStatic(Beans.class); | 307 | mockStatic(Beans.class); |
309 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); | 308 | expect(Beans.getReference(HttpServletRequest.class)).andReturn(request).anyTimes(); |
310 | - | 309 | + |
311 | expect(annotated.isAnnotationPresent(SessionScoped.class)).andReturn(true); | 310 | expect(annotated.isAnnotationPresent(SessionScoped.class)).andReturn(true); |
312 | expect(annotated.isAnnotationPresent(RequestScoped.class)).andReturn(false); | 311 | expect(annotated.isAnnotationPresent(RequestScoped.class)).andReturn(false); |
313 | expect(annotated.isAnnotationPresent(ViewScoped.class)).andReturn(false); | 312 | expect(annotated.isAnnotationPresent(ViewScoped.class)).andReturn(false); |