@@ -43,14 +43,18 @@ public class Session {
4343 private static final String KEY_COLLECTIONS = "collections" ;
4444 private static final String KEY_DATASET = "dataset" ;
4545 private static final String KEY_ID = "id" ;
46+ private static final String KEY_DATASET_VERSION = "dataset_version" ;
4647 private static final String KEY_LOGGING = "logging" ;
48+
4749 private static final String KEY_URL = "url" ;
4850 private static final String KEY_TAG = "tag" ;
4951
52+
5053 private static final Set <String > LEGAL_SESSION_KEYS ;
5154 static {
5255 final Set <String > l = new HashSet <>();
5356 l .add (KEY_ID );
57+ l .add (KEY_DATASET_VERSION );
5458 l .add (KEY_LOGGING );
5559 LEGAL_SESSION_KEYS = Collections .unmodifiableSet (l );
5660 }
@@ -103,7 +107,7 @@ public Map<String, Object> newSession(@NonNull String newClient, @NonNull TypedM
103107
104108 endSession (app );
105109
106- final TestContext newCtxt = app .newSession (sessionId );
110+ final TestContext newCtxt = app .newSession (sessionId , req . getString ( KEY_DATASET_VERSION ) );
107111 startSession (app , newCtxt );
108112
109113 final TypedMap logConfig = req .getMap (KEY_LOGGING );
@@ -121,11 +125,15 @@ public final Map<String, Object> reset(@NonNull String client, @NonNull TypedMap
121125
122126 final TestContext oldCtxt = app .getSession (client );
123127 String testName = oldCtxt .getTestName ();
128+
124129 if (testName != null ) { Log .p (TAG , "<<<<< END TEST: " + testName ); }
125130
131+ // preserve the dataset version across resets
132+ final String datasetVersion = oldCtxt .getDatasetVersion ();
133+
126134 endSession (app );
127135
128- final TestContext newCtxt = app .newSession (client );
136+ final TestContext newCtxt = app .newSession (client , datasetVersion );
129137 final DatabaseService dbSvc = startSession (app , newCtxt );
130138 testName = req .getString (KEY_TEST_NAME );
131139 newCtxt .setTestName (testName );
0 commit comments