Examples of Hooks


Examples of com.jcabi.github.Hooks

     * MkHooks can fetch empty list of hooks.
     * @throws Exception if some problem inside
     */
    @Test
    public void canFetchEmptyListOfHooks() throws Exception {
        final Hooks hooks = MkHooksTest.repo().hooks();
        MatcherAssert.assertThat(
            hooks.iterate(),
            Matchers.emptyIterable()
        );
    }
View Full Code Here

Examples of com.jcabi.github.Hooks

     *
     * @throws Exception if something goes wrong.
     */
    @Test
    public void canDeleteSingleHook() throws Exception {
        final Hooks hooks = MkHooksTest.repo().hooks();
        final Hook hook = hooks.create(
            // @checkstyle MultipleStringLiterals (1 line)
            "geocommit", Collections.<String, String>emptyMap()
        );
        MatcherAssert.assertThat(
            hooks.iterate(),
            Matchers.<Hook>iterableWithSize(1)
        );
        hooks.remove(hook.number());
        MatcherAssert.assertThat(
            hooks.iterate(),
            Matchers.emptyIterable()
        );
    }
View Full Code Here

Examples of com.jcabi.github.Hooks

     * MkHooks can fetch single hook.
     * @throws Exception if some problem inside
     */
    @Test
    public void canFetchSingleHook() throws Exception {
        final Hooks hooks = MkHooksTest.repo().hooks();
        final Hook hook = hooks.create(
            // @checkstyle MultipleStringLiterals (1 line)
            "geocommit", Collections.<String, String>emptyMap()
        );
        MatcherAssert.assertThat(
            hooks.get(hook.number()),
            Matchers.notNullValue()
        );
    }
View Full Code Here

Examples of com.jcabi.github.Hooks

     * MkHooks can fetch non empty list of hooks.
     * @throws Exception If some problem inside
     */
    @Test
    public void canFetchNonEmptyListOfHooks() throws Exception {
        final Hooks hooks = MkHooksTest.repo().hooks();
        hooks.create(
            // @checkstyle MultipleStringLiterals (1 line)
            "geocommit", Collections.<String, String>emptyMap()
        );
        hooks.create(
            "web", Collections.<String, String>emptyMap()
        );
        MatcherAssert.assertThat(
            hooks.iterate(),
            Matchers.<Hook>iterableWithSize(2)
        );
    }
View Full Code Here

Examples of com.jcabi.github.Hooks

     * MkHooks can create a hook.
     * @throws Exception If some problem inside
     */
    @Test
    public void canCreateHook() throws Exception {
        final Hooks hooks = MkHooksTest.repo().hooks();
        final Hook hook = hooks.create(
            "geocommit", Collections.<String, String>emptyMap()
        );
        MatcherAssert.assertThat(
            hooks.iterate().iterator().next().number(),
            Matchers.equalTo(hook.number())
        );
    }
View Full Code Here

Examples of org.apache.tomcat.util.hooks.Hooks

      return hooksCache[type];
  }

  // load the cache with all the hooks
  Container globalIntContainer=getContextManager().getContainer();
  Hooks globals=globalIntContainer.getHooks();

  hooksCache=new BaseInterceptor[H_COUNT][];
  for( int i=0; i<H_COUNT; i++ ) {
      Hooks locals=null;
      if( this != globalIntContainer ) {
    hooksCache[i]=mergeHooks( globals.getModules(i),
            getHooks().getModules(i));
      } else {
    hooksCache[i]=mergeHooks( globals.getModules(i), null);
View Full Code Here

Examples of org.apache.tomcat.util.hooks.Hooks

      return allHooksCache;
  }

  // load the cache with all the hooks
  Container globalIntContainer=getContextManager().getContainer();
  Hooks globals=globalIntContainer.getHooks();
  if( this == globalIntContainer ) {
      allHooksCache=mergeHooks( globals.getModules(), null );
  } else {
      allHooksCache=mergeHooks( globals.getModules(),
              this.getHooks().getModules());
  }
  return allHooksCache;
    }
View Full Code Here

Examples of org.apache.tomcat.util.hooks.Hooks

    public BaseInterceptor[] getInterceptors( int type )
    {
  if( hooksCache != null ) {
      if( hooksCache[type] == null ) {
    Container gContainer = getContextManager().getContainer();
    Hooks gHooks = gContainer.getHooks();
    if( this != gContainer ) {
        hooksCache[type] = mergeHooks(gHooks.getModules(type),
              getHooks().getModules(type));
    } else {
        hooksCache[type] = mergeHooks(gHooks.getModules(type), null);
    }
      }
      return hooksCache[type];
  }

  // load the cache with all the hooks
  Container globalIntContainer=getContextManager().getContainer();
  Hooks globals=globalIntContainer.getHooks();

  hooksCache=new BaseInterceptor[H_COUNT][];
  for( int i=0; i<H_COUNT; i++ ) {
      Hooks locals=null;
      if( this != globalIntContainer ) {
    hooksCache[i]=mergeHooks( globals.getModules(i),
            getHooks().getModules(i));
      } else {
    hooksCache[i]=mergeHooks( globals.getModules(i), null);
View Full Code Here

Examples of org.apache.tomcat.util.hooks.Hooks

      return allHooksCache;
  }

  // load the cache with all the hooks
  Container globalIntContainer=getContextManager().getContainer();
  Hooks globals=globalIntContainer.getHooks();
  if( this == globalIntContainer ) {
      allHooksCache=mergeHooks( globals.getModules(), null );
  } else {
      allHooksCache=mergeHooks( globals.getModules(),
              this.getHooks().getModules());
  }
  return allHooksCache;
    }
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.