Skip to content

Commit 705bb90

Browse files
Add multi-threaded test case
1 parent e33fa04 commit 705bb90

File tree

3 files changed

+271
-65
lines changed

3 files changed

+271
-65
lines changed

net.zetetic.sqlcipher.test.iws

Lines changed: 86 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,26 @@
9393
</component>
9494
<component name="FileEditorManager">
9595
<leaf>
96-
<file leaf-file-name="TestSuiteRunner.java" pinned="false" current="true" current-in-tab="true">
96+
<file leaf-file-name="TestSuiteRunner.java" pinned="false" current="false" current-in-tab="false">
9797
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/tests/TestSuiteRunner.java">
9898
<provider selected="true" editor-type-id="text-editor">
99-
<state line="60" column="32" selection-start="2066" selection-end="2066" vertical-scroll-proportion="2.0848708" vertical-offset="407" max-vertical-offset="1368">
99+
<state line="73" column="50" selection-start="2727" selection-end="2727" vertical-scroll-proportion="0.0" vertical-offset="407" max-vertical-offset="1386">
100100
<folding />
101101
</state>
102102
</provider>
103103
</entry>
104104
</file>
105+
<file leaf-file-name="MultiThreadReadWriteTest.java" pinned="false" current="true" current-in-tab="true">
106+
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/tests/MultiThreadReadWriteTest.java">
107+
<provider selected="true" editor-type-id="text-editor">
108+
<state line="167" column="33" selection-start="6665" selection-end="6665" vertical-scroll-proportion="3.1279917" vertical-offset="0" max-vertical-offset="3402">
109+
<folding>
110+
<element signature="imports" expanded="true" />
111+
</folding>
112+
</state>
113+
</provider>
114+
</entry>
115+
</file>
105116
<file leaf-file-name="AndroidManifest.xml" pinned="false" current="false" current-in-tab="false">
106117
<entry file="file://$PROJECT_DIR$/AndroidManifest.xml">
107118
<provider selected="true" editor-type-id="text-editor">
@@ -141,7 +152,7 @@
141152
<file leaf-file-name="SQLCipherTest.java" pinned="false" current="false" current-in-tab="false">
142153
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/tests/SQLCipherTest.java">
143154
<provider selected="true" editor-type-id="text-editor">
144-
<state line="8" column="29" selection-start="190" selection-end="190" vertical-scroll-proportion="0.0" vertical-offset="144" max-vertical-offset="1080">
155+
<state line="10" column="28" selection-start="228" selection-end="228" vertical-scroll-proportion="0.0" vertical-offset="180" max-vertical-offset="1080">
145156
<folding />
146157
</state>
147158
</provider>
@@ -159,7 +170,7 @@
159170
<file leaf-file-name="CursorAccessTest.java" pinned="false" current="false" current-in-tab="false">
160171
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/tests/CursorAccessTest.java">
161172
<provider selected="true" editor-type-id="text-editor">
162-
<state line="24" column="27" selection-start="893" selection-end="893" vertical-scroll-proportion="0.0" vertical-offset="83" max-vertical-offset="1044">
173+
<state line="24" column="27" selection-start="893" selection-end="893" vertical-scroll-proportion="0.0" vertical-offset="432" max-vertical-offset="1152">
163174
<folding />
164175
</state>
165176
</provider>
@@ -203,6 +214,8 @@
203214
<option value="$PROJECT_DIR$/src/main/java/net/zetetic/tests/SQLCipherTest.java" />
204215
<option value="$PROJECT_DIR$/src/main/java/net/zetetic/tests/CursorAccessTest.java" />
205216
<option value="$PROJECT_DIR$/src/main/java/net/zetetic/tests/SampleTest.java" />
217+
<option value="$PROJECT_DIR$/src/main/java/net/zetetic/tests/MultiThreadedReadWriteTest.java" />
218+
<option value="$PROJECT_DIR$/src/main/java/net/zetetic/tests/MultiThreadReadWriteTest.java" />
206219
<option value="$PROJECT_DIR$/src/main/java/net/zetetic/tests/TestSuiteRunner.java" />
207220
</list>
208221
</option>
@@ -307,6 +320,8 @@
307320
<sortByType />
308321
</navigator>
309322
<panes>
323+
<pane id="Scope" />
324+
<pane id="PackagesPane" />
310325
<pane id="ProjectPane">
311326
<subPane>
312327
<PATH>
@@ -383,8 +398,6 @@
383398
</PATH>
384399
</subPane>
385400
</pane>
386-
<pane id="Scope" />
387-
<pane id="PackagesPane" />
388401
<pane id="Favorites" />
389402
</panes>
390403
</component>
@@ -419,6 +432,7 @@
419432
<property name="options.searchVisible" value="true" />
420433
<property name="dynamic.classpath" value="false" />
421434
<property name="OverrideImplement.overriding.sorted" value="false" />
435+
<property name="LayoutCode.rearrangeEntriesJava" value="false" />
422436
</component>
423437
<component name="RecentsManager">
424438
<key name="CopyFile.RECENT_KEYS">
@@ -428,27 +442,7 @@
428442
<recent name="net.zetetic.tests" />
429443
</key>
430444
</component>
431-
<component name="RunManager" selected="Android Application.emulator-4.4">
432-
<configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
433-
<module name="" />
434-
<option name="TESTING_TYPE" value="0" />
435-
<option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
436-
<option name="METHOD_NAME" value="" />
437-
<option name="CLASS_NAME" value="" />
438-
<option name="PACKAGE_NAME" value="" />
439-
<option name="TARGET_SELECTION_MODE" value="EMULATOR" />
440-
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
441-
<option name="PREFERRED_AVD" value="" />
442-
<option name="USE_COMMAND_LINE" value="true" />
443-
<option name="COMMAND_LINE" value="" />
444-
<option name="WIPE_USER_DATA" value="false" />
445-
<option name="DISABLE_BOOT_ANIMATION" value="false" />
446-
<option name="NETWORK_SPEED" value="full" />
447-
<option name="NETWORK_LATENCY" value="none" />
448-
<option name="CLEAR_LOGCAT" value="false" />
449-
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
450-
<method />
451-
</configuration>
445+
<component name="RunManager" selected="Android Application.emualtor-2.2">
452446
<configuration default="true" type="MavenRunConfiguration" factoryName="Maven">
453447
<MavenSettings>
454448
<option name="myGeneralSettings" />
@@ -471,6 +465,26 @@
471465
</MavenSettings>
472466
<method />
473467
</configuration>
468+
<configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
469+
<module name="" />
470+
<option name="TESTING_TYPE" value="0" />
471+
<option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
472+
<option name="METHOD_NAME" value="" />
473+
<option name="CLASS_NAME" value="" />
474+
<option name="PACKAGE_NAME" value="" />
475+
<option name="TARGET_SELECTION_MODE" value="EMULATOR" />
476+
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
477+
<option name="PREFERRED_AVD" value="" />
478+
<option name="USE_COMMAND_LINE" value="true" />
479+
<option name="COMMAND_LINE" value="" />
480+
<option name="WIPE_USER_DATA" value="false" />
481+
<option name="DISABLE_BOOT_ANIMATION" value="false" />
482+
<option name="NETWORK_SPEED" value="full" />
483+
<option name="NETWORK_LATENCY" value="none" />
484+
<option name="CLEAR_LOGCAT" value="false" />
485+
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
486+
<method />
487+
</configuration>
474488
<configuration default="true" type="Remote" factoryName="Remote">
475489
<option name="USE_SOCKET_TRANSPORT" value="true" />
476490
<option name="SERVER_MODE" value="false" />
@@ -479,6 +493,19 @@
479493
<option name="PORT" value="5005" />
480494
<method />
481495
</configuration>
496+
<configuration default="true" type="Applet" factoryName="Applet">
497+
<module name="" />
498+
<option name="MAIN_CLASS_NAME" />
499+
<option name="HTML_FILE_NAME" />
500+
<option name="HTML_USED" value="false" />
501+
<option name="WIDTH" value="400" />
502+
<option name="HEIGHT" value="300" />
503+
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
504+
<option name="VM_PARAMETERS" />
505+
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
506+
<option name="ALTERNATIVE_JRE_PATH" />
507+
<method />
508+
</configuration>
482509
<configuration default="true" type="TestNG" factoryName="TestNG">
483510
<module name="" />
484511
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -506,19 +533,6 @@
506533
<listeners />
507534
<method />
508535
</configuration>
509-
<configuration default="true" type="Applet" factoryName="Applet">
510-
<module name="" />
511-
<option name="MAIN_CLASS_NAME" />
512-
<option name="HTML_FILE_NAME" />
513-
<option name="HTML_USED" value="false" />
514-
<option name="WIDTH" value="400" />
515-
<option name="HEIGHT" value="300" />
516-
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
517-
<option name="VM_PARAMETERS" />
518-
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
519-
<option name="ALTERNATIVE_JRE_PATH" />
520-
<method />
521-
</configuration>
522536
<configuration default="true" type="Application" factoryName="Application">
523537
<option name="MAIN_CLASS_NAME" />
524538
<option name="VM_PARAMETERS" />
@@ -951,7 +965,7 @@
951965
</todo-panel>
952966
</component>
953967
<component name="ToolWindowManager">
954-
<frame x="0" y="22" width="1916" height="1058" extended-state="6" />
968+
<frame x="0" y="22" width="1916" height="1058" extended-state="0" />
955969
<editor active="true" />
956970
<layout>
957971
<window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3296875" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
@@ -960,19 +974,19 @@
960974
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
961975
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
962976
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
963-
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.6976744" sideWeight="0.3296875" order="3" side_tool="false" content_ui="tabs" />
964-
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.025278058" sideWeight="0.5892484" order="13" side_tool="true" content_ui="tabs" />
977+
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.9130435" sideWeight="0.3296875" order="3" side_tool="false" content_ui="tabs" />
978+
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3478261" sideWeight="0.5892484" order="13" side_tool="true" content_ui="tabs" />
965979
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.26770833" sideWeight="0.49532712" order="2" side_tool="true" content_ui="tabs" />
966980
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
967981
<window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
968-
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.23761375" sideWeight="0.41022965" order="10" side_tool="false" content_ui="tabs" />
982+
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.23660263" sideWeight="0.41022965" order="10" side_tool="false" content_ui="tabs" />
969983
<window_info id="Android" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.62992924" sideWeight="0.91933763" order="8" side_tool="false" content_ui="tabs" />
970984
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32800853" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
971985
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
972986
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32959402" sideWeight="0.65314835" order="4" side_tool="false" content_ui="tabs" />
973987
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
974988
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="14" side_tool="false" content_ui="tabs" />
975-
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.19415449" sideWeight="0.5233645" order="0" side_tool="false" content_ui="combo" />
989+
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2672234" sideWeight="0.5233645" order="0" side_tool="false" content_ui="combo" />
976990
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.47219414" sideWeight="0.0" order="2" side_tool="false" content_ui="tabs" />
977991
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
978992
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
@@ -986,7 +1000,7 @@
9861000
</layout>
9871001
</component>
9881002
<component name="Vcs.Log.UiProperties">
989-
<option name="RECENTLY_FILTERED_USERS">
1003+
<option name="RECENTLY_FILTERED_USER_GROUPS">
9901004
<collection />
9911005
</option>
9921006
</component>
@@ -1241,14 +1255,12 @@
12411255
</provider>
12421256
</entry>
12431257
<entry file="file://$PROJECT_DIR$/res/layout/test_result_row.xml">
1258+
<provider selected="true" editor-type-id="text-editor">
1259+
<state line="31" column="17" selection-start="1393" selection-end="1393" vertical-scroll-proportion="0.6145374" vertical-offset="0" max-vertical-offset="0" />
1260+
</provider>
12441261
<provider editor-type-id="android-designer">
12451262
<state />
12461263
</provider>
1247-
<provider selected="true" editor-type-id="text-editor">
1248-
<state line="31" column="17" selection-start="1393" selection-end="1393" vertical-scroll-proportion="0.6145374" vertical-offset="0" max-vertical-offset="0">
1249-
<folding />
1250-
</state>
1251-
</provider>
12521264
</entry>
12531265
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/tests/AES128CipherTest.java">
12541266
<provider selected="true" editor-type-id="text-editor">
@@ -1262,13 +1274,6 @@
12621274
</state>
12631275
</provider>
12641276
</entry>
1265-
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/tests/MigrateDatabaseFrom1xFormatToCurrentFormat.java">
1266-
<provider selected="true" editor-type-id="text-editor">
1267-
<state line="17" column="55" selection-start="618" selection-end="618" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="0">
1268-
<folding />
1269-
</state>
1270-
</provider>
1271-
</entry>
12721277
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/tests/MigrationUserVersion.java">
12731278
<provider selected="true" editor-type-id="text-editor">
12741279
<state line="31" column="15" selection-start="1370" selection-end="1370" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="990">
@@ -1325,34 +1330,50 @@
13251330
</state>
13261331
</provider>
13271332
</entry>
1328-
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/tests/SQLCipherTest.java">
1333+
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/QueryHelper.java">
13291334
<provider selected="true" editor-type-id="text-editor">
1330-
<state line="8" column="29" selection-start="190" selection-end="190" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1008">
1335+
<state line="6" column="18" selection-start="120" selection-end="120" vertical-scroll-proportion="0.14150943" vertical-offset="0" max-vertical-offset="636">
13311336
<folding />
13321337
</state>
13331338
</provider>
13341339
</entry>
1335-
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/QueryHelper.java">
1340+
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/tests/CursorAccessTest.java">
13361341
<provider selected="true" editor-type-id="text-editor">
1337-
<state line="6" column="18" selection-start="120" selection-end="120" vertical-scroll-proportion="0.14150943" vertical-offset="0" max-vertical-offset="636">
1342+
<state line="24" column="27" selection-start="893" selection-end="893" vertical-scroll-proportion="0.0" vertical-offset="83" max-vertical-offset="1044">
13381343
<folding />
13391344
</state>
13401345
</provider>
13411346
</entry>
1342-
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/tests/CursorAccessTest.java">
1347+
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/tests/SQLCipherTest.java">
13431348
<provider selected="true" editor-type-id="text-editor">
1344-
<state line="24" column="27" selection-start="893" selection-end="893" vertical-scroll-proportion="0.0" vertical-offset="83" max-vertical-offset="1044">
1349+
<state line="10" column="28" selection-start="228" selection-end="228" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1008">
1350+
<folding />
1351+
</state>
1352+
</provider>
1353+
</entry>
1354+
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/tests/MigrateDatabaseFrom1xFormatToCurrentFormat.java">
1355+
<provider selected="true" editor-type-id="text-editor">
1356+
<state line="17" column="55" selection-start="618" selection-end="618" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="0">
13451357
<folding />
13461358
</state>
13471359
</provider>
13481360
</entry>
13491361
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/tests/TestSuiteRunner.java">
13501362
<provider selected="true" editor-type-id="text-editor">
1351-
<state line="60" column="32" selection-start="2066" selection-end="2066" vertical-scroll-proportion="2.0848708" vertical-offset="407" max-vertical-offset="1368">
1363+
<state line="73" column="50" selection-start="2727" selection-end="2727" vertical-scroll-proportion="0.0" vertical-offset="407" max-vertical-offset="1386">
13521364
<folding />
13531365
</state>
13541366
</provider>
13551367
</entry>
1368+
<entry file="file://$PROJECT_DIR$/src/main/java/net/zetetic/tests/MultiThreadReadWriteTest.java">
1369+
<provider selected="true" editor-type-id="text-editor">
1370+
<state line="167" column="33" selection-start="6665" selection-end="6665" vertical-scroll-proportion="3.1279917" vertical-offset="0" max-vertical-offset="3402">
1371+
<folding>
1372+
<element signature="imports" expanded="true" />
1373+
</folding>
1374+
</state>
1375+
</provider>
1376+
</entry>
13561377
</component>
13571378
<component name="masterDetails">
13581379
<states>

0 commit comments

Comments
 (0)