1 23 28 29 package com.sun.enterprise.tools.verifier.tests.connector; 30 31 import com.sun.enterprise.tools.verifier.Result; 32 import com.sun.enterprise.deployment.ConnectorDescriptor; 33 import com.sun.enterprise.tools.verifier.tests.*; 34 import com.sun.enterprise.deployment.xml.ConnectorTagNames; 35 36 43 public class TransactionSupport extends ConnectorTest implements ConnectorCheck { 44 45 private final String [] acceptableValues = { 46 ConnectorTagNames.DD_NO_TRANSACTION, 47 ConnectorTagNames.DD_LOCAL_TRANSACTION, 48 ConnectorTagNames.DD_XA_TRANSACTION }; 49 50 63 public Result check(ConnectorDescriptor descriptor) { 64 65 Result result = getInitializedResult(); 66 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 67 if(!descriptor.getOutBoundDefined()) 68 { 69 result.addNaDetails(smh.getLocalString 70 ("tests.componentNameConstructor", 71 "For [ {0} ]", 72 new Object [] {compName.toString()})); 73 result.notApplicable(smh.getLocalString 74 ("com.sun.enterprise.tools.verifier.tests.connector.managed.notApplicableForInboundRA", 75 "Resource Adapter does not provide outbound communication")); 76 return result; 77 } 78 String connectorTransactionSupport = 79 descriptor.getOutboundResourceAdapter().getTransSupport(); 80 81 if (connectorTransactionSupport==null) { 83 result.addErrorDetails(smh.getLocalString 84 ("tests.componentNameConstructor", 85 "For [ {0} ]", 86 new Object [] {compName.toString()})); 87 result.failed(smh.getLocalString 88 (getClass().getName() + ".nonexist", 89 "Error: No Transaction support specified for ressource adapter", 90 new Object [] {connectorTransactionSupport})); 91 return result; 92 } 93 94 for (int i=0;i<acceptableValues.length;i++) { 96 if (connectorTransactionSupport.equals(acceptableValues[i])) { 97 98 result.addGoodDetails(smh.getLocalString 100 ("tests.componentNameConstructor", 101 "For [ {0} ]", 102 new Object [] {compName.toString()})); 103 result.passed(smh.getLocalString 104 (getClass().getName() + ".passed", 105 "Transaction support [ {0} ] for ressource adapter is supported", 106 new Object [] {connectorTransactionSupport})); 107 return result; 108 } 109 } 110 111 result.addErrorDetails(smh.getLocalString 113 ("tests.componentNameConstructor", 114 "For [ {0} ]", 115 new Object [] {compName.toString()})); 116 result.failed(smh.getLocalString 117 (getClass().getName() + ".failed", 118 "Error: Deployment descriptor transaction-support [ {0} ] for ressource adapter is not valid", 119 new Object [] {connectorTransactionSupport})); 120 return result; 121 } 122 } 123 | Popular Tags |