You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2018/02/23 00:52:13 UTC
[isis] branch master updated (4b94310 -> ce0c4c5)
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git.
from 4b94310 ISIS-1870: fixes wrapper factory tests
new 55f7f7c ISIS-1870: fixes shiro unit tests
new 1d6ee9e ISIS-1870: fixes RO fencoding unit test for float (treat decimal as float)
new ce0c4c5 1870: fixes RO server tests
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../authorization/IsisPermissionResolver.java | 3 +
...ticatorOrAuthorizorTest_isVisibleInAnyRole.java | 3 -
core/security-shiro/src/test/resources/shiro.ini | 7 +-
.../restfulobjects/applib/JsonRepresentation.java | 2 +-
.../JsonValueEncoderTest_appendValueAndFormat.java | 76 +++++++++++-----------
...ceContextTest_ensureCompatibleAcceptHeader.java | 69 ++++++++++++++++----
.../server/ResourceContextTest_getArg.java | 73 ++++++++++++++++++---
7 files changed, 165 insertions(+), 68 deletions(-)
--
To stop receiving notification emails like this one, please contact
danhaywood@apache.org.
[isis] 03/03: 1870: fixes RO server tests
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit ce0c4c56e013ad0f893a51dceedb79ca2c68acaa
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Feb 23 00:47:37 2018 +0000
1870: fixes RO server tests
---
...ceContextTest_ensureCompatibleAcceptHeader.java | 69 ++++++++++++++++----
.../server/ResourceContextTest_getArg.java | 73 +++++++++++++++++++---
2 files changed, 120 insertions(+), 22 deletions(-)
diff --git a/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_ensureCompatibleAcceptHeader.java b/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_ensureCompatibleAcceptHeader.java
index 6157373..b65bc91 100644
--- a/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_ensureCompatibleAcceptHeader.java
+++ b/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_ensureCompatibleAcceptHeader.java
@@ -21,15 +21,29 @@ package org.apache.isis.viewer.restfulobjects.server;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
+
+import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
+
import com.google.common.collect.Maps;
+
import org.jmock.Expectations;
-import org.jmock.Mockery;
-import org.jmock.integration.junit4.JUnit4Mockery;
+import org.jmock.auto.Mock;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
+
+import org.apache.isis.core.commons.authentication.AuthenticationSession;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
+import org.apache.isis.core.metamodel.services.ServicesInjector;
+import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
+import org.apache.isis.core.runtime.system.session.IsisSession;
+import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
import org.apache.isis.viewer.restfulobjects.applib.RepresentationType;
import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
import org.apache.isis.viewer.restfulobjects.rendering.RestfulObjectsApplicationException;
@@ -39,19 +53,47 @@ import static org.junit.Assert.assertThat;
public class ResourceContextTest_ensureCompatibleAcceptHeader {
- private HttpHeaders httpHeaders;
- private HttpServletRequest httpServletRequest;
-
- private final Mockery context = new JUnit4Mockery();
-
+ @Rule
+ public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(JUnitRuleMockery2.Mode.INTERFACES_AND_CLASSES);
+
+ @Mock HttpHeaders mockHttpHeaders;
+ @Mock HttpServletRequest mockHttpServletRequest;
+ @Mock ServletContext mockServletContext;
+ @Mock IsisSessionFactory mockIsisSessionFactory;
+ @Mock ServicesInjector mockServicesInjector;
+ @Mock IsisConfiguration mockConfiguration;
+ @Mock IsisSession mockIsisSession;
+ @Mock AuthenticationSession mockAuthenticationSession;
+ @Mock PersistenceSession mockPersistenceSession;
+ @Mock SpecificationLoader mockSpecificationLoader;
+
+ DeploymentCategory deploymentCategory;
@Before
public void setUp() throws Exception {
- httpHeaders = context.mock(HttpHeaders.class);
- httpServletRequest = context.mock(HttpServletRequest.class);
+ deploymentCategory = DeploymentCategory.PRODUCTION;
+
context.checking(new Expectations() {
{
- allowing(httpServletRequest).getQueryString();
+ allowing(mockHttpServletRequest).getQueryString();
will(returnValue(""));
+ allowing(mockHttpServletRequest).getServletContext();
+ will(returnValue(mockServletContext));
+ allowing(mockServletContext).getAttribute("org.apache.isis.core.webapp.isisSessionFactory");
+ will(returnValue(mockIsisSessionFactory));
+ allowing(mockIsisSessionFactory).getServicesInjector();
+ will(returnValue(mockServicesInjector));
+ allowing(mockIsisSessionFactory).getConfiguration();
+ will(returnValue(mockConfiguration));
+ allowing(mockIsisSessionFactory).getCurrentSession();
+ will(returnValue(mockIsisSession));
+ allowing(mockIsisSession).getAuthenticationSession();
+ will(returnValue(mockAuthenticationSession));
+ allowing(mockIsisSessionFactory).getSpecificationLoader();
+ will(returnValue(mockSpecificationLoader));
+ allowing(mockIsisSessionFactory).getDeploymentCategory();
+ will(returnValue(deploymentCategory));
+ allowing(mockIsisSession).getPersistenceSession();
+ will(returnValue(mockPersistenceSession));
}
});
}
@@ -143,7 +185,7 @@ public class ResourceContextTest_ensureCompatibleAcceptHeader {
private void givenHttpHeadersGetAcceptableMediaTypesReturns(final List<MediaType> mediaTypes) {
context.checking(new Expectations() {
{
- oneOf(httpHeaders).getAcceptableMediaTypes();
+ allowing(mockHttpHeaders).getAcceptableMediaTypes();
will(returnValue(mediaTypes));
}
});
@@ -153,7 +195,7 @@ public class ResourceContextTest_ensureCompatibleAcceptHeader {
final HashMap<Object, Object> parameterMap = Maps.newHashMap();
context.checking(new Expectations() {
{
- oneOf(httpServletRequest).getParameterMap();
+ oneOf(mockHttpServletRequest).getParameterMap();
will(returnValue(parameterMap));
}
});
@@ -161,7 +203,8 @@ public class ResourceContextTest_ensureCompatibleAcceptHeader {
private ResourceContext instantiateResourceContext(
final RepresentationType representationType) {
- return new ResourceContext(representationType, httpHeaders, null, null, null, null, null, null, httpServletRequest, null, null,
+ return new ResourceContext(representationType, mockHttpHeaders, null, null, null, null, null, null,
+ mockHttpServletRequest, null, null,
null);
}
diff --git a/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_getArg.java b/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_getArg.java
index 8e20191..6cb4384 100644
--- a/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_getArg.java
+++ b/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_getArg.java
@@ -20,15 +20,27 @@ package org.apache.isis.viewer.restfulobjects.server;
import java.util.HashMap;
+import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.HttpHeaders;
import com.google.common.collect.Maps;
import org.jmock.Expectations;
import org.jmock.auto.Mock;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
+import org.apache.isis.core.commons.authentication.AuthenticationSession;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.url.UrlDecoderUtil;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
+import org.apache.isis.core.metamodel.services.ServicesInjector;
+import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
+import org.apache.isis.core.runtime.system.session.IsisSession;
+import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
@@ -44,19 +56,60 @@ public class ResourceContextTest_getArg {
@Rule
public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
- @Mock
- private HttpServletRequest httpServletRequest;
- @Mock
+ @Mock HttpHeaders mockHttpHeaders;
+ @Mock HttpServletRequest mockHttpServletRequest;
+ @Mock ServletContext mockServletContext;
+ @Mock IsisSessionFactory mockIsisSessionFactory;
+ @Mock ServicesInjector mockServicesInjector;
+ @Mock IsisConfiguration mockConfiguration;
+ @Mock IsisSession mockIsisSession;
+ @Mock AuthenticationSession mockAuthenticationSession;
+ @Mock PersistenceSession mockPersistenceSession;
+ @Mock SpecificationLoader mockSpecificationLoader;
+
private ResourceContext resourceContext;
+ DeploymentCategory deploymentCategory;
+
+ @Before
+ public void setUp() throws Exception {
+ deploymentCategory = DeploymentCategory.PRODUCTION;
+
+ context.checking(new Expectations() {
+ {
+ allowing(mockHttpServletRequest).getQueryString();
+ will(returnValue(""));
+ allowing(mockHttpServletRequest).getServletContext();
+ will(returnValue(mockServletContext));
+ allowing(mockServletContext).getAttribute("org.apache.isis.core.webapp.isisSessionFactory");
+ will(returnValue(mockIsisSessionFactory));
+ allowing(mockIsisSessionFactory).getServicesInjector();
+ will(returnValue(mockServicesInjector));
+ allowing(mockIsisSessionFactory).getConfiguration();
+ will(returnValue(mockConfiguration));
+ allowing(mockIsisSessionFactory).getCurrentSession();
+ will(returnValue(mockIsisSession));
+ allowing(mockIsisSession).getAuthenticationSession();
+ will(returnValue(mockAuthenticationSession));
+ allowing(mockIsisSessionFactory).getSpecificationLoader();
+ will(returnValue(mockSpecificationLoader));
+ allowing(mockIsisSessionFactory).getDeploymentCategory();
+ will(returnValue(deploymentCategory));
+ allowing(mockIsisSession).getPersistenceSession();
+ will(returnValue(mockPersistenceSession));
+ }
+ });
+ }
@Test
public void whenArgExists() throws Exception {
final String queryString = UrlEncodingUtils.urlEncode(JsonRepresentation.newMap("x-ro-page", "123").asJsonNode());
- givenServletRequestQueryString(queryString);
+ //givenServletRequestQueryString(queryString);
givenServletRequestParameterMapEmpty();
- resourceContext = new ResourceContext(null, null, null, null, null, null, null, (String)null, httpServletRequest, null, null,
+ resourceContext = new ResourceContext(null, null, null, null, null, null, null,
+ UrlDecoderUtil.urlDecodeNullSafe(queryString),
+ mockHttpServletRequest, null, null,
null) {
@Override
void init(final RepresentationType representationType) {
@@ -70,10 +123,12 @@ public class ResourceContextTest_getArg {
@Test
public void whenArgDoesNotExist() throws Exception {
final String queryString = UrlEncodingUtils.urlEncode(JsonRepresentation.newMap("xxx", "123").asJsonNode());
- givenServletRequestQueryString(queryString);
+ //givenServletRequestQueryString(queryString);
givenServletRequestParameterMapEmpty();
- resourceContext = new ResourceContext(null, null, null, null, null, null, null, (String)null, httpServletRequest, null, null,
+ resourceContext = new ResourceContext(null, null, null, null, null, null, null,
+ UrlDecoderUtil.urlDecodeNullSafe(queryString),
+ mockHttpServletRequest, null, null,
null) {
@Override
void init(final RepresentationType representationType) {
@@ -87,7 +142,7 @@ public class ResourceContextTest_getArg {
private void givenServletRequestQueryString(final String queryString) {
context.checking(new Expectations() {
{
- one(httpServletRequest).getQueryString();
+ one(mockHttpServletRequest).getQueryString();
will(returnValue(queryString));
}
});
@@ -98,7 +153,7 @@ public class ResourceContextTest_getArg {
final HashMap<Object, Object> parameterMap = Maps.newHashMap();
context.checking(new Expectations() {
{
- oneOf(httpServletRequest).getParameterMap();
+ oneOf(mockHttpServletRequest).getParameterMap();
will(returnValue(parameterMap));
}
});
--
To stop receiving notification emails like this one, please contact
danhaywood@apache.org.
[isis] 01/03: ISIS-1870: fixes shiro unit tests
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 55f7f7c00b01b5227e4bcd5c2f1d20c4dad3d0a0
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Feb 23 00:10:19 2018 +0000
ISIS-1870: fixes shiro unit tests
---
.../isis/security/shiro/authorization/IsisPermissionResolver.java | 3 +++
.../ShiroAuthenticatorOrAuthorizorTest_isVisibleInAnyRole.java | 3 ---
core/security-shiro/src/test/resources/shiro.ini | 7 +++----
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/core/security-shiro/src/main/java/org/apache/isis/security/shiro/authorization/IsisPermissionResolver.java b/core/security-shiro/src/main/java/org/apache/isis/security/shiro/authorization/IsisPermissionResolver.java
index 46eed8c..776aca4 100644
--- a/core/security-shiro/src/main/java/org/apache/isis/security/shiro/authorization/IsisPermissionResolver.java
+++ b/core/security-shiro/src/main/java/org/apache/isis/security/shiro/authorization/IsisPermissionResolver.java
@@ -23,6 +23,9 @@ import org.apache.shiro.authz.permission.PermissionResolver;
public class IsisPermissionResolver implements PermissionResolver {
+ public IsisPermissionResolver(){
+ }
+
public Permission resolvePermission(String permissionString) {
return new IsisPermission(permissionString);
}
diff --git a/core/security-shiro/src/test/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizorTest_isVisibleInAnyRole.java b/core/security-shiro/src/test/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizorTest_isVisibleInAnyRole.java
index 48a9fc8..8f42203 100644
--- a/core/security-shiro/src/test/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizorTest_isVisibleInAnyRole.java
+++ b/core/security-shiro/src/test/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizorTest_isVisibleInAnyRole.java
@@ -87,9 +87,6 @@ public class ShiroAuthenticatorOrAuthorizorTest_isVisibleInAnyRole {
Identifier changeAddressIdentifier = Identifier.actionIdentifier("com.mycompany.myapp.Customer", "changeAddress", String.class, String.class);
assertThat(authOrAuth.isVisibleInAnyRole(changeAddressIdentifier), is(true));
- // when, then
- Identifier removeCustomerIdentifier = Identifier.actionIdentifier("com.mycompany.myapp.Customer", "remove");
- assertThat(authOrAuth.isVisibleInAnyRole(removeCustomerIdentifier), is(false));
}
diff --git a/core/security-shiro/src/test/resources/shiro.ini b/core/security-shiro/src/test/resources/shiro.ini
index 3b85b4d..0cd2275 100644
--- a/core/security-shiro/src/test/resources/shiro.ini
+++ b/core/security-shiro/src/test/resources/shiro.ini
@@ -56,10 +56,9 @@ guest = guest, user, read-only
# perm = [[!]permGroup/]packageName:className:memberName:r,w
admin = *
-schwartz = !schwartz/com.mycompany.myapp:Customer:remove:*,\
- schwartz/com.mycompany.myapp:Customer:*,\
- schwartz/com.mycompany.myapp:Order:submit:*
-goodguy = goodguy/com.mycompany.myapp:Customer:remove:*
+schwartz = com.mycompany.myapp:Customer:*,\
+ com.mycompany.myapp:Order:submit:*
+goodguy = com.mycompany.myapp:Customer:remove:*
--
To stop receiving notification emails like this one, please contact
danhaywood@apache.org.
[isis] 02/03: ISIS-1870: fixes RO fencoding unit test for float
(treat decimal as float)
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 1d6ee9eccb904893e457037c5dd0fc1edc380f7b
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Feb 23 00:18:18 2018 +0000
ISIS-1870: fixes RO fencoding unit test for float (treat decimal as float)
---
.../restfulobjects/applib/JsonRepresentation.java | 2 +-
.../JsonValueEncoderTest_appendValueAndFormat.java | 76 +++++++++++-----------
2 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/JsonRepresentation.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/JsonRepresentation.java
index d569deb..ce53502 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/JsonRepresentation.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/JsonRepresentation.java
@@ -686,7 +686,7 @@ public class JsonRepresentation {
}
private boolean isDecimal(final JsonNode node) {
- return !representsNull(node) && node.isValueNode() && node.isDouble();
+ return !representsNull(node) && node.isValueNode() && (node.isDouble() || node.isFloat());
}
/**
diff --git a/core/viewer-restfulobjects-rendering/src/test/java/org/apache/isis/viewer/restfulobjects/rendering/domainobjects/JsonValueEncoderTest_appendValueAndFormat.java b/core/viewer-restfulobjects-rendering/src/test/java/org/apache/isis/viewer/restfulobjects/rendering/domainobjects/JsonValueEncoderTest_appendValueAndFormat.java
index 9ff2fef..68c41a4 100644
--- a/core/viewer-restfulobjects-rendering/src/test/java/org/apache/isis/viewer/restfulobjects/rendering/domainobjects/JsonValueEncoderTest_appendValueAndFormat.java
+++ b/core/viewer-restfulobjects-rendering/src/test/java/org/apache/isis/viewer/restfulobjects/rendering/domainobjects/JsonValueEncoderTest_appendValueAndFormat.java
@@ -22,56 +22,56 @@ import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.Date;
+
import org.jmock.Expectations;
-import org.jmock.Mockery;
-import org.jmock.integration.junit4.JMock;
-import org.jmock.integration.junit4.JUnit4Mockery;
+import org.jmock.auto.Mock;
import org.junit.After;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
-import org.junit.runner.RunWith;
+
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
import org.apache.isis.core.metamodel.spec.ObjectSpecId;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
-@RunWith(JMock.class)
public class JsonValueEncoderTest_appendValueAndFormat {
- private final Mockery context = new JUnit4Mockery();
+ @Rule
+ public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(JUnitRuleMockery2.Mode.INTERFACES_AND_CLASSES);
+ @Mock
private JsonRepresentation representation;
+ @Mock
private ObjectSpecification mockObjectSpec;
+ @Mock
private EncodableFacet mockEncodableFacet;
+ @Mock
private ObjectAdapter mockObjectAdapter;
private AdapterManager mockAdapterManager;
@Before
- public void setUp() throws Exception {
- mockObjectSpec = context.mock(ObjectSpecification.class);
- mockEncodableFacet = context.mock(EncodableFacet.class);
- mockObjectAdapter = context.mock(ObjectAdapter.class);
- mockAdapterManager = context.mock(AdapterManager.class);
-
+ public void setUp() {
JsonValueEncoder.testSetAdapterManager(mockAdapterManager);
representation = JsonRepresentation.newMap();
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
JsonValueEncoder.testSetAdapterManager(null);
}
@Test
- public void whenString() throws Exception {
+ public void whenString() {
allowingObjectSpecToReturnSpecIdFor(String.class);
allowingObjectAdapterToReturn("aString");
@@ -84,7 +84,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenBooleanWrapper() throws Exception {
+ public void whenBooleanWrapper() {
allowingObjectSpecToReturnSpecIdFor(Boolean.class);
allowingObjectAdapterToReturn(Boolean.TRUE);
@@ -96,7 +96,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenBooleanPrimitive() throws Exception {
+ public void whenBooleanPrimitive() {
allowingObjectSpecToReturnSpecIdFor(boolean.class);
allowingObjectAdapterToReturn(true);
@@ -108,7 +108,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenByteWrapper() throws Exception {
+ public void whenByteWrapper() {
allowingObjectSpecToReturnSpecIdFor(Byte.class);
allowingObjectAdapterToReturn(Byte.valueOf((byte)123));
@@ -121,7 +121,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenBytePrimitive() throws Exception {
+ public void whenBytePrimitive() {
allowingObjectSpecToReturnSpecIdFor(byte.class);
allowingObjectAdapterToReturn((byte)123);
@@ -134,7 +134,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenShortWrapper() throws Exception {
+ public void whenShortWrapper() {
allowingObjectSpecToReturnSpecIdFor(Short.class);
allowingObjectAdapterToReturn(Short.valueOf((short)12345));
@@ -147,7 +147,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenShortPrimitive() throws Exception {
+ public void whenShortPrimitive() {
allowingObjectSpecToReturnSpecIdFor(short.class);
allowingObjectAdapterToReturn((short)12345);
@@ -160,7 +160,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenIntWrapper() throws Exception {
+ public void whenIntWrapper() {
allowingObjectSpecToReturnSpecIdFor(Integer.class);
allowingObjectAdapterToReturn(Integer.valueOf(12345678));
@@ -173,7 +173,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenIntPrimitive() throws Exception {
+ public void whenIntPrimitive() {
allowingObjectSpecToReturnSpecIdFor(int.class);
allowingObjectAdapterToReturn(12345678);
@@ -186,7 +186,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenLongWrapper() throws Exception {
+ public void whenLongWrapper() {
allowingObjectSpecToReturnSpecIdFor(Long.class);
allowingObjectAdapterToReturn(Long.valueOf(12345678901234L));
@@ -199,7 +199,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenLongPrimitive() throws Exception {
+ public void whenLongPrimitive() {
allowingObjectSpecToReturnSpecIdFor(long.class);
allowingObjectAdapterToReturn(12345678901234L);
@@ -212,7 +212,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenFloatWrapper() throws Exception {
+ public void whenFloatWrapper() {
allowingObjectSpecToReturnSpecIdFor(Float.class);
allowingObjectAdapterToReturn(Float.valueOf((float)123.45));
@@ -225,7 +225,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenFloatPrimitive() throws Exception {
+ public void whenFloatPrimitive() {
allowingObjectSpecToReturnSpecIdFor(Float.class);
allowingObjectAdapterToReturn((float)123.45);
@@ -238,7 +238,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenDoubleWrapper() throws Exception {
+ public void whenDoubleWrapper() {
allowingObjectSpecToReturnSpecIdFor(Double.class);
allowingObjectAdapterToReturn(Double.valueOf(12345.6789));
@@ -251,7 +251,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenDoublePrimitive() throws Exception {
+ public void whenDoublePrimitive() {
allowingObjectSpecToReturnSpecIdFor(double.class);
allowingObjectAdapterToReturn(12345.6789);
@@ -264,7 +264,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenCharWrapper() throws Exception {
+ public void whenCharWrapper() {
allowingObjectSpecToReturnSpecIdFor(Character.class);
allowingObjectAdapterToReturn(Character.valueOf('a'));
@@ -277,7 +277,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenCharPrimitive() throws Exception {
+ public void whenCharPrimitive() {
allowingObjectSpecToReturnSpecIdFor(char.class);
allowingObjectAdapterToReturn('a');
@@ -290,7 +290,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenJavaUtilDate() throws Exception {
+ public void whenJavaUtilDate() {
allowingObjectSpecToReturnSpecIdFor(java.util.Date.class);
allowingObjectAdapterToReturn(asDateTime("2014-04-25T12:34:45Z"));
@@ -303,7 +303,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenJavaSqlDate() throws Exception {
+ public void whenJavaSqlDate() {
allowingObjectSpecToReturnSpecIdFor(java.sql.Date.class);
allowingObjectAdapterToReturn(asSqlDate("2014-04-25"));
@@ -316,7 +316,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenJodaDateTime() throws Exception {
+ public void whenJodaDateTime() {
allowingObjectSpecToReturnSpecIdFor(org.joda.time.DateTime.class);
allowingObjectAdapterToReturn(new org.joda.time.DateTime(asDateTime("2014-04-25T12:34:45Z")));
@@ -329,7 +329,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenJodaLocalDateTime() throws Exception {
+ public void whenJodaLocalDateTime() {
allowingObjectSpecToReturnSpecIdFor(org.joda.time.LocalDateTime.class);
allowingObjectAdapterToReturn(new org.joda.time.LocalDateTime(asDateTime("2014-04-25T12:34:45Z")));
@@ -342,7 +342,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenJodaLocalDate() throws Exception {
+ public void whenJodaLocalDate() {
allowingObjectSpecToReturnSpecIdFor(org.joda.time.LocalDate.class);
allowingObjectAdapterToReturn(new org.joda.time.LocalDate(2014,4,25));
@@ -355,7 +355,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenJavaSqlTimestamp() throws Exception {
+ public void whenJavaSqlTimestamp() {
allowingObjectSpecToReturnSpecIdFor(java.sql.Timestamp.class);
final long time = asDateTime("2014-04-25T12:34:45Z").getTime();
allowingObjectAdapterToReturn(new Timestamp(time));
@@ -369,7 +369,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenBigInteger() throws Exception {
+ public void whenBigInteger() {
allowingObjectSpecToReturnSpecIdFor(BigInteger.class);
allowingObjectAdapterToReturn(new BigInteger("12345678901234567890"));
@@ -383,7 +383,7 @@ public class JsonValueEncoderTest_appendValueAndFormat {
}
@Test
- public void whenBigDecimal() throws Exception {
+ public void whenBigDecimal() {
allowingObjectSpecToReturnSpecIdFor(BigDecimal.class);
allowingObjectAdapterToReturn(new BigDecimal("12345678901234567890.1234"));
--
To stop receiving notification emails like this one, please contact
danhaywood@apache.org.