@Test
 public void rootUIDiscovery() throws MalformedURLException {
   assertThat(RootUI.getNumberOfInstances(), is(0));
   openWindow("");
   waitModel.waitForChange(retrieveText.locator(LABEL));
   assertThat(RootUI.getNumberOfInstances(), is(1));
 }
 /**
  * Tests invalid deployment of multiple roots within a WAR Should be started first--arquillian
  * deployments are not perfectly isolated.
  */
 @Test
 @InSequence(-2)
 public void uiPathCollisionBreaksDeployment() throws MalformedURLException {
   assertThat(RootUI.getNumberOfInstances(), is(0));
   deployer.deploy("uiPathCollision");
   openWindowNoWait(deriveMappingForUI(PathCollisionUI.class));
   final String expectedErrorMessage = this.firstWindow.getBodyText();
   assertThat(
       expectedErrorMessage, containsString("VaadinCDIServlet deployment aborted. Reason:"));
   assertThat(RootUI.getNumberOfInstances(), is(0));
 }
 /**
  * Tests invalid deployment of multiple roots within a WAR Should be before the regular
  * tests--arquillian deployments are not perfectly isolated.
  */
 @Test
 @InSequence(-1)
 public void multipleRootsBreakDeployment() throws MalformedURLException {
   assertThat(RootUI.getNumberOfInstances(), is(0));
   deployer.deploy("multipleRoots");
   openWindowNoWait("");
   final String expectedErrorMessage = this.firstWindow.getBodyText();
   assertThat(
       expectedErrorMessage, containsString("VaadinCDIServlet deployment aborted. Reason:"));
   assertThat(RootUI.getNumberOfInstances(), is(0));
 }
 @Before
 public void resetCounter() {
   PlainUI.resetCounter();
   PlainAlternativeUI.resetCounter();
   PlainColidingAlternativeUI.resetCounter();
   InstrumentedUI.resetCounter();
   InstrumentedView.resetCounter();
   ScopedInstrumentedView.resetCounter();
   ViewWithoutAnnotation.resetCounter();
   WithAnnotationRegisteredView.resetCounter();
   SecondUI.resetCounter();
   RootUI.resetCounter();
   RootWithCustomMappingUI.resetCounter();
   UIWithCDIDependentListener.resetCounter();
   UIWithCDISelfListener.resetCounter();
   DependentCDIEventListener.resetCounter();
   DependentCDIEventListener.resetEventCounter();
   ParameterizedNavigationUI.reset();
   NoViewProviderNavigationUI.resetCounter();
   firstWindow.restartBrowser();
 }
 void assertDefaultRootNotInstantiated() {
   assertThat(RootUI.getNumberOfInstances(), is(0));
 }