Package org.springframework.xd.module

Examples of org.springframework.xd.module.ModuleDescriptor$Key


  @Test
  public void testJobWithParams() {
    List<ModuleDescriptor> requests = parser.parse("myJob", "job --foo=bar", job);
    assertEquals(1, requests.size());
    ModuleDescriptor job = requests.get(0);
    assertEquals("job", job.getModuleName());
    assertEquals("myJob", job.getGroup());
    assertEquals(0, job.getIndex());
    assertEquals(ModuleType.job, job.getType());
    assertEquals(1, job.getParameters().size());
    assertEquals("bar", job.getParameters().get("foo"));
  }
View Full Code Here


  @Test
  public void simpleStream() {
    List<ModuleDescriptor> requests = parser.parse("test", "foo | bar", stream);
    assertEquals(2, requests.size());
    ModuleDescriptor sink = requests.get(0);
    ModuleDescriptor source = requests.get(1);
    assertEquals("foo", source.getModuleName());
    assertEquals("test", source.getGroup());
    assertEquals(0, source.getIndex());
    assertEquals(ModuleType.source, source.getType());
    assertEquals(0, source.getParameters().size());
    assertEquals("bar", sink.getModuleName());
    assertEquals("test", sink.getGroup());
    assertEquals(1, sink.getIndex());
    assertEquals(ModuleType.sink, sink.getType());
    assertEquals(0, sink.getParameters().size());
View Full Code Here

  public void quotesInParams() {
    List<ModuleDescriptor> requests = parser.parse("test", "foo --bar='payload.matches(''hello'')' | file",
        stream);
    assertEquals(2, requests.size());
    // ModuleDescriptor sink = requests.get(0);
    ModuleDescriptor source = requests.get(1);
    assertEquals("foo", source.getModuleName());
    assertEquals("test", source.getGroup());
    assertEquals(0, source.getIndex());
    assertEquals(ModuleType.source, source.getType());
    Map<String, String> sourceParameters = source.getParameters();
    assertEquals(1, sourceParameters.size());
    assertEquals("payload.matches('hello')", sourceParameters.get("bar"));
  }
View Full Code Here

  @Test
  public void quotesInParams2() {
    List<ModuleDescriptor> requests = parser.parse("test",
        "http --port=9700 | filter --expression=payload.matches('hello world') | file", stream);
    assertEquals(3, requests.size());
    ModuleDescriptor filter = requests.get(1);
    assertEquals("filter", filter.getModuleName());
    assertEquals("test", filter.getGroup());
    assertEquals(1, filter.getIndex());
    assertEquals(ModuleType.processor, filter.getType());
    Map<String, String> sourceParameters = filter.getParameters();
    assertEquals(1, sourceParameters.size());
    assertEquals("payload.matches('hello world')", sourceParameters.get("expression"));
  }
View Full Code Here

  @Test
  public void parameterizedModules() {
    List<ModuleDescriptor> requests = parser.parse("test", "foo --x=1 --y=two | bar --z=3", stream);
    assertEquals(2, requests.size());
    ModuleDescriptor sink = requests.get(0);
    ModuleDescriptor source = requests.get(1);
    assertEquals("foo", source.getModuleName());
    assertEquals("test", source.getGroup());
    assertEquals(0, source.getIndex());
    assertEquals(ModuleType.source, source.getType());
    Map<String, String> sourceParameters = source.getParameters();
    assertEquals(2, sourceParameters.size());
    assertEquals("1", sourceParameters.get("x"));
    assertEquals("two", sourceParameters.get("y"));
    assertEquals("bar", sink.getModuleName());
    assertEquals("test", sink.getGroup());
View Full Code Here

  @Test
  public void createJavaConfiguredModule() {
    ModuleDefinition moduleDefinition = ModuleDefinitions.simple("siDslModule", ModuleType.processor,
        "classpath:/ModuleFactoryTests/modules/processor/siDslModule.jar");
    ModuleDescriptor moduleDescriptor = new ModuleDescriptor.Builder()
        .setModuleDefinition(moduleDefinition)
        .setModuleName("javaConfigModule")
        .setGroup("group")
        .setModuleDefinition(moduleDefinition)
        .setParameter("prefix", "foo")
View Full Code Here

  }

  private void createResourceConfiguredModule(String moduleName, ModuleType moduleType) {
    ModuleDefinition moduleDefinition = ModuleDefinitions.simple(moduleName,moduleType,
        "classpath:/ModuleFactoryTests/modules/" + moduleType + "/" + moduleName + "/");
    ModuleDescriptor moduleDescriptor = new ModuleDescriptor.Builder()
        .setModuleDefinition(moduleDefinition)
        .setModuleName(moduleName)
        .setGroup("group")
        .setModuleDefinition(moduleDefinition)
        .setParameter("bar","hello")
View Full Code Here

TOP

Related Classes of org.springframework.xd.module.ModuleDescriptor$Key

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.