8
8
import com .arjuna .ats .arjuna .common .recoveryPropertyManager ;
9
9
import com .arjuna .ats .arjuna .tools .osb .mbean .ActionBean ;
10
10
import com .arjuna .ats .arjuna .tools .osb .mbean .LogRecordWrapper ;
11
+ import com .arjuna .ats .arjuna .tools .osb .mbean .OSBTypeHandler ;
11
12
import com .arjuna .ats .arjuna .tools .osb .mbean .OSEntryBean ;
12
13
import com .arjuna .ats .arjuna .tools .osb .mbean .ObjStoreBrowser ;
13
14
import com .arjuna .ats .arjuna .tools .osb .mbean .UidWrapper ;
23
24
import org .junit .Before ;
24
25
import org .junit .Test ;
25
26
27
+ import java .io .File ;
26
28
import java .net .URI ;
27
29
28
30
import static org .junit .Assert .assertEquals ;
@@ -35,7 +37,7 @@ public class ObjStoreBrowserLRATest {
35
37
private RecoveryManagerImple recoveryManager ;
36
38
private ObjStoreBrowser osb ;
37
39
38
- private static String [][] LRA_OSB_TYPES = {
40
+ private final static String [][] LRA_OSB_TYPES = {
39
41
// osTypeClassName, beanTypeClassName - see com.arjuna.ats.arjuna.tools.osb.mbean.ObjStoreBrowser
40
42
{LongRunningAction .getType ().substring (1 ), LongRunningAction .class .getName (), LRAActionBean .class .getName ()},
41
43
{FailedLongRunningAction .getType ().substring (1 ), FailedLongRunningAction .class .getName (), LRAActionBean .class .getName ()}
@@ -49,9 +51,11 @@ public void setUp() {
49
51
recoveryManager .addModule (new LRARecoveryModule ());
50
52
51
53
// initiating the ObjStoreBrowser
52
- osb = new ObjStoreBrowser ();
54
+ osb = ObjStoreBrowser . getInstance ();
53
55
for (String [] typeAndBean : LRA_OSB_TYPES ) {
54
- assertTrue (osb .addType (typeAndBean [0 ], typeAndBean [1 ], typeAndBean [2 ]));
56
+ String typeName = typeAndBean [0 ].replace ("/" , File .separator );
57
+ osb .addOSBTypeHandler (typeName , new OSBTypeHandler (true , true , typeAndBean [1 ], typeAndBean [2 ],
58
+ typeAndBean [0 ], null , this .getClass ().getClassLoader ()));
55
59
}
56
60
osb .start ();
57
61
}
0 commit comments