stevel 2003/07/18 00:16:23
Modified: java build.xml
java/src/org/apache/axis/client HappyClient.java
java/src/org/apache/axis/i18n resource.properties
java/test/utils TestSrcContent.java
Log:
i18n version of happyclient, plus build.xml task to run it. Are we feeling happy yet?
Revision Changes Path
1.233 +13 -0 xml-axis/java/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-axis/java/build.xml,v
retrieving revision 1.232
retrieving revision 1.233
diff -u -r1.232 -r1.233
--- build.xml 15 Jul 2003 05:01:24 -0000 1.232
+++ build.xml 18 Jul 2003 07:16:23 -0000 1.233
@@ -540,4 +540,17 @@
<param name="cvsweb" expression="http://cvs.apache.org/viewcvs/"/>
</style>
</target>
+
+ <target name="happyclient" depends="compile">
+ <java classname="org.apache.axis.client.HappyClient"
+ fork="true"
+ failonerror="true">
+ <classpath>
+ <fileset dir="${build.lib}">
+ <include name="*.jar"/>
+ </fileset>
+ </classpath>
+ </java>
+
+ </target>
</project>
1.3 +68 -72 xml-axis/java/src/org/apache/axis/client/HappyClient.java
Index: HappyClient.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/HappyClient.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HappyClient.java 17 Jul 2003 05:45:46 -0000 1.2
+++ HappyClient.java 18 Jul 2003 07:16:23 -0000 1.3
@@ -55,6 +55,8 @@
package org.apache.axis.client;
+import org.apache.axis.utils.Messages;
+
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import java.io.InputStream;
@@ -122,41 +124,40 @@
String homePage) throws IOException {
String url = "";
if (homePage != null) {
- url = "\n fetch this from " + homePage+"\n";
- }
- String jarlocation="";
- if (jarFile != null) {
- jarlocation =" from file "+jarFile;
+ url=Messages.getMessage("happyClientHomepage",homePage);
}
String errorLine="";
if (errorText != null) {
- errorLine="\n" + errorText;
+ errorLine=Messages.getMessage(errorText);
}
try {
Class clazz = classExists(classname);
if (clazz == null) {
- out.print(category);
- out.print(": could not find class ");
- out.print(classname);
- out.print(jarlocation);
- out.println(errorLine);
+ String text;
+ text=Messages.getMessage("happyClientMissingClass",
+ category,classname,jarFile);
+ out.println(text);
+ out.println(url);
return 1;
} else {
String location = getLocation(clazz);
+ String text;
if (location == null) {
- out.println("Found " + description + " (" + classname + ")");
+ text=Messages.getMessage("happyClientFoundDescriptionClass",
+ description,classname);
} else {
- out.println("Found " + description + " (" + classname + ") \n
at " + location);
+ text =
Messages.getMessage("happyClientFoundDescriptionClassLocation",
+ description, classname,location);
}
+ out.println(text);
return 0;
}
} catch (NoClassDefFoundError ncdfe) {
- out.println(category + ": could not find a dependency"
- + " of class " + classname);
- out.print(jarlocation);
- out.print(errorLine);
+ out.println(Messages.getMessage("happyClientNoDependency",
+ category, classname, jarFile));
+ out.println(errorLine);
out.println(url);
- out.println("The root cause was: " + ncdfe.getMessage());
+ out.println(ncdfe.getMessage());
return 1;
}
}
@@ -185,7 +186,7 @@
}
} catch (Throwable t) {
}
- return "an unknown location";
+ return Messages.getMessage("happyClientUnknownLocation");
}
/**
@@ -204,7 +205,7 @@
String errorText,
String homePage) throws IOException {
return probeClass(
- "Error",
+ Messages.getMessage("happyClientError"),
classname,
jarFile,
description,
@@ -228,7 +229,7 @@
String errorText,
String homePage) throws IOException {
return probeClass(
- "Warning",
+ Messages.getMessage("happyClientWarning"),
classname,
jarFile,
description,
@@ -246,12 +247,11 @@
String resource,
String errorText) throws Exception {
if (!resourceExists(resource)) {
- out.println("Warning: could not find resource " + resource
- + "\n"
- + errorText);
+ out.println(Messages.getMessage("happyClientNoResource",resource));
+ out.println(errorText);
return 0;
} else {
- out.println("found " + resource);
+ out.println(Messages.getMessage("happyClientFoundResource", resource));
return 1;
}
}
@@ -264,7 +264,7 @@
private String getParserName() {
SAXParser saxParser = getSAXParser();
if (saxParser == null) {
- return "Could not create an XML Parser";
+ return Messages.getMessage("happyClientNoParser");
}
// check to what is in the classname
@@ -335,8 +335,10 @@
private void title(String title) {
out.println();
- out.println(title);
- for(int i=0;i<title.length();i++) {
+ String message=Messages.getMessage(title);
+ out.println(message);
+ //subtitle
+ for(int i=0;i< message.length();i++) {
out.print("=");
}
out.println();
@@ -349,83 +351,83 @@
*/
public boolean verifyClientIsHappy(boolean warningsAsErrors) throws
IOException {
int needed = 0,wanted = 0;
-
- title("Verifying Axis client configuration");
- title("Needed components");
+ out.println();
+ title("happyClientTitle");
+ title("happyClientNeeded");
/**
* the essentials, without these Axis is not going to work
*/
needed = needClass("javax.xml.soap.SOAPMessage",
"saaj.jar",
- "SAAJ API",
- "Axis will not work",
+ "SAAJ",
+ "happyClientNoAxis",
"http://xml.apache.org/axis/");
needed += needClass("javax.xml.rpc.Service",
"jaxrpc.jar",
- "JAX-RPC API",
- "Axis will not work",
+ "JAX-RPC",
+ "happyClientNoAxis",
"http://xml.apache.org/axis/");
needed += needClass("org.apache.commons.discovery.Resource",
"commons-discovery.jar",
"Jakarta-Commons Discovery",
- "Axis will not work",
+ "happyClientNoAxis",
"http://jakarta.apache.org/commons/discovery.html");
needed += needClass("org.apache.commons.logging.Log",
"commons-logging.jar",
"Jakarta-Commons Logging",
- "Axis will not work",
+ "happyClientNoAxis",
"http://jakarta.apache.org/commons/logging.html");
//all refs to log4j are split to get past the package tester
needed += needClass("org.apache" + ".log" +"4j" +".Layout",
"log4"+"j-1.2.4.jar",
"Log4"+"j",
- "Axis logging may be downgraded",
+ "happyClientNoLog4J",
"http://jakarta.apache.org/log"+"4j");
//should we search for a javax.wsdl file here, to hint that it needs
//to go into an approved directory? because we dont seem to need to do that.
needed += needClass("com.ibm.wsdl.factory.WSDLFactoryImpl",
"wsdl4j.jar",
- "IBM's WSDL4Java",
- "Axis will not work",
+ "WSDL4Java",
+ "happyClientNoAxis",
null);
needed += needClass("javax.xml.parsers.SAXParserFactory",
"xerces.jar",
- "JAXP implementation",
- "Axis will not work",
+ "JAXP",
+ "happyClientNoAxis",
"http://xml.apache.org/xerces-j/");
- title("Optional Components");
+ title("happyClientOptional");
wanted += wantClass("javax.mail.internet.MimeMessage",
"mail.jar",
- "Mail API",
- "Attachments will not work",
+ "Mail",
+ "happyClientNoAttachments",
"http://java.sun.com/products/javamail/");
wanted += wantClass("javax.activation.DataHandler",
"activation.jar",
- "Activation API",
- "Attachments will not work",
+ "Activation",
+ "happyClientNoAttachments",
"http://java.sun.com/products/javabeans/glasgow/jaf.html");
wanted += wantClass("org.apache.xml.security.Init",
"xmlsec.jar",
- "XML Security API",
- "XML Security is not supported",
+ "XML Security",
+ "happyClientNoSecurity",
"http://xml.apache.org/security/");
wanted += wantClass("javax.net.ssl.SSLSocketFactory",
- "jsse.jar or java1.4+ runtime",
+ Messages.getMessage("happyClientJSSEsources"),
"Java Secure Socket Extension",
- "https is not supported",
+ "happyClientNoHTTPS",
"http://java.sun.com/products/jsse/");
@@ -436,56 +438,50 @@
String xmlParser = getParserName();
String xmlParserLocation = getParserLocation();
- out.println("\nXML parser :" + xmlParser + "\n from " + xmlParserLocation);
+ out.println(Messages.getMessage("happyClientXMLinfo",
+ xmlParser,xmlParserLocation));
if (xmlParser.indexOf("xerces") <= 0) {
warningMessages++;
out.println();
- out.println("Axis recommends Xerces 2 "
- + "(http://xml.apache.org/xerces2-j) as the XML Parser");
+ out.println(Messages.getMessage("happyClientRecommendXerces"));
}
if (getJavaVersionNumber() < 13) {
warningMessages++;
out.println();
- out.println("Warning: Axis does not support this version of Java. \n"
- + " Use at your own risk, and do not file bug reports if
something fails");
+ out.println(Messages.getMessage("happyClientUnsupportedJVM"));
}
/* add more libraries here */
//print the summary information
boolean happy;
- title("Summary");
+ title("happyClientSummary");
//is everythng we need here
if (needed == 0) {
//yes, be happy
- out.println("The core axis libraries are present.");
+ out.println(Messages.getMessage("happyClientCorePresent"));
happy=true;
} else {
happy=false;
//no, be very unhappy
- out.println(""
- + needed
- + " core axis librar"
- + (needed == 1 ? "y is" : "ies are")
- + " missing");
+ out.println(Messages.getMessage("happyClientCoreMissing",
+ Integer.toString(needed)));
}
//now look at wanted stuff
if (wanted > 0) {
- out.println("\n"
- + wanted
- + " optional axis librar"
- +(wanted==1?"y is":"ies are")
- +" missing");
+ out.println();
+ out.println(Messages.getMessage("happyClientOptionalMissing",
+ Integer.toString(wanted)));
+ out.println(Messages.getMessage("happyClientOptionalOK"));
if (warningsAsErrors) {
happy = false;
}
} else {
- out.println("The optional components are present.");
+ out.println(Messages.getMessage("happyClientOptionalPresent"));
}
if (warningMessages > 0) {
- out.println("\n"
- + warningMessages
- + " warning message(s) were printed");
+ out.println(Messages.getMessage("happyClientWarningMessageCount",
+ Integer.toString(warningMessages)));
if (warningsAsErrors) {
happy = false;
}
1.65 +36 -1 xml-axis/java/src/org/apache/axis/i18n/resource.properties
Index: resource.properties
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/i18n/resource.properties,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- resource.properties 17 Jul 2003 02:48:16 -0000 1.64
+++ resource.properties 18 Jul 2003 07:16:23 -0000 1.65
@@ -1160,4 +1160,39 @@
autoRegServletInit00=Auto registering WSDD files
autoRegServletLoaded01=Loaded {0}
autoRegServletApplyAndSaveSettings00=applyAndSaveSettings()
-autoRegServletLoadFailed01=Failed to load {0}
\ No newline at end of file
+autoRegServletLoadFailed01=Failed to load {0}
+
+happyClientNoAxis=Axis will not work
+happyClientNoAttachments=Attachments will not work
+happyClientNoSecurity=XML Security is not supported
+happyClientNoHTTPS=HTTPS is not available
+
+#note in happyClientNoLog4J do not translate Log4J
+happyClientNoLog4J=Logging will not use Log4J
+
+#note, in happyClientRecommendXerces do not translate xerces, or the URL
+happyClientRecommendXerces=Axis recommends Xerces2
(http://xml.apache.org/xerces2-j) as the XML Parser
+happyClientUnsupportedJVM=Axis does not support this version of Java -please upgrade
+happyClientNoParser=Could not create an XML Parser
+happyClientXMLinfo=XML Parser is {0} from {1}
+happyClientJSSEsources=jsse.jar or Java1.4 or later
+happyClientFoundDescriptionClassLocation=Found {0} ({1}) \n at {2}
+happyClientFoundDescriptionClass=Found {0} ({1})
+happyClientWarning=Error
+happyClientError=Warning
+happyClientUnknownLocation=an unknown location
+happyClientNoResource=Warning: could not find resource {0}
+happyClientFoundResource=Found resource {0}
+happyClientHomepage=See the web page {0}
+happyClientMissingClass={0}: could not find class {1} from file {2}
+happyClientNoDependency={0} could not find a dependency of class {1} from file {2}
+happyClientTitle=Validating client configuration
+happyClientNeeded=Needed components
+happyClientOptional=Optional components
+happyClientSummary=Summary
+happyClientCorePresent=The core Axis libraries are present
+happyClientCoreMissing=Axis is missing {0} component(s)
+happyClientOptionalPresent=The optional components are present.
+happyClientOptionalMissing=Axis is missing {0} component(s)
+happyClientOptionalOK=Provided the missing functionality is not needed, the client
will work
+happyClientWarningMessageCount={0} warning message(s) were printed
\ No newline at end of file
1.19 +2 -2 xml-axis/java/test/utils/TestSrcContent.java
Index: TestSrcContent.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/utils/TestSrcContent.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- TestSrcContent.java 17 Jul 2003 02:48:17 -0000 1.18
+++ TestSrcContent.java 18 Jul 2003 07:16:23 -0000 1.19
@@ -144,11 +144,11 @@
// "org\\.apache\\.log4j", false),
new FileNameContentPattern(".+([\\\\/])"
+ "java\\1"
- +
"(?!src\\1org\\1apache\\1axis\\1client\\1HappyClient\\.java)"
+// +
"(?!src\\1org\\1apache\\1axis\\1client\\1HappyClient\\.java)"
+ "([a-zA-Z0-9_]+\\1)*"
+ "[^\\\\/]+\\.java",
"org\\.apache\\.log4j", false),
-
+
// Verify that axis java files do not use System.out.println
// or System.err.println, except:
// - utils/tcpmon.java