Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ public long getEventMaxSizeBytes() {
}

public String getPluginClasses() {
return get(PLUGIN_CLASSES, "");
return get(PLUGIN_CLASSES, "").replaceAll("\\s+", "");
}

public String getHiveHost() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,38 @@ public TestableConfiguration() {
super(true);
}
}

@Test
public void testPluginClassesWithWhiteSpaceAtBeginning() {
FlumeConfiguration cfg = new TestableConfiguration();
cfg.set(FlumeConfiguration.PLUGIN_CLASSES, " \n a.b.c,d.e.f");

assertEquals("White spaces at the beginning must be stripped", "a.b.c,d.e.f", cfg.getPluginClasses());
}

@Test
public void testPluginClassesWithWhiteSpaceAtEnd() {
FlumeConfiguration cfg = new TestableConfiguration();
cfg.set(FlumeConfiguration.PLUGIN_CLASSES, "a.b.c,d.e.f \n ");

assertEquals("White spaces at the end must be stripped", "a.b.c,d.e.f", cfg.getPluginClasses());
}

@Test
public void testPluginClassesWithWhiteSpaceInTheMiddle() {
FlumeConfiguration cfg = new TestableConfiguration();
cfg.set(FlumeConfiguration.PLUGIN_CLASSES, "a.b.c,\nd.e.f, g.h.i");

assertEquals("White spaces in the middle must be stripped", "a.b.c,d.e.f,g.h.i", cfg.getPluginClasses());
}

@Test
public void testPluginClassesWithWhiteSpace() {
FlumeConfiguration cfg = new TestableConfiguration();
cfg.set(FlumeConfiguration.PLUGIN_CLASSES, " \n a.b.c,\nd.e.f, g.h.i \n ");

assertEquals("White spaces must be stripped", "a.b.c,d.e.f,g.h.i", cfg.getPluginClasses());
}

@Test
public void testParseGossipServers() {
Expand Down