Search in sources :

Example 1 with TopScreenView

use of org.apache.hadoop.hbase.hbtop.screen.top.TopScreenView in project hbase by apache.

the class TestFieldScreenPresenter method setup.

@Before
public void setup() {
    Field sortField = Mode.REGION.getDefaultSortField();
    fields = Mode.REGION.getFieldInfos().stream().map(FieldInfo::getField).collect(Collectors.toList());
    fieldDisplayMap = Mode.REGION.getFieldInfos().stream().collect(() -> new EnumMap<>(Field.class), (r, fi) -> r.put(fi.getField(), fi.isDisplayByDefault()), (r1, r2) -> {
    });
    fieldScreenPresenter = new FieldScreenPresenter(fieldScreenView, sortField, fields, fieldDisplayMap, resultListener, topScreenView);
    for (int i = 0; i < fields.size(); i++) {
        Field field = fields.get(i);
        if (field == sortField) {
            sortFieldPosition = i;
            break;
        }
    }
}
Also used : CoreMatchers.is(org.hamcrest.CoreMatchers.is) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Mock(org.mockito.Mock) RunWith(org.junit.runner.RunWith) ArgumentMatchers.anyBoolean(org.mockito.ArgumentMatchers.anyBoolean) TopScreenView(org.apache.hadoop.hbase.hbtop.screen.top.TopScreenView) FieldInfo(org.apache.hadoop.hbase.hbtop.field.FieldInfo) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) ClassRule(org.junit.ClassRule) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) Before(org.junit.Before) InOrder(org.mockito.InOrder) EnumMap(java.util.EnumMap) HBaseClassTestRule(org.apache.hadoop.hbase.HBaseClassTestRule) Test(org.junit.Test) Category(org.junit.experimental.categories.Category) Collectors(java.util.stream.Collectors) Mockito.verify(org.mockito.Mockito.verify) List(java.util.List) MockitoJUnitRunner(org.mockito.runners.MockitoJUnitRunner) Field(org.apache.hadoop.hbase.hbtop.field.Field) Mode(org.apache.hadoop.hbase.hbtop.mode.Mode) Mockito.inOrder(org.mockito.Mockito.inOrder) SmallTests(org.apache.hadoop.hbase.testclassification.SmallTests) Field(org.apache.hadoop.hbase.hbtop.field.Field) EnumMap(java.util.EnumMap) FieldInfo(org.apache.hadoop.hbase.hbtop.field.FieldInfo) Before(org.junit.Before)

Aggregations

EnumMap (java.util.EnumMap)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 HBaseClassTestRule (org.apache.hadoop.hbase.HBaseClassTestRule)1 Field (org.apache.hadoop.hbase.hbtop.field.Field)1 FieldInfo (org.apache.hadoop.hbase.hbtop.field.FieldInfo)1 Mode (org.apache.hadoop.hbase.hbtop.mode.Mode)1 TopScreenView (org.apache.hadoop.hbase.hbtop.screen.top.TopScreenView)1 SmallTests (org.apache.hadoop.hbase.testclassification.SmallTests)1 CoreMatchers.is (org.hamcrest.CoreMatchers.is)1 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)1 Before (org.junit.Before)1 ClassRule (org.junit.ClassRule)1 Test (org.junit.Test)1 Category (org.junit.experimental.categories.Category)1 RunWith (org.junit.runner.RunWith)1 ArgumentMatchers.any (org.mockito.ArgumentMatchers.any)1 ArgumentMatchers.anyBoolean (org.mockito.ArgumentMatchers.anyBoolean)1 ArgumentMatchers.anyInt (org.mockito.ArgumentMatchers.anyInt)1 ArgumentMatchers.eq (org.mockito.ArgumentMatchers.eq)1