Search in sources :

Example 16 with SimpleImmutableEntry

use of java.util.AbstractMap.SimpleImmutableEntry in project jmeter by apache.

the class ObjectTableSorterTest method fixLastRowWithDescendingValue.

@Test
public void fixLastRowWithDescendingValue() {
    sorter.fixLastRow().setSortKey(new SortKey(1, SortOrder.DESCENDING));
    List<SimpleImmutableEntry<String, Integer>> expected = asList(d4(), a3(), b2(), c1());
    assertRowOrderAndIndexes(expected);
}
Also used : SimpleImmutableEntry(java.util.AbstractMap.SimpleImmutableEntry) SortKey(javax.swing.RowSorter.SortKey) Test(org.junit.Test)

Example 17 with SimpleImmutableEntry

use of java.util.AbstractMap.SimpleImmutableEntry in project jmeter by apache.

the class ObjectTableSorterTest method sortKeyDescending.

@Test
public void sortKeyDescending() {
    sorter.setSortKey(new SortKey(0, SortOrder.DESCENDING));
    List<SimpleImmutableEntry<String, Integer>> expected = asList(d4(), c1(), b2(), a3());
    assertRowOrderAndIndexes(expected);
}
Also used : SimpleImmutableEntry(java.util.AbstractMap.SimpleImmutableEntry) SortKey(javax.swing.RowSorter.SortKey) Test(org.junit.Test)

Example 18 with SimpleImmutableEntry

use of java.util.AbstractMap.SimpleImmutableEntry in project jmeter by apache.

the class ObjectTableSorterTest method sortValueDescending.

@Test
public void sortValueDescending() {
    sorter.setSortKey(new SortKey(1, SortOrder.DESCENDING));
    List<SimpleImmutableEntry<String, Integer>> expected = asList(d4(), a3(), b2(), c1());
    assertRowOrderAndIndexes(expected);
}
Also used : SimpleImmutableEntry(java.util.AbstractMap.SimpleImmutableEntry) SortKey(javax.swing.RowSorter.SortKey) Test(org.junit.Test)

Example 19 with SimpleImmutableEntry

use of java.util.AbstractMap.SimpleImmutableEntry in project jmeter by apache.

the class ObjectTableSorterTest method sortValueAscending.

@Test
public void sortValueAscending() {
    sorter.setSortKey(new SortKey(1, SortOrder.ASCENDING));
    List<SimpleImmutableEntry<String, Integer>> expected = asList(c1(), b2(), a3(), d4());
    assertRowOrderAndIndexes(expected);
}
Also used : SimpleImmutableEntry(java.util.AbstractMap.SimpleImmutableEntry) SortKey(javax.swing.RowSorter.SortKey) Test(org.junit.Test)

Example 20 with SimpleImmutableEntry

use of java.util.AbstractMap.SimpleImmutableEntry in project streamsx.topology by IBMStreams.

the class CollectionTupleTest method _testMap.

private static TStream<String> _testMap() throws Exception {
    final Topology topology = newTopology();
    List<Map<String, Integer>> tuples = new ArrayList<>();
    Map<String, Integer> map = new TreeMap<>();
    map.put("A", 8);
    map.put("B", 32);
    tuples.add(map);
    map = new TreeMap<>();
    map.put("C", 9);
    map.put("D", 73);
    map.put("E", 56);
    tuples.add(map);
    TStream<Map<String, Integer>> data = topology.constants(tuples);
    TStream<SimpleImmutableEntry<String, Integer>> entries = CollectionStreams.flattenMap(data);
    return StringStreams.toString(entries);
}
Also used : SimpleImmutableEntry(java.util.AbstractMap.SimpleImmutableEntry) ArrayList(java.util.ArrayList) Topology(com.ibm.streamsx.topology.Topology) TestTopology(com.ibm.streamsx.topology.test.TestTopology) TreeMap(java.util.TreeMap) TreeMap(java.util.TreeMap) Map(java.util.Map)

Aggregations

SimpleImmutableEntry (java.util.AbstractMap.SimpleImmutableEntry)29 Test (org.junit.Test)19 FakeProcess (com.facebook.buck.util.FakeProcess)9 FakeProcessExecutor (com.facebook.buck.util.FakeProcessExecutor)9 ImmutableList (com.google.common.collect.ImmutableList)9 SortKey (javax.swing.RowSorter.SortKey)9 HashMap (java.util.HashMap)5 NonNull (android.support.annotation.NonNull)4 WorkerThread (android.support.annotation.WorkerThread)4 StorIOException (com.pushtorefresh.storio.StorIOException)4 Entry (java.util.Map.Entry)4 GeneratorState (com.github.anba.es6draft.compiler.CodeVisitor.GeneratorState)2 LabelState (com.github.anba.es6draft.compiler.CodeVisitor.LabelState)2 Completion (com.github.anba.es6draft.compiler.StatementGenerator.Completion)2 MethodCode (com.github.anba.es6draft.compiler.assembler.Code.MethodCode)2 ContentResolverTypeMapping (com.pushtorefresh.storio.contentresolver.ContentResolverTypeMapping)2 StorIOContentResolver (com.pushtorefresh.storio.contentresolver.StorIOContentResolver)2 SQLiteTypeMapping (com.pushtorefresh.storio.sqlite.SQLiteTypeMapping)2 StorIOSQLite (com.pushtorefresh.storio.sqlite.StorIOSQLite)2 ArrayList (java.util.ArrayList)2