Package com.google.feedserver.config

Examples of com.google.feedserver.config.MixinConfiguration


*
*/
public class WrapperConfigurationTest extends TestCase {

  public void testCorrectWrapperConfig() {
    MixinConfiguration config = new XmlMixinConfiguration(TestUtil.WRAPPER_ADAPTER1_CONFIG);
    assertEquals(TestUtil.TEST_ADAPTER_WITH_NO_WRAPPER, config.getTargetAdapterName());
    assertEquals(TestUtil.TEST_WRAPPER3_CONFIG, config.getWrapperConfig());
    assertEquals(null, config.getWrapperName());

    config = new MapMixinConfiguration(getWrapper());
    assertEquals(TestUtil.WRAPPER_CLASS_NAME, config.getWrapperName());
    assertEquals(TestUtil.TEST_WRAPPER3_CONFIG, config.getWrapperConfig());
    assertEquals(null, config.getTargetAdapterName());
  }
View Full Code Here


    assertEquals(null, config.getTargetAdapterName());
  }

  public void testIncorrectWrapperConfig() {
    try {
      MixinConfiguration config =
          new XmlMixinConfiguration(TestUtil.XML_PROLOG + "<asdf>asdf</asdf>");
      fail();
    } catch (UnsupportedOperationException ex) {
      // expected.
    }
View Full Code Here

    }
  }

  protected void configureWrapperAdapter() throws FeedServerAdapterException {
    String configData = getWrapperAdapterConfiguration();
    MixinConfiguration config = getMixinConfiguration(configData);
    AbstractManagedCollectionAdapter adapter = createTargetAdapter(config);
    ManagedCollectionAdapterWrapper wrapper = (ManagedCollectionAdapterWrapper) targetAdapter;
    wrapper.setTargetAdapter(adapter);
    wrapper.setWrapperConfig(config.getWrapperConfig());
  }
View Full Code Here

    globalServerConfig.setWrapperManagerClassName(XmlWrapperManager.class.getName());
    serverConfig = new PerNamespaceServerConfiguration(globalServerConfig, DOMAIN_NAME);
    adapterConfigWithNoWrappers =
        new NamespacedAdapterConfiguration(adapterConfigWithNoWrappersMap, serverConfig);

    MixinConfiguration mc1 = new MapMixinConfiguration(TEST_WRAPPER1);
    mc1.setWrapperName(WRAPPER_CLASS);
    MixinConfiguration mc2 = new MapMixinConfiguration(TEST_WRAPPER2);
    mc2.setWrapperName(WRAPPER_CLASS);
    MixinConfiguration mc3 = new MapMixinConfiguration(TEST_WRAPPER3);
    mc3.setWrapperName(WRAPPER_CLASS);
    MixinConfiguration[] mixinConfigs = new MixinConfiguration[] {mc1, mc2, mc3};

    Map<String, Object> tmp = new HashMap<String, Object>(adapterConfigWithWrappersEntry);
    tmp.put(FeedServerConfiguration.MIXINS, mixinConfigs);
    adapterConfigWithWrappers = new NamespacedAdapterConfiguration(tmp, serverConfig);
View Full Code Here

TOP

Related Classes of com.google.feedserver.config.MixinConfiguration

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.