@Override public void onFailire(String message) { context.constructErrorResponse(operation, message); } });
/** * Tests opening a wavelet that has to be retrieved using the * {@link WaveletProvider}. */ public void testOpenWaveletFromWaveletProvider() throws Exception { OpBasedWavelet opBasedWavelet = wavelet.getOpBasedWavelet(PARTICIPANT); assertEquals(opBasedWavelet, operationContext.openWavelet(WAVE_ID, WAVELET_ID, PARTICIPANT)); }
public void testPutNonTemporaryWavelet() throws Exception { OpBasedWavelet opBasedWavelet = wavelet.getOpBasedWavelet(PARTICIPANT); operationContext.putWavelet(WAVE_ID, WAVELET_ID, wavelet); assertEquals(opBasedWavelet, operationContext.openWavelet(WAVE_ID, WAVELET_ID, PARTICIPANT)); }
public void testContextIsBound() throws Exception { assertTrue("Bound contexts should return true", boundOperationContext.isBound()); Map<WaveletName, RobotWaveletData> openWavelets = boundOperationContext.getOpenWavelets(); assertEquals("Bound wavelet should be open", openWavelets.get(WAVELET_NAME), wavelet); assertFalse("Unbound contexts should return false", operationContext.isBound()); }
public void testRegister() throws Exception { OperationType operationType = OperationType.BLIP_CONTINUE_THREAD; DoNothingService doNothingService = DoNothingService.create(); operationAccessor.register(operationType, doNothingService); OperationService service = operationAccessor.getServiceFor(operationType); assertEquals(doNothingService, service); } }
public void testGetOpBasedWaveletReturnsSame() { OpBasedWavelet waveletAlex = wavelet.getOpBasedWavelet(ALEX); assertSame(waveletAlex, wavelet.getOpBasedWavelet(ALEX)); }
public void testGetWaveletName() { assertEquals(wavelet.getWaveletName(), WAVELET_NAME); }
public void testOpenNonExistingWaveletThrowsInvalidRequestException() throws Exception { try { operationContext.openWavelet(WAVE_ID, WaveletId.of("example.com", "unreal"), PARTICIPANT); fail("Expected InvalidRequestException"); } catch (InvalidRequestException e) { // expected } }
public void testGetServiceForThrowsException() throws Exception { try { operationAccessor.getServiceFor(OperationType.BLIP_CONTINUE_THREAD); fail("Expected non registered OperationType to throw exception"); } catch (InvalidRequestException e) { // expected } }
@Override protected void setUp() { operationAccessor = new OperationServiceRegistryImpl(); }
public void testPutNonTemporaryWavelet() throws Exception { OpBasedWavelet opBasedWavelet = wavelet.getOpBasedWavelet(PARTICIPANT); operationContext.putWavelet(WAVE_ID, WAVELET_ID, wavelet); assertEquals(opBasedWavelet, operationContext.openWavelet(WAVE_ID, WAVELET_ID, PARTICIPANT)); }
public void testContextIsBound() throws Exception { assertTrue("Bound contexts should return true", boundOperationContext.isBound()); Map<WaveletName, RobotWaveletData> openWavelets = boundOperationContext.getOpenWavelets(); assertEquals("Bound wavelet should be open", openWavelets.get(WAVELET_NAME), wavelet); assertFalse("Unbound contexts should return false", operationContext.isBound()); }
public void testRegister() throws Exception { OperationType operationType = OperationType.BLIP_CONTINUE_THREAD; DoNothingService doNothingService = DoNothingService.create(); operationAccessor.register(operationType, doNothingService); OperationService service = operationAccessor.getServiceFor(operationType); assertEquals(doNothingService, service); } }
/** * Tests opening a wavelet that has to be retrieved using the * {@link WaveletProvider}. */ public void testOpenWaveletFromWaveletProvider() throws Exception { OpBasedWavelet opBasedWavelet = wavelet.getOpBasedWavelet(PARTICIPANT); assertEquals(opBasedWavelet, operationContext.openWavelet(WAVE_ID, WAVELET_ID, PARTICIPANT)); }
public void testGetOpBasedWaveletReturnsSame() { OpBasedWavelet waveletAlex = wavelet.getOpBasedWavelet(ALEX); assertSame(waveletAlex, wavelet.getOpBasedWavelet(ALEX)); }
public void testGetWaveletName() { assertEquals(wavelet.getWaveletName(), WAVELET_NAME); }
public void testOpenNonExistingWaveletThrowsInvalidRequestException() throws Exception { try { operationContext.openWavelet(WAVE_ID, WaveletId.of("example.com", "unreal"), PARTICIPANT); fail("Expected InvalidRequestException"); } catch (InvalidRequestException e) { // expected } }
public void testGetServiceForThrowsException() throws Exception { try { operationAccessor.getServiceFor(OperationType.BLIP_CONTINUE_THREAD); fail("Expected non registered OperationType to throw exception"); } catch (InvalidRequestException e) { // expected } }
public void testPutTemporaryWavelet() throws Exception { OpBasedWavelet opBasedWavelet = wavelet.getOpBasedWavelet(PARTICIPANT); WaveId tempWaveId = WaveId.of("example.com", OperationContextImpl.TEMP_ID_MARKER + "random"); WaveletId tempWaveletId = WaveletId.of("example.com", "conv+root"); operationContext.putWavelet(tempWaveId, tempWaveletId, wavelet); assertEquals( opBasedWavelet, operationContext.openWavelet(tempWaveId, tempWaveletId, PARTICIPANT)); assertEquals(opBasedWavelet, operationContext.openWavelet(WAVE_ID, WAVELET_ID, PARTICIPANT)); }
public void testPutTemporaryWavelet() throws Exception { OpBasedWavelet opBasedWavelet = wavelet.getOpBasedWavelet(PARTICIPANT); WaveId tempWaveId = WaveId.of("example.com", OperationContextImpl.TEMP_ID_MARKER + "random"); WaveletId tempWaveletId = WaveletId.of("example.com", "conv+root"); operationContext.putWavelet(tempWaveId, tempWaveletId, wavelet); assertEquals( opBasedWavelet, operationContext.openWavelet(tempWaveId, tempWaveletId, PARTICIPANT)); assertEquals(opBasedWavelet, operationContext.openWavelet(WAVE_ID, WAVELET_ID, PARTICIPANT)); }