本文整理汇总了Java中de.mrapp.android.util.logging.LogLevel.ALL属性的典型用法代码示例。如果您正苦于以下问题:Java LogLevel.ALL属性的具体用法?Java LogLevel.ALL怎么用?Java LogLevel.ALL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类de.mrapp.android.util.logging.LogLevel
的用法示例。
在下文中一共展示了LogLevel.ALL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetItemStateThrowsExceptionWhenItemIsNull
/**
* Ensures, that a {@link NullPointerException} is thrown by the method, which allows to
* retrieve the state of a specific item, if the item is null.
*/
public final void testGetItemStateThrowsExceptionWhenItemIsNull() {
try {
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
abstractItemStateListAdapter.getItemState(null);
Assert.fail();
} catch (NullPointerException e) {
}
}
示例2: testTriggerItemStateByIndexWhenStateIsNotMaxState
/**
* Tests the functionality of the method, which allows to trigger the state of the item, which
* belongs to a specific index, if the item's state is not already the maximum state.
*/
@SuppressWarnings("unchecked")
public final void testTriggerItemStateByIndexWhenStateIsNotMaxState() {
Object item = new Object();
DataSetObserver dataSetObserver = new DataSetObserver();
ListItemStateListener<Object> listItemStateListener = mock(ListItemStateListener.class);
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
abstractItemStateListAdapter.registerDataSetObserver(dataSetObserver);
abstractItemStateListAdapter.addItemStateListener(listItemStateListener);
abstractItemStateListAdapter.addItem(item);
dataSetObserver.reset();
int previousState = abstractItemStateListAdapter.triggerItemState(0);
assertEquals(0, previousState);
assertEquals(1, abstractItemStateListAdapter.getItemState(0));
verify(listItemStateListener, times(1))
.onItemStateChanged(abstractItemStateListAdapter, item, 0, 1);
assertTrue(dataSetObserver.hasOnChangedBeenCalled());
}
示例3: testGetUnfilteredIndexThrowsExceptionWhenIndexIsLessThanZero
/**
* Ensures, that an {@link IndexOutOfBoundsException} is thrown by the method, which allows to
* retrieve the unfiltered index, which corresponds to a specific filtered index, if the index
* is less than 0.
*/
public final void testGetUnfilteredIndexThrowsExceptionWhenIndexIsLessThanZero() {
try {
AbstractFilterableListAdapterImplementation abstractFilterableListAdapter =
new AbstractFilterableListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<FilterableImplementation>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<FilterableImplementation>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<FilterableImplementation>>(),
new LinkedHashSet<ListAdapterListener<FilterableImplementation>>(),
new LinkedHashSet<ListEnableStateListener<FilterableImplementation>>(),
1, false,
new LinkedHashSet<ListItemStateListener<FilterableImplementation>>(),
new LinkedHashSet<ListSortingListener<FilterableImplementation>>(),
new LinkedHashSet<ListFilterListener<FilterableImplementation>>(),
new LinkedHashSet<AppliedFilter<FilterableImplementation>>());
abstractFilterableListAdapter.getUnfilteredIndex(-1);
Assert.fail();
} catch (IndexOutOfBoundsException e) {
}
}
示例4: testTriggerItemStateWhenStateIsNotMaxState
/**
* Tests the functionality of the method, which allows to trigger the state of a specific item,
* if the item's state is not already the maximum state.
*/
@SuppressWarnings("unchecked")
public final void testTriggerItemStateWhenStateIsNotMaxState() {
Object item = new Object();
DataSetObserver dataSetObserver = new DataSetObserver();
ListItemStateListener<Object> listItemStateListener = mock(ListItemStateListener.class);
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
abstractItemStateListAdapter.registerDataSetObserver(dataSetObserver);
abstractItemStateListAdapter.addItemStateListener(listItemStateListener);
abstractItemStateListAdapter.addItem(item);
dataSetObserver.reset();
int previousState = abstractItemStateListAdapter.triggerItemState(item);
assertEquals(0, previousState);
assertEquals(1, abstractItemStateListAdapter.getItemState(item));
verify(listItemStateListener, times(1))
.onItemStateChanged(abstractItemStateListAdapter, item, 0, 1);
assertTrue(dataSetObserver.hasOnChangedBeenCalled());
}
示例5: testGetItemStateCountWithSpecificState
/**
* Tests the functionality of the method, which allows to retrieve the number of items, which
* have a specific state.
*/
public final void testGetItemStateCountWithSpecificState() {
Object item1 = new Object();
Object item2 = new Object();
Object item3 = new Object();
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
abstractItemStateListAdapter.addItem(item1);
abstractItemStateListAdapter.addItem(item2);
abstractItemStateListAdapter.addItem(item3);
abstractItemStateListAdapter.setItemState(item2, 1);
assertEquals(2, abstractItemStateListAdapter.getItemStateCount(0));
}
示例6: testConstructor
/**
* Tests, if all properties are set correctly by the constructor.
*/
public final void testConstructor() {
boolean selectItemOnClick = true;
Set<ListSelectionListener<Object>> selectionListeners =
new LinkedHashSet<ListSelectionListener<Object>>();
AbstractSelectableListAdapterImplementation abstractSelectableListAdapter =
new AbstractSelectableListAdapterImplementation(getContext(),
new SelectableListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 1, false,
new LinkedHashSet<ListItemStateListener<Object>>(),
new LinkedHashSet<ListSortingListener<Object>>(),
new LinkedHashSet<ListFilterListener<Object>>(),
new LinkedHashSet<AppliedFilter<Object>>(), selectItemOnClick,
selectionListeners);
assertEquals(selectItemOnClick, abstractSelectableListAdapter.isItemSelectedOnClick());
assertEquals(selectionListeners, abstractSelectableListAdapter.getSelectionListeners());
}
示例7: testGetItemsWithSpecificState
/**
* Tests the functionality of the method, which allows to retrieve a collection, which contains
* all items, which have a specific state.
*/
public final void testGetItemsWithSpecificState() {
Object item1 = new Object();
Object item2 = new Object();
Object item3 = new Object();
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
abstractItemStateListAdapter.addItem(item1);
abstractItemStateListAdapter.addItem(item2);
abstractItemStateListAdapter.addItem(item3);
abstractItemStateListAdapter.setItemState(item2, 1);
Collection<Object> items = abstractItemStateListAdapter.getItemsWithSpecificState(0);
assertEquals(2, items.size());
Iterator<Object> iterator = items.iterator();
assertEquals(item1, iterator.next());
assertEquals(item3, iterator.next());
}
示例8: testSetItemStateThrowsExceptionWhenItemIsNull
/**
* Ensures, that an {@link NullPointerException} is thrown by the method, which allows to set
* the state of a specific item, if the item is null.
*/
public final void testSetItemStateThrowsExceptionWhenItemIsNull() {
try {
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
abstractItemStateListAdapter.setItemState(null, 0);
Assert.fail();
} catch (NullPointerException e) {
}
}
示例9: testGetLastIndexWithSpecificState
/**
* Tests the functionality of the method, which allows to retrieve the index of the last item,
* which has a specific state.
*/
public final void testGetLastIndexWithSpecificState() {
Object item1 = new Object();
Object item2 = new Object();
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
abstractItemStateListAdapter.addItem(item1);
abstractItemStateListAdapter.addItem(item2);
assertEquals(1, abstractItemStateListAdapter.getLastIndexWithSpecificState(0));
}
示例10: testSetEnabledByIndexWhenItemIsAlreadyEnabled
/**
* Tests the functionality of the method, which allows to set the enable state of the item,
* which belongs to a specific index, if the item is already enabled.
*/
@SuppressWarnings("unchecked")
public final void testSetEnabledByIndexWhenItemIsAlreadyEnabled() {
Object item = new Object();
DataSetObserver dataSetObserver = new DataSetObserver();
ListEnableStateListener<Object> listEnableStateListener =
mock(ListEnableStateListener.class);
AbstractEnableStateListAdapterImplementation abstractEnableStateListAdapter =
new AbstractEnableStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>());
abstractEnableStateListAdapter.registerDataSetObserver(dataSetObserver);
abstractEnableStateListAdapter.addEnableStateListener(listEnableStateListener);
abstractEnableStateListAdapter.addItem(item);
dataSetObserver.reset();
abstractEnableStateListAdapter.setEnabled(0, true);
assertTrue(abstractEnableStateListAdapter.isEnabled(0));
verify(listEnableStateListener, times(0))
.onItemDisabled(abstractEnableStateListAdapter, item, 0);
assertFalse(dataSetObserver.hasOnChangedBeenCalled());
}
示例11: testConstructorThrowsExceptionWhenSortingListenersIsNull
/**
* Ensures, that a {@link NullPointerException} is thrown, if the set, which contains the
* sorting listeners, which is passed to the constructor, is null.
*/
public final void testConstructorThrowsExceptionWhenSortingListenersIsNull() {
try {
new AbstractSortableListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<ComparableImplementation>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<ComparableImplementation>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<ComparableImplementation>>(),
new LinkedHashSet<ListAdapterListener<ComparableImplementation>>(),
new LinkedHashSet<ListEnableStateListener<ComparableImplementation>>(), 1,
false, new LinkedHashSet<ListItemStateListener<ComparableImplementation>>(),
null);
Assert.fail();
} catch (NullPointerException e) {
}
}
示例12: testSetAllItemStatesThrowsExceptionWhenStateIsLessThanZero
/**
* Ensures, that an {@link IllegalArgumentException} is thrown by the method, which allows to
* set the states of all items to a specific state, if the state is less than 0.
*/
public final void testSetAllItemStatesThrowsExceptionWhenStateIsLessThanZero() {
try {
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
abstractItemStateListAdapter.setAllItemStates(-1);
Assert.fail();
} catch (IllegalArgumentException e) {
}
}
示例13: testGetFirstItemWithSpecificStateWhenNoItemHasState
/**
* Tests the functionality of the method, which allows to retrieve the first item, which has a
* specific state, if no item has the state.
*/
public final void testGetFirstItemWithSpecificStateWhenNoItemHasState() {
Object item1 = new Object();
Object item2 = new Object();
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
abstractItemStateListAdapter.addItem(item1);
abstractItemStateListAdapter.addItem(item2);
assertNull(abstractItemStateListAdapter.getFirstItemWithSpecificState(1));
}
示例14: testAddItemInvalidatesOrder
/**
* Ensures, that the order of the adapter's items is invalidated, when an item is added to the
* adapter.
*/
public final void testAddItemInvalidatesOrder() {
AbstractSortableListAdapterImplementation abstractSortableListAdapter =
new AbstractSortableListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<ComparableImplementation>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<ComparableImplementation>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<ComparableImplementation>>(),
new LinkedHashSet<ListAdapterListener<ComparableImplementation>>(),
new LinkedHashSet<ListEnableStateListener<ComparableImplementation>>(), 1,
false, new LinkedHashSet<ListItemStateListener<ComparableImplementation>>(),
new LinkedHashSet<ListSortingListener<ComparableImplementation>>());
ComparableImplementation item1 = new ComparableImplementation(2);
ComparableImplementation item2 = new ComparableImplementation(1);
abstractSortableListAdapter.addItem(item1);
abstractSortableListAdapter.addItem(item2);
abstractSortableListAdapter.sort();
assertEquals(Order.ASCENDING, abstractSortableListAdapter.getOrder());
abstractSortableListAdapter.addItem(new ComparableImplementation(0));
assertNull(abstractSortableListAdapter.getOrder());
}
示例15: testGetFirstItemWithSpecificStateWhenAdapterIsEmpty
/**
* Tests the functionality of the method, which allows to retrieve the first item, which has a
* specific state, if the adapter is empty.
*/
public final void testGetFirstItemWithSpecificStateWhenAdapterIsEmpty() {
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
assertNull(abstractItemStateListAdapter.getFirstItemWithSpecificState(0));
}