@@ -83,20 +83,33 @@ private double[] array( double... values )
8383 }
8484
8585 @ Test
86- public void testRenameCellsAsExternIntern () {
86+ public void testRenameCellsAsExternIntern ()
87+ {
8788 ModelGraph graph = new ModelGraph ();
88- Spot a = addSpot (graph , "a" , array (2 , 2 , 2 ));
89- Spot a1 = addSpotAsDescendantOf (graph , "2" , a , array (1 , 2 , 2 )); // extern
90- Spot a2 = addSpotAsDescendantOf (graph , "1" , a , array (3 , 2 , 2 )); // intern
91- Spot center = addSpot (graph , "center" , array (4 , 2 , 2 ));
92- Spot b = addSpot (graph , "b" , array (6 , 2 , 2 ));
93- Spot b2 = addSpotAsDescendantOf (graph , "4" , b , array (5 , 2 , 2 )); // intern
94- Spot b1 = addSpotAsDescendantOf (graph , "3" , b , array (7 , 2 , 2 )); // extern
95- LabelSpotsSystematically .setLabelsBasedOnExternIntern ( graph , Collections .singleton ( center ), graph .vertices (), true , false );
96- assertEquals ("a1" , a1 .getLabel ());
97- assertEquals ("a2" , a2 .getLabel ());
98- assertEquals ("b1" , b1 .getLabel ());
99- assertEquals ("b2" , b2 .getLabel ());
89+ Spot a = addSpot ( graph , "a" , array ( 2 , 2 , 2 ) );
90+ Spot a1 = addSpotAsDescendantOf ( graph , "2" , a , array ( 1 , 2 , 2 ) ); // extern
91+ Spot a2 = addSpotAsDescendantOf ( graph , "1" , a , array ( 3 , 2 , 2 ) ); // intern
92+ Spot center = addSpot ( graph , "center" , array ( 4 , 2 , 2 ) );
93+ Spot b = addSpot ( graph , "b" , array ( 6 , 2 , 2 ) );
94+ Spot b2 = addSpotAsDescendantOf ( graph , "4" , b , array ( 5 , 2 , 2 ) ); // intern
95+ Spot b1 = addSpotAsDescendantOf ( graph , "3" , b , array ( 7 , 2 , 2 ) ); // extern
96+ Spot c = addSpot ( graph , "c" , array ( 8 , 2 , 2 ) );
97+ Spot c2 = addSpotAsDescendantOf ( graph , "5" , c , array ( 9 , 2 , 2 ) ); // intern
98+ Spot c1 = addSpotAsDescendantOf ( graph , "6" , c , array ( 10 , 2 , 2 ) ); // extern
99+ Spot c12 = addSpotAsDescendantOf ( graph , "7" , c1 , array ( 11 , 2 , 2 ) ); // intern
100+ Spot c11 = addSpotAsDescendantOf ( graph , "8" , c1 , array ( 12 , 2 , 2 ) ); // extern
101+ Spot c21 = addSpotAsDescendantOf ( graph , "9" , c2 , array ( 13 , 2 , 2 ) );
102+ graph .addEdge ( c2 , c2 ).init (); // deliberately create a cycle to test the robustness of the algorithm
103+ LabelSpotsSystematically .setLabelsBasedOnExternIntern ( graph , Collections .singleton ( center ), graph .vertices (), true , false );
104+ assertEquals ( "a1" , a1 .getLabel () );
105+ assertEquals ( "a2" , a2 .getLabel () );
106+ assertEquals ( "b1" , b1 .getLabel () );
107+ assertEquals ( "b2" , b2 .getLabel () );
108+ assertEquals ( "c1" , c1 .getLabel () );
109+ assertEquals ( "c2" , c2 .getLabel () );
110+ assertEquals ( "c11" , c11 .getLabel () );
111+ assertEquals ( "c12" , c12 .getLabel () );
112+ assertEquals ( "c21" , c21 .getLabel () );
100113 }
101114
102115 // Handling:
0 commit comments