use of ch.cyberduck.core.local.LaunchServicesApplicationFinder in project cyberduck by iterate-ch.
the class SharedFileListApplicationLoginRegistryTest method testRegister.
@Test
@Ignore
public void testRegister() {
final SharedFileListApplicationLoginRegistry registry = new SharedFileListApplicationLoginRegistry(new LaunchServicesApplicationFinder());
final Application application = new Application("ch.sudo.cyberduck");
assertTrue(registry.register(application));
assertTrue(new FinderSidebarService(SidebarService.List.login).contains(new FinderLocal(NSWorkspace.sharedWorkspace().absolutePathForAppBundleWithIdentifier(application.getIdentifier()))));
assertTrue(registry.unregister(application));
}
use of ch.cyberduck.core.local.LaunchServicesApplicationFinder in project cyberduck by iterate-ch.
the class LaunchServicesSchemeHandlerTest method testSetDefaultHandlerForURLScheme.
@Test
public void testSetDefaultHandlerForURLScheme() {
final SchemeHandler l = new LaunchServicesSchemeHandler(new LaunchServicesApplicationFinder());
l.setDefaultHandler(new Application("none.app", null), Collections.singletonList(Scheme.ftp.name()));
assertEquals(new Application("com.apple.finder"), l.getDefaultHandler(Scheme.ftp.name()));
assertFalse(l.isDefaultHandler(Collections.singletonList(Scheme.ftp.name()), new Application("other.app", null)));
l.setDefaultHandler(new Application("ch.sudo.cyberduck", null), Collections.singletonList(Scheme.ftp.name()));
assertEquals("ch.sudo.cyberduck", l.getDefaultHandler(Scheme.ftp.name()).getIdentifier());
assertTrue(l.getAllHandlers(Scheme.ftp.name()).contains(new Application("ch.sudo.cyberduck")));
assertNotSame("ch.sudo.cyberduck", l.getDefaultHandler(Scheme.http.name()).getIdentifier());
assertTrue(l.isDefaultHandler(Collections.singletonList(Scheme.ftp.name()), new Application("ch.sudo.cyberduck", null)));
}
Aggregations