SystemCollector implements Runnable { @SuppressWarnings("unchecked") @Activate public void activate(ComponentContext context) { this.properties = context.getProperties(); this.topic = context.getProperties().get("topic") != null ? String.class.cast(context.getProperties().get("topic")) : "decanter/collect/system/"; if (!this.topic.endsWith("/")) { this.topic = this.topic + "/"; } try { this.threadNumber = context.getProperties().get("thread.number") != null ? Integer.parseInt(String.class.cast(context.getProperties().get("thread.number"))) : 1; } catch (Exception e) { throw new IllegalArgumentException("invalid parameter 'thread.number' is not a number"); } }  @SuppressWarnings("unchecked") @Activate void activate(ComponentContext context); @Override void run(); @Reference
    public EventAdmin dispatcher; }
@Test(expected = IllegalArgumentException.class) public void testBadConfiguration() { SystemCollector collector = new SystemCollector(); this.eventAdmin = new EventAdminStub(); collector.dispatcher = eventAdmin; componentContext = new ComponentContextStub(); componentContext.getProperties().put("thread.number", "A"); componentContext.getProperties().put("command.df1", "df -h"); collector.activate(componentContext); }