diff --git a/.classpath b/.classpath
index 6ee61f2..e70c7c1 100644
--- a/.classpath
+++ b/.classpath
@@ -1,10 +1,11 @@
+
-
+
diff --git a/bin/Mouse.class b/bin/Mouse.class
index b0c4576..20717de 100644
Binary files a/bin/Mouse.class and b/bin/Mouse.class differ
diff --git a/bin/MousePath.class b/bin/MousePath.class
index c1374bd..9bce8a6 100644
Binary files a/bin/MousePath.class and b/bin/MousePath.class differ
diff --git a/bin/MouseTest.class b/bin/MouseTest.class
new file mode 100644
index 0000000..7a26c39
Binary files /dev/null and b/bin/MouseTest.class differ
diff --git a/bin/main.class b/bin/main.class
index bd8e31b..8edacf7 100644
Binary files a/bin/main.class and b/bin/main.class differ
diff --git a/src/Mouse.java b/src/Mouse.java
index 8cb7b40..3e84ee0 100644
--- a/src/Mouse.java
+++ b/src/Mouse.java
@@ -89,4 +89,13 @@ public class Mouse {
}
System.out.println("There are " + mousePaths.size() + " paths.");
}
+
+ public int getNumberOfPaths() {
+ return mousePaths.size();
+ }
+
+ public ArrayList getMousePaths() {
+ return mousePaths;
+
+ }
}
\ No newline at end of file
diff --git a/src/MousePath.java b/src/MousePath.java
index c18b2f7..bad40da 100644
--- a/src/MousePath.java
+++ b/src/MousePath.java
@@ -1,12 +1,5 @@
/*
* Represents each mouse path as an ArrayList of points.
- *
- * Testing:
- * - Each point must be valid.
- * - Timespan is reasonable
- * - Does not go off screen
- *
- *
*/
import java.util.ArrayList;
diff --git a/src/MouseTest.java b/src/MouseTest.java
new file mode 100644
index 0000000..51d91ee
--- /dev/null
+++ b/src/MouseTest.java
@@ -0,0 +1,29 @@
+import static org.junit.jupiter.api.Assertions.*;
+import java.util.ArrayList;
+import org.junit.jupiter.api.Test;
+
+/*
+ * Things to test:
+ * - Invalid regex expression
+ * - Empty paths (mouse jumps)
+ * - Short paths
+ * - No input file
+ * - Long paths
+ */
+
+class MouseTest {
+
+ @Test
+ void testMouseLengths() {
+ Mouse mouse = new Mouse("/home/dpapp/eclipse-workspace/RunescapeAI/testfiles/mouse_path_test1.txt");
+ assertEquals(mouse.getNumberOfPaths(), 5);
+
+ ArrayList mousePaths = mouse.getMousePaths();
+ assertEquals(mousePaths.get(0).getNumPoints(), 45);
+ assertEquals(mousePaths.get(1).getNumPoints(), 17);
+ assertEquals(mousePaths.get(2).getNumPoints(), 33);
+ assertEquals(mousePaths.get(3).getNumPoints(), 14);
+ assertEquals(mousePaths.get(4).getNumPoints(), 13);
+ }
+
+}
diff --git a/src/main.java b/src/main.java
index 77c092e..f17d565 100644
--- a/src/main.java
+++ b/src/main.java
@@ -1,9 +1,14 @@
+import java.net.URL;
public class main {
public static void main(String[] args) {
// TODO Auto-generated method stub
- Mouse mouseReader = new Mouse("/home/dpapp/GhostMouse/coordinates.txt");
- mouseReader.displayPaths();
+ //Mouse mouse = new Mouse("/home/dpapp/GhostMouse/coordinates.txt");
+ //URL url = main.class.getClassLoader().getResource("testfiles/mouse_path_test1.txt");
+ //System.out.println(url.getPath());
+ //getResource("testfiles/mouse_path_test1.txt");
+ Mouse mouse = new Mouse("/home/dpapp/eclipse-workspace/RunescapeAI/testfiles/mouse_path_test1.txt");
+ mouse.displayPaths();
}
}
diff --git a/testfiles/mouse_path_test1.txt b/testfiles/mouse_path_test1.txt
new file mode 100644
index 0000000..8481ec6
--- /dev/null
+++ b/testfiles/mouse_path_test1.txt
@@ -0,0 +1,717 @@
+587,367,1
+587,367,6
+587,367,10
+587,367,15
+587,367,19
+587,367,24
+587,367,29
+587,367,34
+587,367,38
+587,367,43
+587,367,48
+587,367,52
+587,367,57
+587,367,63
+587,367,68
+587,367,73
+587,367,78
+587,367,83
+587,367,87
+587,367,92
+587,367,96
+587,367,100
+587,367,104
+587,367,110
+587,367,115
+587,367,120
+587,367,125
+587,367,130
+587,367,134
+587,367,139
+587,367,143
+587,367,148
+587,367,153
+587,367,158
+587,367,162
+587,367,166
+587,367,169
+587,367,173
+587,367,177
+587,367,181
+587,367,186
+587,367,190
+587,367,195
+587,367,199
+587,367,205
+587,367,210
+587,367,215
+587,367,220
+587,367,225
+587,367,231
+587,367,236
+587,367,241
+587,367,245
+587,367,251
+587,367,256
+587,367,261
+587,367,266
+587,367,271
+587,367,276
+587,367,282
+587,367,287
+587,367,291
+587,367,296
+587,367,300
+587,367,305
+587,367,310
+587,367,315
+587,367,320
+587,367,325
+587,367,331
+587,367,337
+587,367,342
+587,367,345
+587,367,349
+587,367,353
+587,367,358
+587,367,362
+587,367,366
+587,367,370
+587,367,374
+587,367,377
+587,367,381
+587,367,385
+587,367,389
+587,367,393
+587,367,398
+587,367,402
+587,367,407
+587,367,411
+587,367,417
+587,367,422
+587,367,427
+587,367,432
+587,367,438
+587,367,444
+587,367,449
+587,367,455
+587,367,460
+587,367,465
+587,367,470
+587,367,475
+587,367,479
+587,367,484
+587,367,488
+587,367,494
+587,367,499
+587,367,504
+587,367,509
+587,367,515
+587,367,520
+587,367,525
+587,367,530
+587,367,535
+587,367,540
+587,367,544
+587,367,549
+587,367,555
+587,367,560
+587,367,564
+587,367,568
+587,367,573
+587,367,578
+587,367,582
+587,367,587
+587,367,591
+587,367,595
+587,367,600
+587,367,604
+587,367,609
+587,367,614
+587,367,619
+587,367,624
+587,367,630
+587,367,635
+587,367,640
+587,367,644
+587,367,649
+587,367,654
+587,367,659
+587,367,664
+587,367,669
+587,367,673
+587,367,679
+587,367,684
+587,367,689
+587,367,694
+587,367,700
+587,367,704
+587,367,709
+587,367,714
+587,367,719
+585,365,723
+567,363,730
+567,363,736
+567,363,741
+537,363,747
+537,363,752
+503,363,758
+503,363,763
+459,363,769
+459,363,774
+407,363,780
+407,363,785
+345,384,791
+345,384,797
+279,408,802
+279,408,808
+279,408,813
+219,426,818
+219,426,824
+179,442,829
+179,442,834
+148,458,839
+148,458,845
+116,475,850
+116,475,855
+116,475,860
+87,494,865
+87,494,870
+65,513,876
+65,513,880
+65,513,885
+65,513,889
+52,535,893
+52,535,897
+42,553,901
+42,553,906
+32,567,911
+32,567,915
+32,567,920
+24,580,925
+24,580,930
+16,598,935
+16,598,939
+16,598,944
+10,619,949
+10,619,955
+6,636,960
+6,636,965
+6,653,971
+6,653,976
+6,670,982
+6,670,987
+6,670,993
+6,687,999
+6,687,1004
+14,701,1009
+14,701,1014
+14,701,1018
+26,712,1022
+26,712,1028
+44,723,1033
+44,723,1039
+77,733,1044
+77,733,1049
+113,744,1054
+113,744,1060
+113,744,1064
+152,755,1070
+152,755,1076
+195,766,1082
+195,766,1088
+236,774,1093
+236,774,1097
+236,774,1102
+274,778,1106
+274,778,1111
+329,778,1117
+329,778,1123
+385,778,1128
+385,778,1133
+453,778,1139
+453,778,1144
+453,778,1149
+519,778,1154
+519,778,1159
+576,778,1163
+576,778,1169
+618,778,1174
+618,778,1180
+618,778,1185
+643,778,1190
+643,778,1196
+659,778,1202
+659,778,1208
+665,778,1213
+665,778,1217
+665,778,1221
+667,778,1225
+667,778,1230
+667,778,1235
+667,778,1240
+667,778,1246
+667,778,1251
+667,778,1257
+667,778,1263
+667,778,1268
+667,778,1271
+667,778,1275
+667,778,1279
+667,778,1284
+667,778,1288
+667,778,1293
+667,778,1299
+667,778,1304
+667,778,1309
+667,778,1314
+667,778,1319
+667,778,1323
+667,778,1326
+667,778,1330
+667,778,1333
+667,778,1338
+667,778,1343
+667,778,1347
+667,778,1352
+667,778,1357
+667,778,1363
+667,778,1368
+667,778,1374
+667,778,1379
+667,778,1384
+667,778,1389
+667,778,1394
+667,778,1400
+667,778,1406
+667,778,1411
+667,778,1415
+667,778,1420
+667,778,1425
+667,778,1430
+667,778,1435
+667,778,1440
+667,778,1445
+667,778,1449
+667,778,1453
+667,778,1458
+669,769,1463
+669,769,1468
+669,769,1473
+692,736,1478
+692,736,1483
+750,680,1489
+750,680,1493
+820,623,1499
+820,623,1503
+820,623,1507
+912,574,1511
+912,574,1516
+912,574,1521
+1018,538,1526
+1018,538,1531
+1111,523,1535
+1111,523,1539
+1111,523,1544
+1181,523,1549
+1181,523,1554
+1231,523,1559
+1231,523,1563
+1231,523,1567
+1278,523,1571
+1278,523,1577
+1328,523,1582
+1328,523,1588
+1370,532,1593
+1370,532,1599
+1414,541,1605
+1414,541,1611
+1414,541,1616
+1448,547,1621
+1448,547,1625
+1470,550,1630
+1470,550,1634
+1470,550,1639
+1477,552,1644
+1477,552,1650
+1477,556,1655
+1477,556,1660
+1477,556,1665
+1477,556,1670
+1477,556,1675
+1477,556,1681
+1477,556,1687
+1477,556,1693
+1477,556,1698
+1477,556,1703
+1477,556,1708
+1477,556,1713
+1477,556,1719
+1477,556,1725
+1477,556,1731
+1477,556,1737
+1477,556,1743
+1477,556,1749
+1477,556,1755
+1477,556,1760
+1477,556,1764
+1477,556,1769
+1477,556,1774
+1477,556,1778
+1477,556,1782
+1477,556,1786
+1477,556,1791
+1477,556,1796
+1477,556,1802
+1477,556,1807
+1477,556,1814
+1477,556,1819
+1477,556,1824
+1477,556,1829
+1477,556,1835
+1477,556,1839
+1477,556,1844
+1477,556,1848
+1477,556,1854
+1477,556,1859
+1477,556,1864
+1477,556,1870
+1477,556,1875
+1477,556,1881
+1477,556,1886
+1477,556,1892
+1477,556,1896
+1477,556,1901
+1477,556,1906
+1477,556,1910
+1477,556,1915
+1477,556,1920
+1477,556,1925
+1477,556,1930
+1477,556,1934
+1477,556,1939
+1477,556,1943
+1477,556,1948
+1477,556,1953
+1477,556,1957
+1477,556,1961
+1475,556,1966
+1475,556,1972
+1475,556,1977
+1473,561,1982
+1473,561,1987
+1468,581,1992
+1468,581,1997
+1462,617,2002
+1462,617,2007
+1462,617,2012
+1457,665,2017
+1457,665,2022
+1456,737,2027
+1456,737,2033
+1456,824,2038
+1456,824,2043
+1456,824,2048
+1456,901,2053
+1456,901,2058
+1456,965,2063
+1456,965,2069
+1456,998,2074
+1456,998,2080
+1463,1015,2086
+1463,1015,2092
+1463,1015,2097
+1467,1020,2102
+1467,1020,2108
+1467,1021,2113
+1467,1021,2119
+1467,1022,2123
+1467,1022,2128
+1467,1022,2133
+1467,1022,2139
+1467,1022,2145
+1467,1022,2151
+1467,1022,2156
+1467,1022,2161
+1467,1022,2167
+1467,1022,2172
+1467,1022,2177
+1467,1022,2182
+1467,1022,2186
+1467,1022,2191
+1467,1022,2196
+1467,1022,2202
+1466,1022,2207
+1466,1022,2212
+1460,1022,2217
+1460,1022,2223
+1447,1022,2229
+1447,1022,2234
+1423,1022,2240
+1423,1022,2246
+1423,1022,2251
+1392,1018,2256
+1392,1018,2261
+1354,1011,2265
+1354,1011,2270
+1354,1011,2274
+1306,995,2279
+1306,995,2284
+1260,973,2289
+1260,973,2293
+1260,973,2298
+1209,943,2303
+1209,943,2307
+1209,943,2312
+1152,907,2317
+1152,907,2322
+1090,862,2327
+1090,862,2332
+1030,801,2338
+1030,801,2343
+984,744,2349
+984,744,2355
+947,695,2361
+947,695,2367
+947,695,2371
+920,672,2375
+920,672,2380
+901,664,2385
+901,664,2389
+901,664,2392
+901,664,2396
+893,664,2400
+893,664,2405
+890,664,2410
+890,664,2415
+890,664,2419
+889,664,2424
+889,664,2430
+889,664,2435
+889,664,2441
+889,664,2446
+889,664,2451
+889,664,2456
+889,664,2462
+889,664,2466
+889,664,2472
+889,664,2478
+889,664,2483
+889,664,2489
+889,664,2495
+889,664,2501
+889,664,2507
+889,664,2512
+889,664,2517
+889,664,2522
+889,664,2527
+889,664,2533
+889,664,2538
+889,664,2543
+889,664,2548
+889,664,2554
+889,664,2559
+889,664,2564
+889,664,2569
+889,664,2574
+889,664,2578
+889,664,2583
+889,664,2587
+889,664,2592
+889,664,2596
+885,663,2602
+885,663,2607
+874,653,2612
+874,653,2618
+874,653,2623
+852,630,2629
+852,630,2633
+816,588,2638
+816,588,2642
+816,588,2646
+769,532,2650
+769,532,2655
+769,532,2659
+725,465,2664
+725,465,2670
+725,465,2674
+692,395,2678
+692,395,2683
+665,331,2688
+665,331,2693
+640,288,2697
+640,288,2701
+640,288,2706
+620,262,2710
+620,262,2714
+620,262,2718
+607,247,2723
+607,247,2728
+607,247,2731
+601,242,2736
+601,242,2740
+601,242,2744
+599,241,2749
+599,241,2754
+598,241,2759
+598,241,2764
+598,241,2769
+598,241,2774
+598,241,2779
+598,241,2784
+598,241,2790
+598,241,2795
+598,241,2800
+598,241,2806
+598,241,2812
+598,241,2817
+598,241,2822
+598,241,2827
+598,241,2833
+598,241,2838
+598,241,2844
+598,241,2848
+598,241,2854
+598,241,2859
+598,241,2864
+598,241,2869
+598,241,2875
+598,241,2882
+598,241,2888
+598,241,2894
+598,241,2899
+598,241,2904
+598,241,2910
+598,241,2916
+598,241,2920
+598,241,2924
+598,241,2928
+598,241,2932
+598,241,2937
+598,241,2942
+598,241,2946
+598,241,2951
+598,241,2956
+598,241,2961
+598,241,2967
+598,241,2972
+598,241,2977
+598,241,2982
+598,246,2986
+598,246,2991
+598,271,2996
+598,271,3002
+598,271,3006
+598,329,3011
+598,329,3016
+598,412,3022
+598,412,3027
+598,412,3031
+598,507,3035
+598,507,3040
+598,594,3045
+598,594,3050
+598,594,3055
+598,667,3061
+598,667,3066
+602,717,3071
+602,717,3076
+605,753,3082
+605,753,3088
+606,789,3093
+606,789,3099
+607,814,3104
+607,814,3110
+607,823,3115
+607,823,3122
+608,825,3128
+608,825,3134
+608,825,3139
+608,825,3144
+608,825,3149
+608,825,3153
+608,825,3157
+608,825,3162
+608,825,3166
+608,825,3171
+608,825,3176
+608,825,3181
+608,825,3186
+608,825,3192
+608,825,3196
+608,825,3201
+608,825,3206
+608,825,3211
+608,825,3215
+608,825,3220
+608,825,3224
+608,825,3229
+608,825,3234
+608,825,3239
+608,825,3244
+608,825,3248
+608,825,3254
+608,825,3259
+608,825,3264
+608,825,3268
+608,825,3273
+608,825,3279
+608,825,3284
+608,825,3289
+608,825,3294
+608,825,3300
+608,825,3305
+603,829,3310
+603,829,3315
+588,850,3321
+588,850,3325
+588,850,3329
+553,888,3333
+553,888,3339
+553,888,3343
+518,940,3348
+518,940,3352
+492,978,3357
+492,978,3361
+492,978,3366
+481,1000,3371
+481,1000,3374
+481,1000,3379
+474,1015,3384
+474,1015,3389
+471,1020,3394
+471,1020,3400
+471,1022,3405
+471,1022,3409
+471,1022,3414
+471,1022,3418
+471,1022,3423
+471,1022,3428
+471,1022,3434
+471,1022,3439
+471,1022,3445
+471,1022,3450
+471,1022,3455
+471,1022,3460
+471,1019,3466
+471,1019,3471
+471,1000,3476
+471,1000,3481
+471,1000,3486
+485,947,3492
+485,947,3498
+514,883,3504
+514,883,3510
+559,798,3514
+559,798,3519
+559,798,3523
+609,702,3528
+609,702,3533
+660,616,3539
+660,616,3545
+708,541,3550
+708,541,3555
+746,495,3561
+746,495,3567
+777,456,3571
+777,456,3576
\ No newline at end of file