Package org.apache.hadoop.gateway.ha.provider

Examples of org.apache.hadoop.gateway.ha.provider.HaProvider


    ctx = EasyMock.createNiceMock( UrlRewriteContext.class );
    EasyMock.expect( ctx.getDirection() ).andReturn( UrlRewriter.Direction.IN ).anyTimes();

    desc = EasyMock.createNiceMock( ServiceUrlFunctionDescriptor.class );

     HaProvider haProvider = EasyMock.createNiceMock( HaProvider.class );

     EasyMock.expect(env.getAttribute(HaServletContextListener.PROVIDER_ATTRIBUTE_NAME)).andReturn(haProvider).anyTimes();

     EasyMock.expect(haProvider.isHaEnabled(EasyMock.anyObject(String.class))).andReturn(Boolean.FALSE).anyTimes();

    EasyMock.replay( hm, hms, reg, svc, env, desc, ctx, haProvider);
  }
View Full Code Here


    EasyMock.expect( ctx.getDirection() ).andReturn( UrlRewriter.Direction.IN ).anyTimes();

    desc = EasyMock.createNiceMock( ServiceMappedUrlFunctionDescriptor.class );


     HaProvider haProvider = EasyMock.createNiceMock( HaProvider.class );

     EasyMock.expect(env.getAttribute(HaServletContextListener.PROVIDER_ATTRIBUTE_NAME)).andReturn(haProvider).anyTimes();

     EasyMock.expect(haProvider.isHaEnabled(EasyMock.anyObject(String.class))).andReturn(Boolean.FALSE).anyTimes();

     EasyMock.replay( hm, hms, reg, svc, env, desc, ctx, haProvider );
  }
View Full Code Here

         new DefaultHaProvider(null);
         fail("provider construction should have failed with null descriptor");
      } catch (IllegalArgumentException e) {
      }
      HaDescriptor descriptor = new DefaultHaDescriptor();
      HaProvider provider = new DefaultHaProvider(descriptor);
      assertNotNull(provider.getHaDescriptor());
      descriptor.addServiceConfig(new DefaultHaServiceConfig("foo"));
      assertTrue(provider.isHaEnabled("foo"));
   }
View Full Code Here

   }

   @Test
   public void testAddingService() {
      HaDescriptor descriptor = new DefaultHaDescriptor();
      HaProvider provider = new DefaultHaProvider(descriptor);
      ArrayList<String> urls = new ArrayList<String>();
      urls.add("http://host1");
      urls.add("http://host2");
      provider.addHaService("foo", urls);
      assertNull(provider.getActiveURL("bar"));
      String url = provider.getActiveURL("foo");
      assertNotNull(url);
      assertThat(url, isIn(urls));
   }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.gateway.ha.provider.HaProvider

Copyright © 2018 www.massapicom. 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.