@@ -182,6 +182,57 @@ public void publishMissingReport_allowMissing() throws Exception {
182182 assertNull ("Report should be missing" , report );
183183 }
184184
185+ @ Test
186+ public void testGetIconFileNameSymbolIcon () throws Exception {
187+ // Prepare the environment
188+ writeTestHTML ("index.html" );
189+
190+ // Run the project
191+ HtmlPublisherTarget target = new HtmlPublisherTarget ("testReport" , TEST_REPORT_DIR , "index.html" , true , false , false );
192+ target .setIcon ("symbol-custom-icon" );
193+ setupAndRunProject (target );
194+
195+ // Verify that getIconFileName() correctly returns the custom icon
196+ HtmlPublisherTarget .HTMLAction jobReport = target .new HTMLAction (job , target );
197+ assertNotNull ("Report should exist" , jobReport );
198+ assertEquals ("symbol-custom-icon" , jobReport .getIconFileName ());
199+ }
200+
201+ @ Test
202+ public void testGetIconFileNameCustomPath () throws Exception {
203+ // Prepare the environment
204+ writeTestHTML ("index.html" );
205+ testReportDir .mkdirs ();
206+ File customIconFile = new File (testReportDir , "custom-icon.png" );
207+ customIconFile .createNewFile ();
208+
209+ // Run the project
210+ HtmlPublisherTarget target = new HtmlPublisherTarget ("testReport" , TEST_REPORT_DIR , "index.html" , true , false , false );
211+ target .setIcon ("custom-icon.png" );
212+ setupAndRunProject (target );
213+
214+ // Verify that getIconFileName() correctly returns the specified file
215+ HtmlPublisherTarget .HTMLAction jobReport = target .new HTMLAction (job , target );
216+ assertNotNull ("Report should exist" , jobReport );
217+ assertTrue ("Icon should contain project URL" , jobReport .getIconFileName ().contains ("custom-icon.png" ));
218+ }
219+
220+ @ Test
221+ public void testGetIconFileNameDefaultIfMissingFile () throws Exception {
222+ // Prepare the environment
223+ writeTestHTML ("index.html" );
224+
225+ // Run the project
226+ HtmlPublisherTarget target = new HtmlPublisherTarget ("testReport" , TEST_REPORT_DIR , "index.html" , true , false , false );
227+ target .setIcon ("custom-icon.png" );
228+ setupAndRunProject (target );
229+
230+ // Verify that getIconFileName() correctly returns the default icon
231+ HtmlPublisherTarget .HTMLAction jobReport = target .new HTMLAction (job , target );
232+ assertNotNull ("Report should exist" , jobReport );
233+ assertEquals ("symbol-document-text" , jobReport .getIconFileName ());
234+ }
235+
185236 private void writeTestHTML (String fileName ) throws Exception {
186237 // Prepare the test file
187238 if (!testReportDir .exists () && !testReportDir .mkdirs ()) {
0 commit comments