/** Test that a node starts and sets SERVICE_UP correctly. */
  @Test(groups = "Integration")
  public void canStartupAndShutdown() {
    solr = app.createAndManageChild(EntitySpec.create(SolrServer.class));
    app.start(ImmutableList.of(testLocation));

    EntityAsserts.assertAttributeEqualsEventually(solr, Startable.SERVICE_UP, true);
    Entities.dumpInfo(app);

    solr.stop();

    EntityAsserts.assertAttributeEqualsEventually(solr, Startable.SERVICE_UP, false);
  }
  @Test
  public void testEntityCreatingItsEnricherDoesNotReCreateItUnlessUniqueTagDifferent()
      throws Exception {
    TestEntity e1 =
        origApp.createAndManageChild(
            EntitySpec.create(TestEntity.class, MyTestEntityWithEnricher.class));
    Collection<Enricher> e1e = e1.getEnrichers();
    log.info("enrichers1: " + e1e);
    Entities.dumpInfo(e1);
    assertEquals(e1e.size(), 5);

    newApp = (TestApplication) rebind();
    Entity e2 =
        Iterables.getOnlyElement(
            Entities.descendants(newApp, EntityPredicates.idEqualTo(e1.getId())));
    Collection<Enricher> e2e = e2.getEnrichers();
    log.info("enrichers2: " + e2e);
    Entities.dumpInfo(e2);

    assertEquals(e2e.size(), e1e.size() + 1);
  }
  public static void main(String[] argv) {
    List<String> args = Lists.newArrayList(argv);
    String port = CommandLineUtil.getCommandLineOption(args, "--port", "8081+");
    String locations =
        CommandLineUtil.getCommandLineOption(
            args, "--locations", Joiner.on(",").join(DEFAULT_LOCATIONS));

    BrooklynLauncher launcher =
        BrooklynLauncher.newInstance()
            .application(
                EntitySpec.create(StartableApplication.class, GlobalWebFabricExample.class)
                    .displayName("Brooklyn Global Web Fabric Example"))
            .webconsolePort(port)
            .locations(Arrays.asList(locations))
            .start();

    Entities.dumpInfo(launcher.getApplications());
  }