List of usage examples for org.springframework.util Assert isInstanceOf
public static void isInstanceOf(Class<?> type, @Nullable Object obj)
From source file:org.openregistry.core.domain.jpa.sor.JpaSorPersonImpl.java
public void addRole(final SorRole sorRole) { Assert.isInstanceOf(JpaSorRoleImpl.class, sorRole); this.roles.add(sorRole); }
From source file:org.openregistry.core.domain.jpa.JpaPersonImpl.java
public Role addRole(final SorRole sorRole) { Assert.isInstanceOf(JpaSorRoleImpl.class, sorRole); final JpaRoleImpl jpaRole = new JpaRoleImpl((JpaSorRoleImpl) sorRole, this); this.roles.add(jpaRole); return jpaRole; }
From source file:org.LexGrid.LexBIG.caCore.test.rest.RESTTest.java
public void testRESTHTMLInvalidCriteriaObject() throws Exception { try {// ww w. java2 s . c o m callRestfulService( "GetHTML?query=org.LexGrid.concepts.Entity&org.LexGrid.concepts.EntityINVALID[@_entityCode=29506000][@_entityCodeNamespace=SNOMED%20Clinical%20Terms]"); } catch (Exception e) { Assert.isInstanceOf(IOException.class, e); assertTrue(e.getMessage().contains("HTTP response code: 400")); return; } fail(); }
From source file:org.openregistry.core.domain.jpa.sor.JpaSorRoleImpl.java
public void setSponsorType(final Type type) { Assert.isInstanceOf(JpaTypeImpl.class, type); this.sponsorType = (JpaTypeImpl) type; }
From source file:org.openregistry.core.domain.jpa.JpaRoleImpl.java
public void setSponsorType(final Type type) { Assert.isInstanceOf(JpaTypeImpl.class, type); this.sponsorType = type; }
From source file:org.LexGrid.LexBIG.caCore.test.rest.RESTTest.java
public void testRESTXMLInvalidAttribute() throws Exception { try {/* www . java 2 s.c om*/ callRestfulService( "GetXML?query=org.LexGrid.concepts.Entity&org.LexGrid.concepts.Entity[@_entityCodeINVALID=29506000]"); } catch (Exception e) { Assert.isInstanceOf(IOException.class, e); assertTrue(e.getMessage().contains("HTTP response code: 400")); return; } fail(); }
From source file:org.openregistry.core.domain.jpa.JpaPersonImpl.java
public Identifier addIdentifier(final IdentifierType identifierType, final String value) { Assert.isInstanceOf(JpaIdentifierTypeImpl.class, identifierType); final JpaIdentifierImpl jpaIdentifier = new JpaIdentifierImpl(this, (JpaIdentifierTypeImpl) identifierType, value);/*from w w w .ja v a2 s . c om*/ this.identifiers.add(jpaIdentifier); return jpaIdentifier; }
From source file:org.LexGrid.LexBIG.caCore.test.rest.RESTTest.java
public void testRESTHTMLInvalidAttribute() throws Exception { try {/*ww w. j a v a2s . co m*/ callRestfulService( "GetHTML?query=org.LexGrid.concepts.Entity&org.LexGrid.concepts.Entity[@_entityCodeINVALID=29506000]"); } catch (Exception e) { Assert.isInstanceOf(IOException.class, e); assertTrue(e.getMessage().contains("HTTP response code: 400")); return; } fail(); }
From source file:org.openregistry.core.domain.jpa.JpaRoleImpl.java
public void setOrganizationalUnit(OrganizationalUnit organizationalUnit) { Assert.isInstanceOf(JpaOrganizationalUnitImpl.class, organizationalUnit); this.organizationalUnit = (JpaOrganizationalUnitImpl) organizationalUnit; }
From source file:com.alliander.osgp.adapter.ws.endpointinterceptors.WebServiceMonitorInterceptor.java
/** * Create the logging Request Message.// w w w .j a v a 2 s . c o m * * @param messageContext * The messageContext. * @param endpoint * The endpoint. * * @return The loggingRequestMessage. * * @throws WebServiceMonitorInterceptorException */ private LoggingRequestMessage createLoggingRequestMessage(final MessageContext messageContext, final Object endpoint) throws WebServiceMonitorInterceptorException { // Get the current time. final Date now = new Date(); // Get EndPointClass and EndPointMethod. final Map<String, String> classAndMethod = this.getEndPointClassAndMethod(endpoint); // Get the request. Assert.isInstanceOf(SoapMessage.class, messageContext.getRequest()); final SoapMessage request = (SoapMessage) messageContext.getRequest(); this.printSoapMessage(request); final SoapHeader soapHeader = request.getSoapHeader(); // Read OrganisationIdentification from header from request. final String orgIdentification = this.getHeaderValue(soapHeader, this.organisationIdentification); // Read UserName from header from request. final String usrName = this.getHeaderValue(soapHeader, this.userName); // Read ApplicationName from header from request. final String appName = this.getHeaderValue(soapHeader, this.applicationName); // Read correlationUid and deviceId from request. final Map<String, Object> requestData = this.parseSoapMessage(request); if (requestData == null) { throw new WebServiceMonitorInterceptorException( "unable to get correlationUid or deviceId from request"); } // Get the response. Assert.isInstanceOf(SoapMessage.class, messageContext.getResponse()); final SoapMessage response = (SoapMessage) messageContext.getResponse(); this.printSoapMessage(response); // Read correlationUid and deviceId and result and data size from // response. final Map<String, Object> responseData = this.parseSoapMessage(response); if (responseData == null) { throw new WebServiceMonitorInterceptorException( "unable to get correlationUid or deviceId or result from response"); } // Check response for correlationId, otherwise request String correlationId = (String) responseData.get(CORRELATION_UID); if (StringUtils.isEmpty(correlationId)) { correlationId = (String) requestData.get(CORRELATION_UID); } // Creating the logging request message return new LoggingRequestMessage(now, orgIdentification, usrName, appName, classAndMethod.get(CLASS_NAME), classAndMethod.get(METHOD_NAME), (String) requestData.get(DEVICE_ID), correlationId, (String) responseData.get(RESPONSE_RESULT), (int) responseData.get(RESPONSE_DATA_SIZE)); }