github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

alex14n / CompactHashMap

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 6
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Tree: e2b81fb

click here to add a description

click here to add a homepage

  • Branches (5)
    • bloom-filter
    • defrag
    • hybrid
    • master
    • unsafe
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Fast and memory-compact (especially on primitive types) scala HashMap and HashSet — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Google collections tests 
alex14n (author)
Sat Jun 06 12:12:10 -0700 2009
commit  e2b81fb9ccf5446eff961d86eb3a0dc084a8a88c
tree    c176e73ef11bc19ef8f0d4a52826b091419ffc26
parent  8048cd0d4f9a61274fd1d60edf596a9a3e74fe36
CompactHashMap / test / Tests.scala test/Tests.scala
100644 85 lines (82 sloc) 3.269 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import java.util._
import java.util.Map.Entry
import java.lang.reflect.Method
import junit.framework._
import com.google.common.collect.testing._
import com.google.common.collect.testing.features._
 
// JUnit3 suite to run all tests
 
object Tests {
  def suppressForAnything: Collection[Method] = Collections.emptySet()
  def suite: Test = {
    val suite = new TestSuite()
    // Scala collections
    suite.addTest(new JUnit4TestAdapter(classOf[CompactHashSetTest]))
    suite.addTest(new JUnit4TestAdapter(classOf[CompactHashMapTest]))
    // Java collections
    suite.addTest(new JUnit4TestAdapter(classOf[FastHashMapTest]))
    suite.addTest(new JUnit4TestAdapter(classOf[FastHashSetTest]))
    suite.addTest(new JUnit4TestAdapter(classOf[FastLinkedHashMapTest]))
    suite.addTest(new JUnit4TestAdapter(classOf[FastLinkedHashSetTest]))
    // Google tests
    suite.addTest(MapTestSuiteBuilder
        .using(new TestStringMapGenerator() {
            override def create(entries: Array[Entry[String,String]]): Map[String,String] = {
              val map = new FastHashMap[String,String]
              for(e <- entries) map.put(e.getKey, e.getValue)
              map
          }})
        .named("FastHashMap")
        .withFeatures(
            MapFeature.GENERAL_PURPOSE,
            MapFeature.ALLOWS_NULL_KEYS,
            MapFeature.ALLOWS_NULL_VALUES,
            CollectionFeature.KNOWN_ORDER,
            CollectionSize.ANY)
        .suppressing(suppressForAnything)
        .createTestSuite());
    suite.addTest(MapTestSuiteBuilder
        .using(new TestStringMapGenerator() {
            override def create(entries: Array[Entry[String,String]]): Map[String,String] = {
              val map = new FastLinkedHashMap[String,String]
              for(e <- entries) map.put(e.getKey, e.getValue)
              map
          }})
        .named("FastLinkedHashMap")
        .withFeatures(
            MapFeature.GENERAL_PURPOSE,
            MapFeature.ALLOWS_NULL_KEYS,
            MapFeature.ALLOWS_NULL_VALUES,
            CollectionFeature.KNOWN_ORDER,
            CollectionSize.ANY)
        .suppressing(suppressForAnything)
        .createTestSuite());
    suite.addTest(SetTestSuiteBuilder
        .using(new TestStringSetGenerator() {
            override def create(entries: Array[String]): Set[String] =
              new FastHashSet[String](MinimalCollection.of(entries: _*))
          })
        .named("FastHashSet")
        .withFeatures(
            SetFeature.GENERAL_PURPOSE,
            CollectionFeature.ALLOWS_NULL_VALUES,
            CollectionFeature.KNOWN_ORDER,
            CollectionSize.ANY)
        .suppressing(suppressForAnything)
        .createTestSuite());
    suite.addTest(SetTestSuiteBuilder
        .using(new TestStringSetGenerator() {
            override def create(entries: Array[String]): Set[String] =
              new FastLinkedHashSet[String](MinimalCollection.of(entries: _*))
          })
        .named("FastLinkedHashSet")
        .withFeatures(
            SetFeature.GENERAL_PURPOSE,
            CollectionFeature.ALLOWS_NULL_VALUES,
            CollectionFeature.KNOWN_ORDER,
            CollectionSize.ANY)
        .suppressing(suppressForAnything)
        .createTestSuite());
    //
    suite
  }
}
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server