/**
   * Generates the resources and views.
   *
   * @throws Exception Thrown if any errors occur during generation.
   */
  public void generate() throws Exception {
    // We use reflection to get at annotations of our widget subclasses,
    // but that wanders into UIObject, which has a static clinit call
    // to UIObject. This makes it return null instead of blowing up.
    GWTMockUtilities.disarm();

    long start = System.currentTimeMillis();

    final Cleanup cleanup = new Cleanup(outputDirectory);

    if (viewsPackageName != null) {
      cleanup.watchPackage(viewsPackageName);
      new ViewGenerator(
              inputDirectory, viewsPackageName, outputDirectory, cleanup, additionalViewgenFiles)
          .generate();
    }

    if (resourcesPackageName != null) {
      cleanup.watchPackage(resourcesPackageName);
      new ResourcesGenerator(inputDirectory, cleanup, resourcesPackageName, outputDirectory).run();
    }

    cleanup.deleteLeftOvers();

    long end = System.currentTimeMillis();
    System.out.println("Done " + (end - start) + "ms");
  }
    @Override
    protected void configureTest() {
      GWTMockUtilities.disarm();
      forceMock(ToolBarWidget.class);
      forceMock(ContentContainer.class);
      forceMock(PopUpConfirmationWidget.class);
      forceMock(PopUpEditWidget.class);
      forceMock(PopUpImageInformationWidget.class);

      bind(HostPageUiBinder.class).to(FakeHostPageUiBinder.class);
    }
 @AfterClass
 public static void cleanup() {
   GWTMockUtilities.restore();
 }
 {
   setImposteriser(ClassImposteriser.INSTANCE);
   GWTMockUtilities.disarm();
 }
 @Before
 public void setUp() {
   GWTMockUtilities.disarm();
   MockitoAnnotations.initMocks(this);
   notFoundHistoryConverter = new NotFoundHistoryConverter();
 }
 @Override
 protected void configureTest() {
   GWTMockUtilities.disarm();
   bind(DeferredCommandManager.class).in(TestSingleton.class);
   bind(PlaceManager.class).to(PlaceManagerTestUtil.class).in(TestSingleton.class);
 }