@Test
	public void rendersTableByType() {
		Table modules = new ModuleList(newArrayList(
				resource("jms", "source", false),
				resource("aggregator", "processor", false),
				resource("avro", "sink", false),
				resource("myfile", "source", true)
		)).renderByType();

		Map<Integer, String> header = headerNames(modules.getHeaders());
		assertThat(header.size(), equalTo(4));
		assertThat(header, allOf(
				hasEntry(1, "    Source"),
				hasEntry(2, "    Processor"),
				hasEntry(3, "    Sink"),
				hasEntry(4, "    Job")
		));

		List<TableRow> rows = modules.getRows();
		assertThat(rows, hasSize(2));

		Iterator<TableRow> iterator = rows.iterator();
		TableRow firstRow = iterator.next();
		assertThat(firstRow.getValue(1), equalTo("    jms"));
		assertThat(firstRow.getValue(2), equalTo("    aggregator"));
		assertThat(firstRow.getValue(3), equalTo("    avro"));

		TableRow secondRow = iterator.next();
		assertThat(secondRow.getValue(1), equalTo("(c) myfile"));
		assertThat(secondRow.getValue(2), equalTo(""));
		assertThat(secondRow.getValue(3), equalTo(""));
	}
Tests for ModuleList.

@author Florent Biville
spring-xd-shell/src/test/java/org/springframework/xd/shell/command/ModuleListTests.java