[GitHub] johnament commented on issue #352: Config handling for MP rest client

2017-12-06 Thread GitBox
johnament commented on issue #352: Config handling for MP rest client
URL: https://github.com/apache/cxf/pull/352#issuecomment-349835011
 
 
   This one is `ProviderFactory.comparePriorityStatus` only considers the 
annotation, not the registered priority.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] johnament commented on issue #352: Config handling for MP rest client

2017-12-06 Thread GitBox
johnament commented on issue #352: Config handling for MP rest client
URL: https://github.com/apache/cxf/pull/352#issuecomment-349829228
 
 
   I see why it doesn't work.  It's related to 
https://issues.apache.org/jira/browse/CXF-7543 , basically the JAX-RS client 
impl is done as a completely different path than the WebClient codepath.  
Proxies are based on the WebClient codebase.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] johnament closed pull request #352: Config handling for MP rest client

2017-12-06 Thread GitBox
johnament closed pull request #352: Config handling for MP rest client
URL: https://github.com/apache/cxf/pull/352
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilder.java
 
b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilder.java
index 4e231aaf3f8..8fc7b54de89 100644
--- 
a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilder.java
+++ 
b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilder.java
@@ -21,24 +21,20 @@
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import javax.ws.rs.core.Configurable;
 import javax.ws.rs.core.Configuration;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
