public void computeFeNodes() {
        for (Frontend fe : GlobalStateMgr.getCurrentState().getNodeMgr().getFrontends(null /* all */)) {
            if (!fe.isAlive()) {
                continue;
            }
            if (frontends == null) {
                frontends = Lists.newArrayList();
            }
            TFrontend feInfo = new TFrontend();
            feInfo.setId(fe.getNodeName());
            feInfo.setIp(fe.getHost());
            feInfo.setHttp_port(Config.http_port);
            frontends.add(feInfo);
        }
    }
@Test
    public void testComputeFeNodes(@Mocked GlobalStateMgr globalStateMgr) {
        List<Frontend> frontends = new ArrayList<>();
        frontends.add(new Frontend());
        Frontend frontend = new Frontend();
        frontend.setAlive(true);
        frontends.add(frontend);
        new Expectations() {
            {
                GlobalStateMgr.getCurrentState();
                minTimes = 0;
                result = globalStateMgr;
                globalStateMgr.getNodeMgr().getFrontends(null);
                minTimes = 0;
                result = frontends;
            }
        };
        TupleDescriptor desc = new TupleDescriptor(new TupleId(0));
        SystemTable table = new SystemTable(0, "fe_metrics", null, null, null);
        desc.setTable(table);
        SchemaScanNode scanNode = new SchemaScanNode(new PlanNodeId(0), desc);

        scanNode.computeFeNodes();

        Assert.assertNotNull(scanNode.getFrontends());
    }