cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r724557 - in /cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/common/ wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/ wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxb/
Date Mon, 08 Dec 2008 23:57:02 GMT
Author: bimargulies
Date: Mon Dec  8 15:57:02 2008
New Revision: 724557

URL: http://svn.apache.org/viewvc?rev=724557&view=rev
Log:
Add error message to stop users from trying to get useful work out of 
-npa until JAX-B supports it through the API we depend upon.

This is relevant to CXF-1934.

Modified:
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolException.java
    cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
    cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/Messages.properties
    cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxb/JAXBCodeGenOptionTest.java

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolException.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolException.java?rev=724557&r1=724556&r2=724557&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolException.java (original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolException.java Mon
Dec  8 15:57:02 2008
@@ -18,7 +18,13 @@
  */
 
 package org.apache.cxf.tools.common;
+import java.util.logging.Logger;
+
 import org.apache.cxf.common.i18n.Message;
+
+/**
+ * Exception used for unrecoverable error in a CXF tool.
+ */
 public class ToolException extends RuntimeException {
 
     
@@ -44,7 +50,13 @@
     public ToolException(Throwable t) {
         super(t);
     }
-    
-
+    /**
+     * Construct message from message property bundle and logger.
+     * @param messageId
+     * @param logger
+     */
+    public ToolException(String messageId, Logger logger) {
+        this(new Message(messageId, logger));
+    }
 }
 

Modified: cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java?rev=724557&r1=724556&r2=724557&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
(original)
+++ cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
Mon Dec  8 15:57:02 2008
@@ -160,6 +160,9 @@
             StringTokenizer tokenizer = new StringTokenizer(xjcArgs, ",", false);
             while (tokenizer.hasMoreTokens()) {
                 String arg = tokenizer.nextToken();
+                if ("-npa".equalsIgnoreCase(arg)) {
+                    throw new ToolException("NPA_NOT_SUPPORTED", LOG);
+                }
                 args.add(arg);
                 LOG.log(Level.FINE, "xjc arg:" + arg);
             }

Modified: cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/Messages.properties?rev=724557&r1=724556&r2=724557&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/Messages.properties
(original)
+++ cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/Messages.properties
Mon Dec  8 15:57:02 2008
@@ -18,10 +18,10 @@
 #    under the License.
 #
 #
-GENERATE_TYPES_ERROR = Generate types error
-FAIL_TO_GENERATE_TYPES = Fail to generate types
-FAIL_TO_CREATE_JAXBBINIDNG_FILE = Fail to create jaxb binding file for customizing the namepace
to package mapping
-
+GENERATE_TYPES_ERROR = Error generating types.
+FAIL_TO_GENERATE_TYPES = Failed to generate types.
+FAIL_TO_CREATE_JAXBBINIDNG_FILE = Fail to create a JAX-B binding file to customize the namepace
to package mapping
+NPA_NOT_SUPPORTED = The -npa option does not work due to bugzilla entry 576 in the JAX-B
reference implementation.
 
 
 

Modified: cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxb/JAXBCodeGenOptionTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxb/JAXBCodeGenOptionTest.java?rev=724557&r1=724556&r2=724557&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxb/JAXBCodeGenOptionTest.java
(original)
+++ cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxb/JAXBCodeGenOptionTest.java
Mon Dec  8 15:57:02 2008
@@ -21,12 +21,13 @@
 import java.io.File;
 
 import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.wsdlto.AbstractCodeGenTest;
 import org.junit.Test;
 
 public class JAXBCodeGenOptionTest extends AbstractCodeGenTest {
    
-    @org.junit.Ignore
+    @org.junit.Ignore // CXF-1934
     @Test
     public void testJaxbNpa() throws Exception {
         env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/echo_date.wsdl"));
@@ -39,7 +40,15 @@
         File piFile = 
             new File(output, "org/apache/cxf/tools/fortest/date/package-info.java");
         assertFalse(piFile.getAbsolutePath(), piFile.exists());
+    }
 
+    // this case exists only until we can fix CXF-1934
+    @Test(expected = ToolException.class)
+    public void testJaxbNpaError() throws Exception {
+        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/echo_date.wsdl"));
+        env.put(ToolConstants.CFG_XJC_ARGS, "-npa"); 
+        processor.setContext(env);
+        processor.execute();
     }
 
 }



Mime
View raw message