1 23 package com.sun.enterprise.tools.verifier.tests.webservices; 24 25 import com.sun.enterprise.deployment.*; 26 import com.sun.enterprise.tools.verifier.*; 27 import com.sun.enterprise.tools.verifier.tests.*; 28 29 32 33 40 41 public class SEIExtendsRemoteCheck extends WSTest implements WSCheck { 42 43 47 public Result check (WebServiceEndpoint descriptor) { 48 Result result = getInitializedResult(); 49 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 50 String s = descriptor.getServiceEndpointInterface(); 52 if (s == null) { 53 result.failed(smh.getLocalString 55 ("com.sun.enterprise.tools.verifier.tests.webservices.Error", 56 "Error: Unexpected error occurred [ {0} ]", 57 new Object [] {"SEI Class Name Null"})); 58 return result; 59 60 } 61 Class sei = null; 62 try { 63 sei = Class.forName(s, false, getVerifierContext().getClassLoader()); 64 } catch(ClassNotFoundException e) { 65 addErrorDetails(result, compName); 66 result.failed(smh.getLocalString 67 ("com.sun.enterprise.tools.verifier.tests.webservices.Error", 68 "Error: Unexpected error occurred [ {0} ]", 69 new Object [] {e.toString()})); 70 71 return result; 72 } 73 if (!(getVerifierContext().getSchemaVersion().compareTo("1.1") > 0)) { 74 if(!java.rmi.Remote .class.isAssignableFrom(sei)) { 75 result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor", 76 "For [ {0} ]", new Object [] {compName.toString()})); 77 result.failed(smh.getLocalString(getClass().getName() + ".failed", 78 "SEI [{0}] does not extend the java.rmi.Remote interface.", 79 new Object [] {s})); 80 } 81 } else if (java.rmi.Remote .class.isAssignableFrom(sei)) { 82 result.addWarningDetails(smh.getLocalString ("tests.componentNameConstructor", 83 "For [ {0} ]", new Object [] {compName.toString()})); 84 result.warning(smh.getLocalString(getClass().getName() + ".warning", 85 "SEI [{0}] is not required to extend the java.rmi.Remote interface.", 86 new Object [] {s})); 87 } 88 if(result.getStatus() != Result.FAILED 89 && result.getStatus() != Result.WARNING) { 90 addGoodDetails(result, compName); 91 result.passed(smh.getLocalString(getClass().getName() + ".passed", 92 "Service Enpoint is defined properly")); 93 } 94 return result; 95 } 96 } 97 98 | Popular Tags |