本文整理汇总了Java中de.mrapp.android.util.logging.LogLevel.ERROR属性的典型用法代码示例。如果您正苦于以下问题:Java LogLevel.ERROR属性的具体用法?Java LogLevel.ERROR怎么用?Java LogLevel.ERROR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类de.mrapp.android.util.logging.LogLevel
的用法示例。
在下文中一共展示了LogLevel.ERROR属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testConstructor
/**
* Tests, if all properties are set correctly by the constructor.
*/
public final void testConstructor() {
Context context = getContext();
ListDecorator<Object> decorator = new ListDecoratorImplementation();
ArrayList<Item<Object>> items = new ArrayList<>();
boolean allowDuplicates = true;
boolean notifyOnChange = true;
LogLevel logLevel = LogLevel.ERROR;
Set<ListAdapterItemClickListener<Object>> itemClickListeners = new LinkedHashSet<>();
Set<ListAdapterItemLongClickListener<Object>> itemLongClickListeners =
new LinkedHashSet<>();
Set<ListAdapterListener<Object>> adapterListeners = new LinkedHashSet<>();
AbstractListAdapterImplementation abstractListAdapter =
new AbstractListAdapterImplementation(context, decorator, logLevel, items,
allowDuplicates, notifyOnChange, itemClickListeners, itemLongClickListeners,
adapterListeners);
assertEquals(context, abstractListAdapter.getContext());
assertEquals(decorator, abstractListAdapter.getDecorator());
assertEquals(items, abstractListAdapter.getItems());
assertNull(abstractListAdapter.getParameters());
assertEquals(allowDuplicates, abstractListAdapter.areDuplicatesAllowed());
assertEquals(notifyOnChange, abstractListAdapter.isNotifiedOnChange());
assertEquals(itemClickListeners, abstractListAdapter.getItemClickListeners());
assertEquals(adapterListeners, abstractListAdapter.getAdapterListeners());
assertEquals(logLevel, abstractListAdapter.getLogLevel());
}
示例2: testConstructor
/**
* Tests, if all properties are set correctly by the constructor.
*/
public final void testConstructor() {
Context context = getContext();
ExpandableListDecorator<Object, Object> decorator =
new ExpandableListDecoratorImplementation();
LogLevel logLevel = LogLevel.ERROR;
MultipleChoiceListAdapter<Group<Object, Object>> groupAdapter =
new MultipleChoiceListAdapterImplementation<>(getContext(),
new NullObjectDecorator<Group<Object, Object>>());
boolean allowDuplicateChildren = false;
boolean notifyOnChange = true;
boolean triggerGroupExpansionOnClick = true;
Set<ExpandableListAdapterItemClickListener<Object, Object>> itemClickListeners =
new LinkedHashSet<>();
Set<ExpandableListAdapterItemLongClickListener<Object, Object>> itemLongClickListeners =
new LinkedHashSet<>();
Set<ExpandableListAdapterListener<Object, Object>> adapterListeners = new LinkedHashSet<>();
Set<ExpansionListener<Object, Object>> expansionListeners = new LinkedHashSet<>();
AbstractExpandableListAdapterImplementation abstractExpandableListAdapter =
new AbstractExpandableListAdapterImplementation(context, decorator, logLevel,
groupAdapter, allowDuplicateChildren, notifyOnChange,
triggerGroupExpansionOnClick, itemClickListeners, itemLongClickListeners,
adapterListeners, expansionListeners);
assertEquals(context, abstractExpandableListAdapter.getContext());
assertEquals(decorator, abstractExpandableListAdapter.getDecorator());
assertEquals(logLevel, abstractExpandableListAdapter.getLogLevel());
assertEquals(groupAdapter, abstractExpandableListAdapter.getGroupAdapter());
assertEquals(allowDuplicateChildren,
abstractExpandableListAdapter.areDuplicateChildrenAllowed());
assertEquals(notifyOnChange, abstractExpandableListAdapter.isNotifiedOnChange());
assertEquals(triggerGroupExpansionOnClick,
abstractExpandableListAdapter.isGroupExpansionTriggeredOnClick());
assertEquals(itemClickListeners, abstractExpandableListAdapter.getItemClickListeners());
assertEquals(itemLongClickListeners,
abstractExpandableListAdapter.getItemLongClickListeners());
assertEquals(adapterListeners, abstractExpandableListAdapter.getAdapterListeners());
assertEquals(expansionListeners, abstractExpandableListAdapter.getExpansionListeners());
assertNull(abstractExpandableListAdapter.getParameters());
}
示例3: testSetLogLevel
/**
* Tests the functionality of the method, which allows to set the log level.
*/
public final void testSetLogLevel() {
AbstractExpandableListAdapterImplementation abstractExpandableListAdapter = createAdapter();
LogLevel logLevel = LogLevel.ERROR;
abstractExpandableListAdapter.setLogLevel(logLevel);
assertEquals(logLevel, abstractExpandableListAdapter.getLogLevel());
}
示例4: testToString
/**
* Tests the functionality of the toString-method.
*/
public final void testToString() {
ArrayList<Item<Object>> items = new ArrayList<>();
items.add(new Item<Object>(new Object()));
LogLevel logLevel = LogLevel.ERROR;
boolean allowDuplicates = true;
boolean notifyOnChange = true;
Set<ListAdapterItemClickListener<Object>> itemClickListeners = new LinkedHashSet<>();
Set<ListAdapterItemLongClickListener<Object>> itemLongClickListeners =
new LinkedHashSet<>();
Set<ListAdapterListener<Object>> adapterListeners = new LinkedHashSet<>();
Set<ListEnableStateListener<Object>> enableStateListeners = new LinkedHashSet<>();
int numberOfItemStates = 2;
boolean triggerItemStateOnClick = true;
Set<ListItemStateListener<Object>> itemStateListeners = new LinkedHashSet<>();
Set<ListSortingListener<Object>> sortingListeners = new LinkedHashSet<>();
Set<ListFilterListener<Object>> filterListeners = new LinkedHashSet<>();
LinkedHashSet<AppliedFilter<Object>> appliedFilters = new LinkedHashSet<>();
boolean selectItemOnClick = true;
Set<ListSelectionListener<Object>> selectionListeners = new LinkedHashSet<>();
Bundle parameters = new Bundle();
MultipleChoiceListAdapterImplementation<Object> multipleChoiceListAdapterImplementation =
new MultipleChoiceListAdapterImplementation<>(getContext(),
new SelectableListDecoratorImplementation(), logLevel, items,
allowDuplicates, notifyOnChange, itemClickListeners, itemLongClickListeners,
adapterListeners, enableStateListeners, numberOfItemStates,
triggerItemStateOnClick, itemStateListeners, sortingListeners,
filterListeners, appliedFilters, selectItemOnClick, selectionListeners);
multipleChoiceListAdapterImplementation.setParameters(parameters);
assertEquals(
"MultipleChoiceListAdapter (" + items.size() + " items) [logLevel=" + logLevel +
", parameters=" + parameters + ", notifyOnChange=" + notifyOnChange +
", allowDuplicates=" + allowDuplicates + ", numberOfItemStates=" +
numberOfItemStates + ", triggerItemStateOnClick=" +
triggerItemStateOnClick + ", filtered=" + false + ", selectItemOnClick=" +
selectItemOnClick + "]",
multipleChoiceListAdapterImplementation.toString());
}
开发者ID:michael-rapp,项目名称:AndroidAdapters,代码行数:40,代码来源:MultipleChoiceListAdapterImplementationTest.java
示例5: testToString
/**
* Tests the functionality of the toString-method.
*/
public final void testToString() {
ArrayList<Item<Object>> items = new ArrayList<>();
items.add(new Item<>(new Object()));
LogLevel logLevel = LogLevel.ERROR;
boolean allowDuplicates = true;
boolean notifyOnchange = true;
Set<ListAdapterItemClickListener<Object>> itemClickListeners = new LinkedHashSet<>();
Set<ListAdapterItemLongClickListener<Object>> itemLongClickListeners =
new LinkedHashSet<>();
Set<ListAdapterListener<Object>> adapterListeners = new LinkedHashSet<>();
Set<ListEnableStateListener<Object>> enableStateListeners = new LinkedHashSet<>();
int numberOfItemStates = 2;
boolean triggerItemStateOnClick = true;
Set<ListItemStateListener<Object>> itemStateListeners = new LinkedHashSet<>();
Set<ListSortingListener<Object>> sortingListeners = new LinkedHashSet<>();
Set<ListFilterListener<Object>> filterListeners = new LinkedHashSet<>();
LinkedHashSet<AppliedFilter<Object>> appliedFilters = new LinkedHashSet<>();
boolean selectItemOnClick = true;
Set<ListSelectionListener<Object>> selectionListeners = new LinkedHashSet<>();
boolean adaptSelectionAutomatically = false;
Bundle parameters = new Bundle();
SingleChoiceListAdapterImplementation<Object> singleChoiceListAdapterImplementation =
new SingleChoiceListAdapterImplementation<>(getContext(),
new SelectableListDecoratorImplementation(), logLevel, items,
allowDuplicates, notifyOnchange, itemClickListeners, itemLongClickListeners,
adapterListeners, enableStateListeners, numberOfItemStates,
triggerItemStateOnClick, itemStateListeners, sortingListeners,
filterListeners, appliedFilters, selectItemOnClick, selectionListeners,
adaptSelectionAutomatically);
singleChoiceListAdapterImplementation.setParameters(parameters);
assertEquals("SingleChoiceListAdapter (" + items.size() + " items) [logLevel=" + logLevel +
", parameters=" + parameters + ", notifyOnChange=" + notifyOnchange +
", allowDuplicates=" + allowDuplicates + ", numberOfItemStates=" +
numberOfItemStates + ", triggerItemStateOnClick=" +
triggerItemStateOnClick + ", filtered=" + false + ", selectItemOnClick=" +
selectItemOnClick + ", adaptSelectionAutomatically=" +
adaptSelectionAutomatically + "]",
singleChoiceListAdapterImplementation.toString());
}
示例6: testSetLogLevel
/**
* Tests the functionality of the method, which allows to set the log level.
*/
public final void testSetLogLevel() {
AbstractListAdapterImplementation abstractListAdapter = createAdapter();
LogLevel logLevel = LogLevel.ERROR;
abstractListAdapter.setLogLevel(logLevel);
assertEquals(logLevel, abstractListAdapter.getLogLevel());
}
示例7: testOnSaveInstanceStateWhenDataIsParcelable
/**
* Tests the functionality of the onSaveInstanceState-method, when the adapter's underlying data
* implements the interface {@link Parcelable}.
*/
public final void testOnSaveInstanceStateWhenDataIsParcelable() {
String key = "adapterkey";
Bundle outState = new Bundle();
Object item1 = new ParcelableImplementation(0);
Object item2 = new ParcelableImplementation(1);
Bundle parameters = new Bundle();
parameters.putInt("key", 1);
boolean allowDuplicates = true;
boolean notifyOnChange = false;
LogLevel logLevel = LogLevel.ERROR;
AbstractListAdapterImplementation abstractListAdapter = createAdapter();
abstractListAdapter.addItem(item1);
abstractListAdapter.addItem(item2);
abstractListAdapter.setParameters(parameters);
abstractListAdapter.allowDuplicates(allowDuplicates);
abstractListAdapter.notifyOnChange(notifyOnChange);
abstractListAdapter.setLogLevel(logLevel);
abstractListAdapter.onSaveInstanceState(outState, key);
Bundle savedState = outState.getBundle(key);
ArrayList<Item<ParcelableImplementation>> savedItems =
savedState.getParcelableArrayList(AbstractListAdapter.PARCELABLE_ITEMS_BUNDLE_KEY);
Bundle savedParameters = savedState.getBundle(AbstractListAdapter.PARAMETERS_BUNDLE_KEY);
boolean savedAllowDuplicates =
savedState.getBoolean(AbstractListAdapter.ALLOW_DUPLICATES_BUNDLE_KEY);
boolean savedNotifyOnChange =
savedState.getBoolean(AbstractListAdapter.NOTIFY_ON_CHANGE_BUNDLE_KEY);
Iterator<Item<ParcelableImplementation>> itemsIterator = savedItems.iterator();
assertEquals(item1, itemsIterator.next().getData());
assertEquals(item2, itemsIterator.next().getData());
assertEquals(1, savedParameters.getInt("key"));
assertEquals(allowDuplicates, savedAllowDuplicates);
assertEquals(notifyOnChange, savedNotifyOnChange);
assertEquals(logLevel, abstractListAdapter.getLogLevel());
}
示例8: testOnSaveInstanceStateWhenDataIsSerializable
/**
* Tests the functionality of the onSaveInstanceState-method, when the adapter's underlying data
* implements the interface {@link Serializable}.
*/
@SuppressWarnings("unchecked")
public final void testOnSaveInstanceStateWhenDataIsSerializable() {
String key = "adapterkey";
Bundle outState = new Bundle();
Object item1 = new SerializableImplementation(0);
Object item2 = new SerializableImplementation(1);
Bundle parameters = new Bundle();
parameters.putInt("key", 1);
boolean allowDuplicates = true;
boolean notifyOnChange = false;
LogLevel logLevel = LogLevel.ERROR;
AbstractListAdapterImplementation abstractListAdapter = createAdapter();
abstractListAdapter.addItem(item1);
abstractListAdapter.addItem(item2);
abstractListAdapter.setParameters(parameters);
abstractListAdapter.allowDuplicates(allowDuplicates);
abstractListAdapter.notifyOnChange(notifyOnChange);
abstractListAdapter.setLogLevel(logLevel);
abstractListAdapter.onSaveInstanceState(outState, key);
Bundle savedState = outState.getBundle(key);
ArrayList<Item<Object>> savedItems = (ArrayList<Item<Object>>) savedState
.getSerializable(AbstractListAdapter.SERIALIZABLE_ITEMS_BUNDLE_KEY);
Bundle savedParameters = savedState.getBundle(AbstractListAdapter.PARAMETERS_BUNDLE_KEY);
boolean savedAllowDuplicates =
savedState.getBoolean(AbstractListAdapter.ALLOW_DUPLICATES_BUNDLE_KEY);
boolean savedNotifyOnChange =
savedState.getBoolean(AbstractListAdapter.NOTIFY_ON_CHANGE_BUNDLE_KEY);
Iterator<Item<Object>> itemsIterator = savedItems.iterator();
assertEquals(item1, itemsIterator.next().getData());
assertEquals(item2, itemsIterator.next().getData());
assertEquals(1, savedParameters.getInt("key"));
assertEquals(allowDuplicates, savedAllowDuplicates);
assertEquals(notifyOnChange, savedNotifyOnChange);
assertEquals(logLevel, abstractListAdapter.getLogLevel());
}
示例9: testOnRestoreInstanceStateWhenDataIsParcelable
/**
* Tests the functionality of the onRestoreInstanceState-method, when the adapter's underlying
* data implements the interface {@link Parcelable}.
*/
public final void testOnRestoreInstanceStateWhenDataIsParcelable() {
String key = "adapterkey";
Bundle savedInstanceState = new Bundle();
ParcelableImplementation item1 = new ParcelableImplementation(0);
ParcelableImplementation item2 = new ParcelableImplementation(1);
ArrayList<Item<ParcelableImplementation>> savedItems =
new ArrayList<Item<ParcelableImplementation>>();
savedItems.add(new Item<ParcelableImplementation>(item1));
savedItems.add(new Item<ParcelableImplementation>(item2));
Bundle parameters = new Bundle();
parameters.putInt("key", 1);
boolean allowDuplicates = true;
boolean notifyOnChange = false;
LogLevel logLevel = LogLevel.ERROR;
Bundle savedState = new Bundle();
savedState.putParcelableArrayList(AbstractListAdapter.PARCELABLE_ITEMS_BUNDLE_KEY,
savedItems);
savedState.putBundle(AbstractListAdapter.PARAMETERS_BUNDLE_KEY, parameters);
savedState.putBoolean(AbstractListAdapter.ALLOW_DUPLICATES_BUNDLE_KEY, allowDuplicates);
savedState.putBoolean(AbstractListAdapter.NOTIFY_ON_CHANGE_BUNDLE_KEY, notifyOnChange);
savedState.putInt(AbstractListAdapter.LOG_LEVEL_BUNDLE_KEY, logLevel.getRank());
savedInstanceState.putBundle(key, savedState);
AbstractListAdapterImplementation abstractListAdapter = createAdapter();
DataSetObserver dataSetObserver = new DataSetObserver();
abstractListAdapter.registerDataSetObserver(dataSetObserver);
abstractListAdapter.onRestoreInstanceState(savedInstanceState, key);
assertEquals(item1, abstractListAdapter.getItem(0));
assertEquals(item2, abstractListAdapter.getItem(1));
assertEquals(1, abstractListAdapter.getParameters().getInt("key"));
assertEquals(allowDuplicates, abstractListAdapter.areDuplicatesAllowed());
assertEquals(notifyOnChange, abstractListAdapter.isNotifiedOnChange());
assertEquals(logLevel, abstractListAdapter.getLogLevel());
assertTrue(dataSetObserver.hasOnChangedBeenCalled());
}
示例10: testOnRestoreInstanceStateWhenDataIsSerializable
/**
* Tests the functionality of the onRestoreInstanceState-method, when the adapter's underlying
* data implements the interface {@link Serializable}.
*/
public final void testOnRestoreInstanceStateWhenDataIsSerializable() {
String key = "adapterkey";
Bundle savedInstanceState = new Bundle();
SerializableImplementation item1 = new SerializableImplementation(0);
SerializableImplementation item2 = new SerializableImplementation(1);
ArrayList<Item<SerializableImplementation>> savedItems = new ArrayList<>();
savedItems.add(new Item<>(item1));
savedItems.add(new Item<>(item2));
Bundle parameters = new Bundle();
parameters.putInt("key", 1);
boolean allowDuplicates = true;
boolean notifyOnChange = false;
LogLevel logLevel = LogLevel.ERROR;
Bundle savedState = new Bundle();
savedState.putSerializable(AbstractListAdapter.SERIALIZABLE_ITEMS_BUNDLE_KEY, savedItems);
savedState.putBundle(AbstractListAdapter.PARAMETERS_BUNDLE_KEY, parameters);
savedState.putBoolean(AbstractListAdapter.ALLOW_DUPLICATES_BUNDLE_KEY, allowDuplicates);
savedState.putBoolean(AbstractListAdapter.NOTIFY_ON_CHANGE_BUNDLE_KEY, notifyOnChange);
savedState.putInt(AbstractListAdapter.LOG_LEVEL_BUNDLE_KEY, logLevel.getRank());
savedInstanceState.putBundle(key, savedState);
AbstractListAdapterImplementation abstractListAdapter = createAdapter();
DataSetObserver dataSetObserver = new DataSetObserver();
abstractListAdapter.registerDataSetObserver(dataSetObserver);
abstractListAdapter.onRestoreInstanceState(savedInstanceState, key);
assertEquals(item1, abstractListAdapter.getItem(0));
assertEquals(item2, abstractListAdapter.getItem(1));
assertEquals(1, abstractListAdapter.getParameters().getInt("key"));
assertEquals(allowDuplicates, abstractListAdapter.areDuplicatesAllowed());
assertEquals(notifyOnChange, abstractListAdapter.isNotifiedOnChange());
assertEquals(logLevel, abstractListAdapter.getLogLevel());
assertTrue(dataSetObserver.hasOnChangedBeenCalled());
}
示例11: testToString
/**
* Tests the functionality of the toString-method.
*/
public final void testToString() {
ArrayList<Item<Object>> items = new ArrayList<>();
items.add(new Item<>(new Object()));
LogLevel logLevel = LogLevel.ERROR;
boolean allowDuplicates = true;
boolean notifyOnChange = true;
Set<ListAdapterItemClickListener<Object>> itemClickListeners = new LinkedHashSet<>();
Set<ListAdapterItemLongClickListener<Object>> itemLongClickListeners =
new LinkedHashSet<>();
Set<ListAdapterListener<Object>> adapterListeners = new LinkedHashSet<>();
Set<ListEnableStateListener<Object>> enableStateListeners = new LinkedHashSet<>();
int numberOfItemStates = 2;
boolean triggerItemStateOnClick = true;
Set<ListItemStateListener<Object>> itemStateListeners = new LinkedHashSet<>();
Set<ListSortingListener<Object>> sortingListeners = new LinkedHashSet<>();
Set<ListFilterListener<Object>> filterListeners = new LinkedHashSet<>();
LinkedHashSet<AppliedFilter<Object>> appliedFilters = new LinkedHashSet<>();
Bundle parameters = new Bundle();
NoChoiceListAdapterImplementation<Object> noChoiceListAdapterImplementation =
new NoChoiceListAdapterImplementation<>(getContext(),
new ListDecoratorImplementation(), logLevel, items, allowDuplicates,
notifyOnChange, itemClickListeners, itemLongClickListeners,
adapterListeners, enableStateListeners, numberOfItemStates,
triggerItemStateOnClick, itemStateListeners, sortingListeners,
filterListeners, appliedFilters);
noChoiceListAdapterImplementation.setParameters(parameters);
assertEquals(
"ListAdapter (" + items.size() + " items) [logLevel=" + logLevel + ", parameters=" +
parameters + ", notifyOnChange=" + notifyOnChange + ", allowDuplicates=" +
allowDuplicates + ", numberOfItemStates=" + numberOfItemStates +
", triggerItemStateOnClick=" + triggerItemStateOnClick + ", filtered=" +
false + "]", noChoiceListAdapterImplementation.toString());
}