/** * @see org.carewebframework.api.context.IContextManager#getContextMarshaller */ @Override public ContextMarshaller getContextMarshaller(String keyStoreName) throws ContextException { try { return new ContextMarshaller(appFramework.getApplicationContext().getBean(keyStoreName, IDigitalSignature.class)); } catch (Exception e) { throw new ContextException( "An exception occurred while trying to access a context marshaller for the specified key store.", e); } }
@Test @Ignore public void marshalling() throws Exception { changePatientContext(); ContextMarshaller marshaller = contextManager.getContextMarshaller("keystore-test"); String ctx = marshaller.marshal(contextManager.getMarshaledContext()); String sig = marshaller.sign(ctx); PatientContext.changePatient(null); assertNull(PatientContext.getActivePatient()); marshaller.unmarshal(ctx, sig); Patient patient = PatientContext.getActivePatient(); assertTrue("Doe, Jane".equalsIgnoreCase(new HumanNameParser().toString(patient.getName().get(0)))); }
@Test @Ignore public void marshalling() throws Exception { changePatientContext(); ContextMarshaller marshaller = contextManager.getContextMarshaller("keystore-test"); String ctx = marshaller.marshal(contextManager.getMarshaledContext()); String sig = marshaller.sign(ctx); PatientContext.changePatient((Patient) null); assertNull(PatientContext.getActivePatient()); marshaller.unmarshal(ctx, sig); Patient patient = PatientContext.getActivePatient(); assertTrue("Doe, Jane".equalsIgnoreCase(new HumanNameParser().toString(patient.getName().get(0)))); }
/** * @see org.carewebframework.api.context.IContextManager#getContextMarshaller */ @Override public ContextMarshaller getContextMarshaller(String keyStoreName) throws ContextException { try { return new ContextMarshaller( appFramework.getApplicationContext().getBean(keyStoreName, IDigitalSignature.class)); } catch (Exception e) { throw new ContextException( "An exception occurred while trying to access a context marshaller for the specified key store.", e); } }