Skip to content

Commit 3f86ece

Browse files
committed
fixup! Update qos profile (osrf#20)
Compatibility with android Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
1 parent 47066e3 commit 3f86ece

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

rcljava/src/test/java/org/ros2/rcljava/qos/QoSProfileTest.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,18 @@ public class QoSProfileTest {
2929
@BeforeClass
3030
public static void setupOnce() throws Exception {
3131
// Just to quiet down warnings
32-
org.apache.log4j.BasicConfigurator.configure();
32+
try
33+
{
34+
// Configure log4j. Doing this dynamically so that Android does not complain about missing
35+
// the log4j JARs, SLF4J uses Android's native logging mechanism instead.
36+
Class c = Class.forName("org.apache.log4j.BasicConfigurator");
37+
Method m = c.getDeclaredMethod("configure", (Class<?>[]) null);
38+
Object o = m.invoke(null, (Object[]) null);
39+
}
40+
catch (Exception e)
41+
{
42+
e.printStackTrace();
43+
}
3344
}
3445

3546
@Test

0 commit comments

Comments
 (0)