use of com.eden.orchid.api.server.OrchidServer in project Orchid by JavaEden.
the class OptionsServiceImpl method addView.
private void addView(Map<String, Object> siteData, OrchidView view) {
siteData.put("view", view);
siteData.put("controller", view.getController());
siteData.put("params", view.getParams());
OrchidServer server = context.resolve(OrchidServer.class);
siteData.put("httpServerPort", server.getHttpServerPort());
siteData.put("websocketPort", server.getWebsocketPort());
siteData.put("optionsExtractor", context.resolve(OptionsExtractor.class));
addPage(siteData, view);
}
use of com.eden.orchid.api.server.OrchidServer in project Orchid by JavaEden.
the class TaskServiceTest method setUp.
@BeforeEach
public void setUp() {
Set<OrchidTask> tasks = new HashSet<>();
OrchidTask task1 = mock(OrchidTask.class);
when(task1.getName()).thenReturn("task1");
tasks.add(task1);
OrchidTask task2 = mock(OrchidTask.class);
when(task2.getName()).thenReturn("task2");
tasks.add(task2);
Set<OrchidCommand> commands = new HashSet<>();
OrchidFileController controller = mock(OrchidFileController.class);
OrchidServer server = new OrchidServer(new HashSet<>(), controller);
FileWatcher fileWatcher = mock(FileWatcher.class);
// test the service directly
context = mock(OrchidContext.class);
service = new TaskServiceImpl(tasks, commands, "", 8080, server, fileWatcher);
service.initialize(context);
// test that the default implementation is identical to the real implementation
underTest = new TaskService() {
public void initialize(OrchidContext context) {
}
public <T extends OrchidService> T getService(Class<T> serviceClass) {
return (T) service;
}
};
}
Aggregations