/[storm]/storm/org/nongnu/storm/IndexedPool.meta
ViewVC logotype

Diff of /storm/org/nongnu/storm/IndexedPool.meta

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by benja, Mon Apr 7 20:16:28 2003 UTC revision 1.3 by benja, Mon Apr 7 23:27:54 2003 UTC
# Line 23  Line 23 
23  # Tests for IndexedPool implementations  # Tests for IndexedPool implementations
24    
25  # Requires attribute:  # Requires attribute:
26  # pool(indexTypes) -- a method taking a list of index types  # Pool(indexTypes) -- a method taking a list of index types
27  #                     and returning the appropriate IndexedPool  #                     and returning the appropriate IndexedPool
28    
29  import java, org  import java, org
30  import jarray  import jarray
31    
32    execfile('org/nongnu/storm/StormPool.meta')
33    
34    def setUp():
35        global pool
36        pool = Pool([])
37    
38  def set(list):  def set(list):
39      set = java.util.HashSet()      set = java.util.HashSet()
40      for el in list: set.add(el)      for el in list: set.add(el)
41      return set      return set
42    
43  def testNonavailableIndexRaisesException():  def testNonavailableIndexRaisesException():
44      p = pool([])      p = Pool([])
45      try:      try:
46          p.getIndex("http://example.com/no-such-index")          p.getIndex("http://example.com/no-such-index")
47      except java.util.NoSuchElementException:      except java.util.NoSuchElementException:
# Line 44  def testNonavailableIndexRaisesException Line 50  def testNonavailableIndexRaisesException
50          assert 0          assert 0
51    
52  def testContentTypeIndex():  def testContentTypeIndex():
53      p = pool([org.nongnu.storm.util.ContentTypeIndexType()])      p = Pool([org.nongnu.storm.util.ContentTypeIndexType()])
54      i = p.getIndex(org.nongnu.storm.util.ContentTypeIndexType.contentTypeIndexTypeURI)      i = p.getIndex(org.nongnu.storm.util.ContentTypeIndexType.contentTypeIndexTypeURI)
55    
56      assert i != None      assert i != None

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26