+import org.apache.cxf.jaxrs.client.spec.ClientConfigurableImpl;
 import org.eclipse.microprofile.rest.client.RestClientBuilder;
 import org.eclipse.microprofile.rest.client.annotation.RegisterProviders;
 
 public class CxfTypeSafeClientBuilder implements RestClientBuilder {
 private String baseUri;
-private Map properties;
-private List jaxrsProviders;
-
-public CxfTypeSafeClientBuilder() {
-this.properties = new HashMap<>();
-this.jaxrsProviders = new ArrayList<>();
-}
+private final Configurable configImpl =
+new ClientConfigurableImpl(this);
 
 @Override
 public RestClientBuilder baseUrl(URL url) {
@@ -48,9 +44,14 @@ public RestClientBuilder baseUrl(URL url) {
 
 @Override
 public  T build(Class aClass) {
+if (baseUri == null) {
+throw new IllegalStateException("baseUrl not set");
+}
 RegisterProviders providers = 
aClass.getAnnotation(RegisterProviders.class);
 List providerClasses = new ArrayList<>();
-providerClasses.addAll(this.jaxrsProviders);
+Configuration config = configImpl.getConfiguration();
+providerClasses.addAll(config.getClasses());
+providerClasses.addAll(config.getInstances());
 if (providers != null) {
 providerClasses.addAll(Arrays.asList(providers.value()));
 }
@@ -58,60 +59,67 @@ public RestClientBuilder baseUrl(URL url) {
 bean.setAddress(baseUri);
 bean.setServiceClass(aClass);
 bean.setProviders(providerClasses);
-bean.setProperties(properties);
+bean.setProperties(config.getProperties());
 return bean.create(aClass);
 }
 
 @Override
 public Configuration getConfiguration() {
-return null;
+return configImpl.getConfiguration();
 }
 
 @Override
-public RestClientBuilder property(String s, Object o) {
-this.properties.put(s, o);
+public RestClientBuilder property(String key, Object value) {
+configImpl.property(key, value);
 return this;
 }
 
 @Override
-public RestClientBuilder register(Class providerClass) {
-this.jaxrsProviders.add(providerClass);
+public RestClientBuilder register(Class componentClass) {
+configImpl.register(componentClass);
 return this;
 }
 
 @Override
-public RestClientBuilder register(Class aClass, int i) {
+public RestClientBuilder register(Object component) {
+configImpl.register(component);
 return this;
 }
 
 @Override
-public RestClientBuilder register(Class aClass, Class... classes) {
+public RestClientBuilder register(Class componentClass, int priority) {
+configImpl.register(componentClass, priority);
 return this;
 }
 
 @Override
-public RestClientBuilder register(Class aClass, Map 
map) {
+public RestClientBuilder register(Class componentClass, Class... 
contracts) {
+configImpl.register(componentClass, contracts);
 return this;
 }
 
 @Override
-public RestClientBuilder register(Object o) {
-this.jaxrsProviders.add(o);
+public RestClientBuilder register(Class componentClass, Map contracts) {
+configImpl.register(componentClass, contracts);
 return this;
 }
 
 @Override
-public RestClientBuilder register(Object o, int i) {
+public RestClientBuilder register(Object component, int priority) {
+configImpl.register(component, priority);
 return this;
 }
 
 @Override
-public RestClientBuilder register(Object o, Class... classes) {
+public RestClientBuilder register(Object component, Class... contracts) 
{
+

[GitHub] johnament commented on issue #352: Config handling for MP rest client

2017-12-06 Thread GitBox
johnament commented on issue #352: Config handling for MP rest client
URL: https://github.com/apache/cxf/pull/352#issuecomment-349826263
 
 
   @andymc12 I think this is fine.  weird that the priority isn't coming over.  
I see in `ConfigurableImpl` we read the priority.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


Re: Push does not work

2017-12-06 Thread Andriy Redko
Hi Sergey,

Has it been resolved? Have nothing to push but could do just whitespace.
Let me know if you want me to try.

Best Regards,
Andriy Redko

SB> Hi

SB> Seeing my push being repeatedly rejected

SB> remote: This repository is currently out of sync, please
SB> remote: contact us...@infra.apache.org!
SB> To https://gitbox.apache.org/repos/asf/cxf.git
SB>   ! [remote rejected] master -> master (pre-receive hook declined)

SB> with 'git pull' showing all is up to date...

SB> Can someone try to do some basic update ? Curious is it only me or not...

SB> Sergey




[GitHub] andymc12 opened a new pull request #352: Config handling for MP rest client

2017-12-06 Thread GitBox
andymc12 opened a new pull request #352: Config handling for MP rest client
URL: https://github.com/apache/cxf/pull/352
 
 
   @johnament Can you take a look at these changes?
   
   This should help us handle the `Configurable` methods.  Notice that the 
overrides of the priority do not currently work (note the test that has the 
`@Ignore` annotation).  I ran a similar test using the JAX-RS client and that 
worked, so I'm probably just missing something simple...  if you see it, please 
let me know.  Thanks!


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


Push does not work

2017-12-06 Thread Sergey Beryozkin

Hi

Seeing my push being repeatedly rejected

remote: This repository is currently out of sync, please
remote: contact us...@infra.apache.org!
To https://gitbox.apache.org/repos/asf/cxf.git
 ! [remote rejected] master -> master (pre-receive hook declined)

with 'git pull' showing all is up to date...

Can someone try to do some basic update ? Curious is it only me or not...

Sergey



[GitHub] typekpb commented on issue #324: RFC introduced: Supress generated date switch for wsdl2java

2017-12-06 Thread GitBox
typekpb commented on issue #324: RFC introduced: Supress generated date switch 
for wsdl2java
URL: https://github.com/apache/cxf/pull/324#issuecomment-349785868
 
 
   exactly!


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] typekpb commented on a change in pull request #324: RFC introduced: Supress generated date switch for wsdl2java

2017-12-06 Thread GitBox
typekpb commented on a change in pull request #324: RFC introduced: Supress 
generated date switch for wsdl2java
URL: https://github.com/apache/cxf/pull/324#discussion_r155371289
 
 

 ##
 File path: 
tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
 ##
 @@ -437,24 +437,20 @@ public void initialize(ToolContext c) throws 
ToolException {
 throw new ToolException(e);
 }
 }
-addSchemas(opts, schemaCompiler, schemas);
-addBindingFiles(opts, jaxbBindings, schemas);
-
 
-for (String ns : context.getNamespacePackageMap().keySet()) {
-File file = JAXBUtils.getPackageMappingSchemaBindingFile(ns, 
context.mapPackageName(ns));
+if (context.optionSet(ToolConstants.CFG_SUPPRESS_GENERATED_DATE)) {
+// Prevents dumping current date as part of javadocs of the Java 
files generated.
+// This is done by passing '-suppress-generated-date' attribute to 
jaxb xjc.
 
 Review comment:
   fixed, thanks


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] typekpb commented on a change in pull request #324: RFC introduced: Supress generated date switch for wsdl2java

2017-12-06 Thread GitBox
typekpb commented on a change in pull request #324: RFC introduced: Supress 
generated date switch for wsdl2java
URL: https://github.com/apache/cxf/pull/324#discussion_r155371258
 
 

 ##
 File path: 
tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenOptionTest.java
 ##
 @@ -294,6 +294,104 @@ private int countGeneratedAnnotations(String str) {
 return count;
 }
 
+/**
+ * Tests that, when 'suppress-generated-date' option is set, javadocs
+ * won't contain the current date in all the generated java classes.
+ */
+@Test
+public void testSuppressGeneratedDatePresentOption() throws Exception {
+env.put(ToolConstants.CFG_WSDLURL, 
getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
+env.put(ToolConstants.CFG_SUPPRESS_GENERATED_DATE, "true");
+env.put(ToolConstants.CFG_COMPILE, null);
+env.put(ToolConstants.CFG_CLASSDIR, null);
+processor.setContext(env);
+processor.execute();
+
+File dir = new File(output, "org");
+assertTrue("org directory is not found", dir.exists());
+dir = new File(dir, "apache");
+assertTrue("apache directory is not found", dir.exists());
+assertTrue("apache directory is not found", dir.exists());
+dir = new File(dir, "cxf");
+assertTrue("cxf directory is not found", dir.exists());
+dir = new File(dir, "w2j");
+assertTrue("w2j directory is not found", dir.exists());
+dir = new File(dir, "hello_world_soap_http");
+assertTrue("hello_world_soap_http directory is not found", 
dir.exists());
+File types = new File(dir, "types");
+assertTrue("types directory is not found", dir.exists());
+
+String str = IOUtils.readStringFromStream(new FileInputStream(new 
File(dir, "Greeter.java")));
+assertFalse(currentDatePresent(str));
+str = IOUtils.readStringFromStream(new FileInputStream(new File(types, 
"SayHi.java")));
+assertFalse(currentDatePresent(str));
+str = IOUtils.readStringFromStream(new FileInputStream(new File(types, 
"SayHiResponse.java")));
+assertFalse(currentDatePresent(str));
+}
+
+/**
+ * Tests that, when 'suppress-generated-date' option is not present, 
javadocs
+ * will contain the current date in all the generated java classes.
+ */
+@Test
+public void testSuppressGeneratedDateNotPresentOption() throws Exception {
+env.put(ToolConstants.CFG_WSDLURL, 
getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
+env.put(ToolConstants.CFG_MARK_GENERATED, "true");
+env.put(ToolConstants.CFG_COMPILE, null);
+env.put(ToolConstants.CFG_CLASSDIR, null);
+processor.setContext(env);
+processor.execute();
+
+File dir = new File(output, "org");
+assertTrue("org directory is not found", dir.exists());
+dir = new File(dir, "apache");
+assertTrue("apache directory is not found", dir.exists());
+dir = new File(dir, "cxf");
+assertTrue("cxf directory is not found", dir.exists());
+dir = new File(dir, "w2j");
+assertTrue("w2j directory is not found", dir.exists());
+dir = new File(dir, "hello_world_soap_http");
+assertTrue("hello_world_soap_http directory is not found", 
dir.exists());
+File types = new File(dir, "types");
+assertTrue("types directory is not found", dir.exists());
+
+String str = IOUtils.readStringFromStream(new FileInputStream(new 
File(dir, "Greeter.java")));
+assertTrue(currentDatePresent(str));
+str = IOUtils.readStringFromStream(new FileInputStream(new File(types, 
"SayHi.java")));
+assertFalse(currentDatePresent(str));
+str = IOUtils.readStringFromStream(new FileInputStream(new File(types, 
"SayHiResponse.java")));
+assertFalse(currentDatePresent(str));
+}
+
+private boolean currentDatePresent(String str) {
+String[] lines = str.split(System.getProperty("line.separator"));
+boolean expectDate = false;
+
+for (String line : lines) {
+if (expectDate) {
+if (line.contains("Generated source version")) {
+break;
+} else {
+return true;
+}
+}
+expectDate = line.contains("This class was generated by");
+}
+
+return false;
+}
+
+private boolean generatedAnnotationPresent(String str) {
 
 Review comment:
   fixed, thanks


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] deki commented on a change in pull request #324: RFC introduced: Supress generated date switch for wsdl2java

2017-12-06 Thread GitBox
deki commented on a change in pull request #324: RFC introduced: Supress 
generated date switch for wsdl2java
URL: https://github.com/apache/cxf/pull/324#discussion_r155334050
 
 

 ##
 File path: 
tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
 ##
 @@ -437,24 +437,20 @@ public void initialize(ToolContext c) throws 
ToolException {
 throw new ToolException(e);
 }
 }
-addSchemas(opts, schemaCompiler, schemas);
-addBindingFiles(opts, jaxbBindings, schemas);
-
 
-for (String ns : context.getNamespacePackageMap().keySet()) {
-File file = JAXBUtils.getPackageMappingSchemaBindingFile(ns, 
context.mapPackageName(ns));
+if (context.optionSet(ToolConstants.CFG_SUPPRESS_GENERATED_DATE)) {
+// Prevents dumping current date as part of javadocs of the Java 
files generated.
+// This is done by passing '-suppress-generated-date' attribute to 
jaxb xjc.
 
 Review comment:
   XJC has no such option, why should we pass it? After removing this codeblock 
the test still passes.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] deki commented on a change in pull request #324: RFC introduced: Supress generated date switch for wsdl2java

2017-12-06 Thread GitBox
deki commented on a change in pull request #324: RFC introduced: Supress 
generated date switch for wsdl2java
URL: https://github.com/apache/cxf/pull/324#discussion_r155332951
 
 

 ##
 File path: 
tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenOptionTest.java
 ##
 @@ -294,6 +294,104 @@ private int countGeneratedAnnotations(String str) {
 return count;
 }
 
+/**
+ * Tests that, when 'suppress-generated-date' option is set, javadocs
+ * won't contain the current date in all the generated java classes.
+ */
+@Test
+public void testSuppressGeneratedDatePresentOption() throws Exception {
+env.put(ToolConstants.CFG_WSDLURL, 
getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
+env.put(ToolConstants.CFG_SUPPRESS_GENERATED_DATE, "true");
+env.put(ToolConstants.CFG_COMPILE, null);
+env.put(ToolConstants.CFG_CLASSDIR, null);
+processor.setContext(env);
+processor.execute();
+
+File dir = new File(output, "org");
+assertTrue("org directory is not found", dir.exists());
+dir = new File(dir, "apache");
+assertTrue("apache directory is not found", dir.exists());
+assertTrue("apache directory is not found", dir.exists());
+dir = new File(dir, "cxf");
+assertTrue("cxf directory is not found", dir.exists());
+dir = new File(dir, "w2j");
+assertTrue("w2j directory is not found", dir.exists());
+dir = new File(dir, "hello_world_soap_http");
+assertTrue("hello_world_soap_http directory is not found", 
dir.exists());
+File types = new File(dir, "types");
+assertTrue("types directory is not found", dir.exists());
+
+String str = IOUtils.readStringFromStream(new FileInputStream(new 
File(dir, "Greeter.java")));
+assertFalse(currentDatePresent(str));
+str = IOUtils.readStringFromStream(new FileInputStream(new File(types, 
"SayHi.java")));
+assertFalse(currentDatePresent(str));
+str = IOUtils.readStringFromStream(new FileInputStream(new File(types, 
"SayHiResponse.java")));
+assertFalse(currentDatePresent(str));
+}
+
+/**
+ * Tests that, when 'suppress-generated-date' option is not present, 
javadocs
+ * will contain the current date in all the generated java classes.
+ */
+@Test
+public void testSuppressGeneratedDateNotPresentOption() throws Exception {
+env.put(ToolConstants.CFG_WSDLURL, 
getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
+env.put(ToolConstants.CFG_MARK_GENERATED, "true");
+env.put(ToolConstants.CFG_COMPILE, null);
+env.put(ToolConstants.CFG_CLASSDIR, null);
+processor.setContext(env);
+processor.execute();
+
+File dir = new File(output, "org");
+assertTrue("org directory is not found", dir.exists());
+dir = new File(dir, "apache");
+assertTrue("apache directory is not found", dir.exists());
+dir = new File(dir, "cxf");
+assertTrue("cxf directory is not found", dir.exists());
+dir = new File(dir, "w2j");
+assertTrue("w2j directory is not found", dir.exists());
+dir = new File(dir, "hello_world_soap_http");
+assertTrue("hello_world_soap_http directory is not found", 
dir.exists());
+File types = new File(dir, "types");
+assertTrue("types directory is not found", dir.exists());
+
+String str = IOUtils.readStringFromStream(new FileInputStream(new 
File(dir, "Greeter.java")));
+assertTrue(currentDatePresent(str));
+str = IOUtils.readStringFromStream(new FileInputStream(new File(types, 
"SayHi.java")));
+assertFalse(currentDatePresent(str));
+str = IOUtils.readStringFromStream(new FileInputStream(new File(types, 
"SayHiResponse.java")));
+assertFalse(currentDatePresent(str));
+}
+
+private boolean currentDatePresent(String str) {
+String[] lines = str.split(System.getProperty("line.separator"));
+boolean expectDate = false;
+
+for (String line : lines) {
+if (expectDate) {
+if (line.contains("Generated source version")) {
+break;
+} else {
+return true;
+}
+}
+expectDate = line.contains("This class was generated by");
+}
+
+return false;
+}
+
+private boolean generatedAnnotationPresent(String str) {
 
 Review comment:
   This method is unused.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] typekpb commented on issue #324: RFC introduced: Supress generated date switch for wsdl2java

2017-12-06 Thread GitBox
typekpb commented on issue #324: RFC introduced: Supress generated date switch 
for wsdl2java
URL: https://github.com/apache/cxf/pull/324#issuecomment-349726024
 
 
   Well, is it? Not sure
   
   On Dec 6, 2017 18:44, "Dennis Kieselhorst"  wrote:
   
   > I don't mean the annotation. The date ifself is still part of the classes
   > generated by xjc, isn't it?
   >
   > ?
   > You are receiving this because you authored the thread.
   > Reply to this email directly, view it on GitHub
   > , or mute
   > the thread
   > 

   > .
   >
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] deki commented on issue #324: RFC introduced: Supress generated date switch for wsdl2java

2017-12-06 Thread GitBox
deki commented on issue #324: RFC introduced: Supress generated date switch for 
wsdl2java
URL: https://github.com/apache/cxf/pull/324#issuecomment-349718839
 
 
   I don't mean the annotation. The date ifself is still part of the classes 
generated by xjc, isn't it?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] typekpb commented on issue #324: RFC introduced: Supress generated date switch for wsdl2java

2017-12-06 Thread GitBox
typekpb commented on issue #324: RFC introduced: Supress generated date switch 
for wsdl2java
URL: https://github.com/apache/cxf/pull/324#issuecomment-349718295
 
 
   Exactly. As @Generated annotation spreads across the projects and is not
   generated implicitly, I just tried to keep the effort low and fulfill my
   use case.
   
   On Dec 6, 2017 18:34, "Dennis Kieselhorst"  wrote:
   
   > Don't worry about the failing build, unfortunately this happens from time
   > to time.
   >
   > If I understand it correctly, the option now only partially suppresses the
   > generated date?
   >
   > ?
   > You are receiving this because you authored the thread.
   > Reply to this email directly, view it on GitHub
   > , or mute
   > the thread
   > 

   > .
   >
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] deki commented on issue #324: RFC introduced: Supress generated date switch for wsdl2java

2017-12-06 Thread GitBox
deki commented on issue #324: RFC introduced: Supress generated date switch for 
wsdl2java
URL: https://github.com/apache/cxf/pull/324#issuecomment-349716212
 
 
   Don't worry about the failing build, unfortunately this happens from time to 
time.
   
   If I understand it correctly, the option now only partially suppresses the 
generated date?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services