11package jsymbolic2 .scenario ;
22
33import ace .datatypes .DataBoard ;
4+ import ace .datatypes .DataSet ;
45import jsymbolic2 .Main ;
56import org .junit .jupiter .api .Test ;
67
78import java .io .File ;
89import java .util .Arrays ;
910
11+ import static org .junit .jupiter .api .Assertions .assertArrayEquals ;
12+ import static org .junit .jupiter .api .Assertions .assertEquals ;
1013import static org .junit .jupiter .api .Assertions .assertTrue ;
1114
1215public class ConfigRunTest {
@@ -25,8 +28,10 @@ public void testAllFeaturesConfigRun() throws Exception {
2528 prefix + "all_features_definitions_actual.xml" ,
2629 new String []{prefix + "all_features_values_actual.xml" }, null );
2730 for (int i = 0 ; i < dataBoardExpected .feature_vectors .length ; i ++) {
28- assertTrue (Arrays .deepEquals (dataBoardExpected .feature_vectors [i ].feature_values , dataBoardActual .feature_vectors [i ].feature_values ),
29- "Rows are not equals, expected: " + Arrays .deepToString (dataBoardExpected .feature_vectors [i ].feature_values ) + " but actual: " + Arrays .deepToString (dataBoardActual .feature_vectors [i ].feature_values ));
31+ for (int j = 0 ; j < dataBoardExpected .feature_vectors [i ].feature_values .length ; j ++) {
32+ assertArrayEquals (dataBoardExpected .feature_vectors [i ].feature_values [j ], dataBoardActual .feature_vectors [i ].feature_values [j ], 0.001 ,
33+ dataBoardExpected .feature_vectors [i ].feature_names [j ] + " feature is not the same." );
34+ }
3035 }
3136 }
3237
@@ -40,7 +45,13 @@ public void testWindowFeaturesConfigRun() throws Exception {
4045 "src/test/java/jsymbolic2/scenario/resources/values/window_definitions_actual.xml" ,
4146 new String []{"src/test/java/jsymbolic2/scenario/resources/values/window_values_actual.xml" }, null );
4247 for (int i = 0 ; i < dataBoardExpected .feature_vectors .length ; i ++) {
43- assertTrue (Arrays .deepEquals (dataBoardExpected .feature_vectors [i ].feature_values , dataBoardActual .feature_vectors [i ].feature_values ));
48+ for (int j = 0 ; j < dataBoardExpected .feature_vectors [i ].sub_sets .length ; j ++) {
49+ for (int k = 0 ; k < dataBoardExpected .feature_vectors [i ].sub_sets [j ].feature_values .length ; k ++) {
50+ assertArrayEquals (dataBoardExpected .feature_vectors [i ].sub_sets [j ].feature_values [k ],
51+ dataBoardExpected .feature_vectors [i ].sub_sets [j ].feature_values [k ], 0.001 ,
52+ dataBoardExpected .feature_vectors [i ].sub_sets [j ].feature_names [k ] + " feature is not the same." );
53+ }
54+ }
4455 }
4556 }
4657
@@ -54,7 +65,10 @@ public void testOverallFeaturesConfigRun() throws Exception {
5465 "src/test/java/jsymbolic2/scenario/resources/values/overall_definitions_actual.xml" ,
5566 new String []{"src/test/java/jsymbolic2/scenario/resources/values/overall_values_actual.xml" }, null );
5667 for (int i = 0 ; i < dataBoardExpected .feature_vectors .length ; i ++) {
57- assertTrue (Arrays .deepEquals (dataBoardExpected .feature_vectors [i ].feature_values , dataBoardActual .feature_vectors [i ].feature_values ));
68+ for (int j = 0 ; j < dataBoardExpected .feature_vectors [i ].feature_values .length ; j ++) {
69+ assertArrayEquals (dataBoardExpected .feature_vectors [i ].feature_values [j ], dataBoardActual .feature_vectors [i ].feature_values [j ], 0.001 ,
70+ dataBoardExpected .feature_vectors [i ].feature_names [j ] + " feature is not the same." );
71+ }
5872 }
5973 }
6074}
0 commit comments