mitreid-connect
クラス | 公開メンバ関数 | 全メンバ一覧
org.mitre.data.AbstractPageOperationTemplateTest クラス
org.mitre.data.AbstractPageOperationTemplateTest 連携図
Collaboration graph

クラス

class  CountingPageOperation
 
class  EmptyPageCountingPageOperation
 
class  EvenExceptionCountingPageOperation
 
class  NullPageCountingPageOperation
 

公開メンバ関数

void setUp () throws Exception
 
void execute_zeropages ()
 
void execute_singlepage ()
 
void execute_negpage ()
 
void execute_npage ()
 
void execute_nullpage ()
 
void execute_emptypage ()
 
void execute_zerotime ()
 
void execute_nonzerotime ()
 
void execute_negtime ()
 
void execute_swallowException ()
 
void execute_noSwallowException ()
 

詳解

著者
Colm Smyth

関数詳解

◆ execute_emptypage()

void org.mitre.data.AbstractPageOperationTemplateTest.execute_emptypage ( )
inline
81  {
82  CountingPageOperation op = new EmptyPageCountingPageOperation(Integer.MAX_VALUE, Long.MAX_VALUE);
83  op.execute();
84 
85  assertEquals(0L, op.getCounter());
86  }

◆ execute_negpage()

void org.mitre.data.AbstractPageOperationTemplateTest.execute_negpage ( )
inline
56  {
57  CountingPageOperation op = new CountingPageOperation(-1,Long.MAX_VALUE);
58  op.execute();
59 
60  assertEquals(0L, op.counter);
61  }

◆ execute_negtime()

void org.mitre.data.AbstractPageOperationTemplateTest.execute_negtime ( )
inline
116  {
117  Long timeMillis = -100L;
118  CountingPageOperation op = new CountingPageOperation(Integer.MAX_VALUE,timeMillis);
119  op.execute();
120 
121  assertEquals(0L, op.getCounter());
122  }

◆ execute_nonzerotime()

void org.mitre.data.AbstractPageOperationTemplateTest.execute_nonzerotime ( )
inline
103  {
104  Long timeMillis = 200L;
105  CountingPageOperation op = new CountingPageOperation(Integer.MAX_VALUE,timeMillis);
106  op.execute();
107 
108  assertFalse("last fetch time " + op.getTimeToLastFetch() + "" +
109  " and previous fetch time " + op.getTimeToPreviousFetch() +
110  " exceed max time" + timeMillis,
111  op.getTimeToLastFetch() > timeMillis
112  && op.getTimeToPreviousFetch() > timeMillis);
113  }

◆ execute_noSwallowException()

void org.mitre.data.AbstractPageOperationTemplateTest.execute_noSwallowException ( )
inline
134  {
135  CountingPageOperation op = new EvenExceptionCountingPageOperation(1, 1000L);
136  op.setSwallowExceptions(false);
137 
138  try {
139  op.execute();
140  }finally {
141  assertEquals(1L, op.getCounter());
142  }
143  }

◆ execute_npage()

void org.mitre.data.AbstractPageOperationTemplateTest.execute_npage ( )
inline
64  {
65  int n = 7;
66  CountingPageOperation op = new CountingPageOperation(n,Long.MAX_VALUE);
67  op.execute();
68 
69  assertEquals(n*10L, op.counter);
70  }

◆ execute_nullpage()

void org.mitre.data.AbstractPageOperationTemplateTest.execute_nullpage ( )
inline
73  {
74  CountingPageOperation op = new NullPageCountingPageOperation(Integer.MAX_VALUE, Long.MAX_VALUE);
75  op.execute();
76 
77  assertEquals(0L, op.getCounter());
78  }

◆ execute_singlepage()

void org.mitre.data.AbstractPageOperationTemplateTest.execute_singlepage ( )
inline
48  {
49  CountingPageOperation op = new CountingPageOperation(1,Long.MAX_VALUE);
50  op.execute();
51 
52  assertEquals(10L, op.counter);
53  }

◆ execute_swallowException()

void org.mitre.data.AbstractPageOperationTemplateTest.execute_swallowException ( )
inline
125  {
126  CountingPageOperation op = new EvenExceptionCountingPageOperation(1, 1000L);
127  op.execute();
128 
129  assertTrue(op.isSwallowExceptions());
130  assertEquals(5L, op.getCounter());
131  }

◆ execute_zeropages()

void org.mitre.data.AbstractPageOperationTemplateTest.execute_zeropages ( )
inline
40  {
41  CountingPageOperation op = new CountingPageOperation(0,Long.MAX_VALUE);
42  op.execute();
43 
44  assertEquals(0L, op.counter);
45  }

◆ execute_zerotime()

void org.mitre.data.AbstractPageOperationTemplateTest.execute_zerotime ( )
inline
89  {
90  CountingPageOperation op = new CountingPageOperation(Integer.MAX_VALUE,0L);
91  op.execute();
92 
93  assertEquals(0L, op.getCounter());
94  assertEquals(0L, op.getTimeToLastFetch());
95  }

◆ setUp()

void org.mitre.data.AbstractPageOperationTemplateTest.setUp ( ) throws Exception
inline
36  {
37  }

このクラス詳解は次のファイルから抽出されました: