Files
thomaskippster-comfymodeldo…/src/test/java/de/tki/comfymodels/service/RefreshDiagnosticTest.java
T
Thomas Kippster 3c52a0b520 feat: enhance platform independence and integrate ComfyUI lifecycle management
- Added cross-platform process termination in PlatformUtils.
- Improved PathResolver with robust subfolder normalization.
- Integrated ComfyUI lifecycle service (Start/Stop/Restart) using ProcessHandle.
- Updated ComfyUI Bridge with improved UI refresh and sync logic.
- Added comprehensive integration and diagnostic tests.
- Updated documentation with process control details.
2026-05-14 16:48:43 +02:00

34 lines
1.3 KiB
Java

package de.tki.comfymodels.service;
import de.tki.comfymodels.service.impl.ComfyDiagnosticService;
import de.tki.comfymodels.service.impl.ConfigService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import de.tki.comfymodels.Main.AppConfig;
import static org.junit.jupiter.api.Assertions.*;
/**
* Rapid Diagnostic Test for Refresh Mechanisms.
* This test uses the ComfyDiagnosticService to verify if ComfyUI actually sees
* the models after our refresh calls.
*/
public class RefreshDiagnosticTest {
@Test
public void testModelVisibility() {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
ComfyDiagnosticService diagnosticService = context.getBean(ComfyDiagnosticService.class);
System.out.println("--- ComfyUI Diagnostic Scan ---");
boolean reachable = diagnosticService.isModelAvailableInComfy("non_existent_model_xyz", "checkpoint");
// If the API is up, it should at least return false for a non-existent model
// If it throws an exception or timeout, the API is down.
System.out.println("API Reachable: " + !reachable);
context.close();
}
}