/*
* Copyright (c) 2010 Bjrn Darri Sigursson
*
* This file is part of Sonav.
*
* Sonav is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.jminor.sonav.client.ui;
import org.jminor.common.model.User;
import org.jminor.framework.client.ui.EntityPanel;
import org.jminor.sonav.beans.ui.PluginEditPanel;
import org.jminor.sonav.beans.ui.FilterEditPanel;
import org.jminor.sonav.beans.ui.GroupEditPanel;
import org.jminor.sonav.beans.ui.MetricEditPanel;
import org.jminor.sonav.beans.ui.ProjectEditPanel;
import org.jminor.sonav.beans.ui.RuleCategoryEditPanel;
import org.jminor.sonav.beans.ui.RuleProfileEditPanel;
import org.jminor.sonav.beans.ui.UserEditPanel;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import java.util.List;
public final class SonavApplicationPanelTest {
@Test
public void test() {
final SonavApplicationPanel panel = new SonavApplicationPanel(new User("sonar", "sonar"));
panel.startApplication("SonavApplicationPanelTest", null, false, null, null, false);
final List<EntityPanel> mainPanels = panel.getMainApplicationPanels();
assertEquals(ProjectEditPanel.class, mainPanels.get(0).getEditPanel().getClass());
assertEquals(RuleProfileEditPanel.class, mainPanels.get(1).getEditPanel().getClass());
assertEquals(RuleCategoryEditPanel.class, mainPanels.get(2).getEditPanel().getClass());
assertEquals(UserEditPanel.class, mainPanels.get(3).getEditPanel().getClass());
assertEquals(GroupEditPanel.class, mainPanels.get(4).getEditPanel().getClass());
assertEquals(FilterEditPanel.class, mainPanels.get(5).getEditPanel().getClass());
assertEquals(MetricEditPanel.class, mainPanels.get(6).getEditPanel().getClass());
assertEquals(PluginEditPanel.class, mainPanels.get(7).getEditPanel().getClass());
}
}
|