I'm a bit struggled by trying to verify that interaction between multiple extensions is going as expected. I have an Android Extension which basically allows to enrich Arquillian Drone extension by providing an Android Emulator for Drone.

The problem here is the event hierarchy. There are 3 entry points which observe BeforeSuite event:

ArquillianDroneConfigurator

AndroidExtensionConfigurator

AndroidDroneConfigurator

These three basically load configuration from arquilian.xml. Some events are fired to ensure the rest of the work is propagated.

ArquillianDrone extension then user a second entry point, BeforeClass. I had problem that this event was fired before processing of BeforeSuite was done for other two extensions, so it failed because AndroidEmulator WebDriver Hub was not ready yet and thus WebDriver wasn't able to connect to a specific URL.

I solved this problem via a lock object with is unlocked after Hub is ready and active polling for the event which precedes the Drone creation (@Observes EventContent<EventName>). Not really happy with this, but it works.

I've created a generic extension which logs all the events fired and made it a part of android-tests. However, the order is not actually what I'd expect and some of the events are not logged at all.

Note that for instance AndroidBridgeInitialized is fired in an observer which @Observes AndroidExtensionConfigured, so the order is wrong. Also my method (@Observers AfterSuite xyz), which fires a dispose-event for AndroidEmulator from an observer method defined in EmulatorShutdown is not fired at all.

Using debug information I figured out that some of the Observers are fired, but their arguments contain nulls. This was caused by ordering of Observers on BeforeSuite event, which is JVM/classpath order related.