Examples of Core


Examples of net.pterodactylus.sone.core.Core

    lockSoneCommand.execute(fields, null, null);
  }

  @Test(expected = FcpException.class)
  public void testMissingSone() throws FcpException {
    Core core = mock(Core.class);
    SimpleFieldSet fields = new SimpleFieldSetBuilder().get();

    LockSoneCommand lockSoneCommand = new LockSoneCommand(core);
    lockSoneCommand.execute(fields, null, null);
  }
View Full Code Here

Examples of net.pterodactylus.sone.core.Core

  @Test
  public void testUnlockingALocalSone() throws FcpException {
    Sone localSone = mock(Sone.class);
    when(localSone.getId()).thenReturn("LocalSone");
    when(localSone.isLocal()).thenReturn(true);
    Core core = mock(Core.class);
    when(core.getSone(eq("LocalSone"))).thenReturn(Optional.of(localSone));
    when(core.getLocalSone(eq("LocalSone"), anyBoolean())).thenReturn(localSone);
    SimpleFieldSet fields = new SimpleFieldSetBuilder().put("Sone", "LocalSone").get();

    UnlockSoneCommand unlockSoneCommand = new UnlockSoneCommand(core);
    Response response = unlockSoneCommand.execute(fields, null, null);
View Full Code Here

Examples of net.pterodactylus.sone.core.Core

  }

  @Test(expected = FcpException.class)
  public void testUnlockingARemoteSone() throws FcpException {
    Sone removeSone = mock(Sone.class);
    Core core = mock(Core.class);
    when(core.getSone(eq("RemoteSone"))).thenReturn(Optional.of(removeSone));
    SimpleFieldSet fields = new SimpleFieldSetBuilder().put("Sone", "RemoteSone").get();

    UnlockSoneCommand unlockSoneCommand = new UnlockSoneCommand(core);
    unlockSoneCommand.execute(fields, null, null);
  }
View Full Code Here

Examples of net.pterodactylus.sone.core.Core

    unlockSoneCommand.execute(fields, null, null);
  }

  @Test(expected = FcpException.class)
  public void testMissingSone() throws FcpException {
    Core core = mock(Core.class);
    SimpleFieldSet fields = new SimpleFieldSetBuilder().get();

    UnlockSoneCommand unlockSoneCommand = new UnlockSoneCommand(core);
    unlockSoneCommand.execute(fields, null, null);
  }
View Full Code Here

Examples of net.pterodactylus.sone.core.Core

public class BookmarkAjaxPageTest {

  @Test
  public void testBookmarkingExistingPost() throws URISyntaxException {
    /* create mocks. */
    Core core = mock(Core.class);
    WebInterface webInterface = mock(WebInterface.class);
    when(webInterface.getCore()).thenReturn(core);
    HTTPRequest httpRequest = new HTTPRequestImpl(new URI("/ajax/bookmark.ajax?post=abc"), "GET");
    FreenetRequest request = mock(FreenetRequest.class);
    when(request.getHttpRequest()).thenReturn(httpRequest);
View Full Code Here

Examples of org.eclipse.e4.xwt.internal.core.Core

    initialize();
  }

  public Object createUIProfile() {
    Core core = new Core(new ResourceLoaderFactory(), this);
    cores.push(core);
    return core;
  }
View Full Code Here

Examples of org.eclipse.e4.xwt.internal.core.Core

   * @param nsmapace
   * @return
   */
  public INamespaceHandler getNamespaceHandler(String nsmapace) {
    for (int i = cores.size() - 1; i >= 0; i--) {
      Core core = cores.get(i);
      INamespaceHandler handler = core.getNamespaceHandler(nsmapace);
      if (handler != null) {
        return handler;
      }
    }
    return null;
View Full Code Here

Examples of org.eclipse.e4.xwt.internal.core.Core

   *
   * @see org.eclipse.e4.xwt.IXWTLoader#getMetaclass(java.lang.Object)
   */
  public IMetaclass getMetaclass(Object object) {
    for (int i = cores.size() - 1; i >= 0; i--) {
      Core core = cores.get(i);
      IMetaclass metaclass = core.findMetaclass(object);
      if (metaclass != null) {
        return metaclass;
      }
    }
    Class<?> javaClass = null;
View Full Code Here

Examples of org.eclipse.e4.xwt.internal.core.Core

   * @see org.eclipse.e4.xwt.IXWTLoader#getAllMetaclasses()
   */
  public IMetaclass[] getAllMetaclasses() {
    Collection<IMetaclass> collector = new ArrayList<IMetaclass>();
    for (int i = cores.size() - 1; i >= 0; i--) {
      Core core = cores.get(i);
      Collection<IMetaclass> metaclasses = core
          .getAllMetaclasses(IConstants.XWT_NAMESPACE);
      collector.addAll(metaclasses);
    }
    return collector.toArray(new IMetaclass[collector.size()]);
  }
View Full Code Here

Examples of org.eclipse.e4.xwt.internal.core.Core

   * @see org.eclipse.e4.xwt.IXWTLoader#getMetaclass(java.lang.String,
   * java.lang.String)
   */
  public IMetaclass getMetaclass(String tagName, String ns) {
    for (int i = cores.size() - 1; i >= 0; i--) {
      Core core = cores.get(i);
      IMetaclass metaclass = core.getMetaclass(getLoadingContext(),
          tagName, ns);
      if (metaclass != null) {
        return metaclass;
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.