@Test
public void detectFallback() throws InstanceNotFoundException, ReflectionException, AttributeNotFoundException, MBeanException, MalformedObjectNameException {

    ObjectName serverMbean = new ObjectName(SERVER_MBEAN);
    MBeanServer mockServer = createMock(MBeanServer.class);
    expect(mockServer.queryNames(new ObjectName("com.sun.appserv:j2eeType=J2EEServer,*"),null)).
            andReturn(new HashSet<ObjectName>(Arrays.asList(serverMbean))).anyTimes();
    expect(mockServer.isRegistered(serverMbean)).andStubReturn(true);
    expect(mockServer.getAttribute(serverMbean, "serverVersion")).andReturn("GlassFish 3x");
    expect(mockServer.queryNames(new ObjectName("com.sun.appserver:type=Host,*"),null)).
            andReturn(new HashSet<ObjectName>(Arrays.asList(serverMbean))).anyTimes();
    replay(mockServer);
    ServerHandle info = detector.detect(getMBeanServerManager(mockServer));
    assertEquals(info.getVersion(), "3");
    assertEquals(info.getProduct(),"glassfish");
}