Skip to content
Browse files

Marked some tests to be adjusted to multi-sensor structure

  • Loading branch information...
1 parent c1521a2 commit a3a1a612671e04c0f895e6427ba821e2d2bd1d00 @obrok obrok committed Mar 22, 2012
Showing with 56 additions and 14 deletions.
  1. +56 −14 src/test/java/pl/llp/aircasting/model/SessionManagerTest.java
View
70 src/test/java/pl/llp/aircasting/model/SessionManagerTest.java
@@ -42,6 +42,7 @@
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
import static org.junit.internal.matchers.IsCollectionContaining.hasItem;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.*;
@@ -124,6 +125,20 @@ public void shouldAllowAccessToAParticularStream() {
}
@Test
+ public void shouldStoreLastMeasurementForEachSensor() {
+ triggerMeasurement("LHC", 150);
+ triggerMeasurement("LHC2", 123);
+
+ assertThat(sessionManager.getNow("LHC"), equalTo(150.0));
+ assertThat(sessionManager.getNow("LHC2"), equalTo(123.0));
+ }
+
+ @Test
+ public void shouldAssumeLastMeasurementIsZeroByDefault() {
+ assertThat(sessionManager.getNow("Something that does not exist"), equalTo(0.0));
+ }
+
+ @Test
public void shouldStoreMeasurements() {
sessionManager.sessionStarted = true;
@@ -135,27 +150,17 @@ public void shouldStoreMeasurements() {
@Test
public void shouldSkipMeasurementsWithoutLocation() {
+ fail("Needs a redo");
+
triggerMeasurement(12.3);
assertThat(sessionManager.getSoundMeasurements().isEmpty(), equalTo(true));
}
@Test
- public void shouldStoreLastMeasurementForEachSensor() {
- triggerMeasurement("LHC", 150);
- triggerMeasurement("LHC2", 123);
-
- assertThat(sessionManager.getNow("LHC"), equalTo(150.0));
- assertThat(sessionManager.getNow("LHC2"), equalTo(123.0));
- }
-
- @Test
- public void shouldAssumeLastMeasurementIsZeroByDefault() {
- assertThat(sessionManager.getNow("Something that does not exist"), equalTo(0.0));
- }
-
- @Test
public void shouldNotifyListenersAboutMeasurements() {
+ fail("Needs a redo");
+
SessionManager.Listener listener = mock(SessionManager.Listener.class);
sessionManager.registerListener(listener);
@@ -166,6 +171,8 @@ public void shouldNotifyListenersAboutMeasurements() {
@Test
public void shouldStartSensors() {
+ fail("Needs a redo");
+
sessionManager.startSensors();
verify(sessionManager.locationHelper).start();
@@ -175,6 +182,8 @@ public void shouldStartSensors() {
@Test
public void shouldOnlyStartSensorsOnce() {
+ fail("Needs a redo");
+
sessionManager.startSensors();
sessionManager.startSensors();
@@ -185,6 +194,8 @@ public void shouldOnlyStartSensorsOnce() {
@Test
public void shouldStopSensors() {
+ fail("Needs a redo");
+
sessionManager.startSensors();
sessionManager.stopSensors();
@@ -195,6 +206,8 @@ public void shouldStopSensors() {
@Test
public void shouldNotStopSensorsDuringASession() {
+ fail("Needs a redo");
+
sessionManager.startSession();
sessionManager.stopSensors();
@@ -205,6 +218,8 @@ public void shouldNotStopSensorsDuringASession() {
@Test
public void shouldStartASession() {
+ fail("Needs a redo");
+
sessionManager.startSession();
verify(sessionManager.locationHelper).start();
@@ -214,6 +229,8 @@ public void shouldStartASession() {
@Test
public void shouldUnregisterListeners() {
+ fail("Needs a redo");
+
SessionManager.Listener listener = mock(SessionManager.Listener.class);
sessionManager.registerListener(listener);
sessionManager.unregisterListener(listener);
@@ -225,6 +242,8 @@ public void shouldUnregisterListeners() {
@Test
public void shouldNotStopSessionWhenLastListenerUnregisters() {
+ fail("Needs a redo");
+
SessionManager.Listener listener = mock(SessionManager.Listener.class);
sessionManager.registerListener(listener);
@@ -236,6 +255,8 @@ public void shouldNotStopSessionWhenLastListenerUnregisters() {
@Test
public void shouldDiscardSession() {
+ fail("Needs a redo");
+
triggerMeasurement(13.5);
sessionManager.discardSession();
@@ -248,6 +269,8 @@ public void shouldDiscardSession() {
@Test
public void shouldStopASession() {
+ fail("Needs a redo");
+
SessionRepository.ProgressListener listener = mock(SessionRepository.ProgressListener.class);
triggerMeasurement(11);
@@ -262,6 +285,8 @@ public void shouldStopASession() {
@Test
public void shouldNotifyListenersOnSessionClobber() {
+ fail("Needs a redo");
+
SessionManager.Listener listener = mock(SessionManager.Listener.class);
sessionManager.registerListener(listener);
@@ -272,6 +297,8 @@ public void shouldNotifyListenersOnSessionClobber() {
@Test
public void shouldNotifyListenersOnSessionLoad() {
+ fail("Needs a redo");
+
SessionManager.Listener listener = mock(SessionManager.Listener.class);
sessionManager.registerListener(listener);
@@ -282,6 +309,8 @@ public void shouldNotifyListenersOnSessionLoad() {
@Test
public void shouldNotAddMeasurementsToASavedSession() {
+ fail("Needs a redo");
+
sessionManager.session = new Session();
triggerMeasurement(10);
@@ -291,6 +320,8 @@ public void shouldNotAddMeasurementsToASavedSession() {
@Test
public void shouldProvideRunningAverage() {
+ fail("Needs a redo");
+
sessionManager.session = new Session();
sessionManager.session.add(new Measurement(2));
sessionManager.session.add(new Measurement(4));
@@ -303,6 +334,8 @@ public void shouldProvideRunningAverage() {
@Test
public void shouldProvideRunningPeak() {
+ fail("Needs a redo");
+
sessionManager.session = new Session();
sessionManager.session.add(new Measurement(6));
sessionManager.session.add(new Measurement(4));
@@ -315,6 +348,8 @@ public void shouldProvideRunningPeak() {
@Test
public void shouldSaveAdditionalData() {
+ fail("Needs a redo");
+
sessionManager.settingsHelper = mock(SettingsHelper.class);
sessionManager.metadataHelper = mock(MetadataHelper.class);
when(sessionManager.settingsHelper.getCalibration()).thenReturn(123);
@@ -348,6 +383,8 @@ public void describeTo(Description description) {
@Test
public void shouldJustDeleteNotesIfSessionInProgress() {
+ fail("Needs a redo");
+
sessionManager.startSession();
Note note = sessionManager.makeANote(null, null, null);
@@ -358,6 +395,8 @@ public void shouldJustDeleteNotesIfSessionInProgress() {
@Test
public void afterDeletingNotesShouldHaveNewNumbers() {
+ fail("Needs a redo");
+
sessionManager.startSession();
Note note1 = sessionManager.makeANote(null, null, null);
Note note2 = sessionManager.makeANote(null, null, null);
@@ -370,6 +409,8 @@ public void afterDeletingNotesShouldHaveNewNumbers() {
@Test
public void shouldMarkNotesToBeDeletedForSavedSessions() {
+ fail("Needs a redo");
+
sessionManager.session = mock(Session.class);
when(sessionManager.session.isSaved()).thenReturn(true);
Note note = new Note(null, null, location, null, 10);
@@ -383,6 +424,7 @@ public void shouldMarkNotesToBeDeletedForSavedSessions() {
@Test
public void shouldRestartExternalSensor() {
sessionManager.restartSensors();
+ sessionManager.restartSensors();
verify(sessionManager.externalSensor).start();
}

0 comments on commit a3a1a61

Please sign in to comment.
Something went wrong with that request. Please try again.