public void testConfigRoudntrip() throws Exception {
    TeamForgeShare.TeamForgeShareDescriptor d =
        hudson.getDescriptorByType(TeamForgeShare.TeamForgeShareDescriptor.class);

    ConnectionFactory orig = new ConnectionFactory("http://www.google.com/", "abc", "def");
    roundtrip(d, orig);
    assertEqualBeans(d.getConnectionFactory(), orig, FIELDS);

    roundtrip(d, null);
    assertNull(d.getConnectionFactory());
  }
 private void roundtrip(TeamForgeShare.TeamForgeShareDescriptor d, ConnectionFactory orig)
     throws Exception {
   d.setConnectionFactory(orig);
   submit(createWebClient().goTo("configure").getFormByName("config"));
 }