Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanGamezSW authored Nov 7, 2018
2 parents 871b350 + 259904e commit 5859b3f
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -962,4 +962,4 @@ System.out.println(response.acuse);
//En caso de obtener error, este puede obtenerse de los siguientes campos
System.out.println(response.message);
System.out.println(response.messageDetail);
```
```
27 changes: 14 additions & 13 deletions SW-JAVA.iml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="com.github.bingoohuang:unirest-java:0.0.1" level="project" />
<orderEntry type="module-library" exported="" scope="TEST">
Expand Down Expand Up @@ -41,18 +41,19 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" exported="" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" exported="" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" exported="" name="Maven: com.github.bingoohuang:unirest-java:0.0.1" level="project" />
<orderEntry type="library" exported="" name="Maven: org.apache.httpcomponents:httpclient:4.3.6" level="project" />
<orderEntry type="library" exported="" name="Maven: org.apache.httpcomponents:httpcore:4.3.3" level="project" />
<orderEntry type="library" exported="" name="Maven: commons-logging:commons-logging:1.1.3" level="project" />
<orderEntry type="library" exported="" name="Maven: commons-codec:commons-codec:1.6" level="project" />
<orderEntry type="library" exported="" name="Maven: org.apache.httpcomponents:httpasyncclient:4.0.2" level="project" />
<orderEntry type="library" exported="" name="Maven: org.apache.httpcomponents:httpcore-nio:4.3.2" level="project" />
<orderEntry type="library" exported="" name="Maven: org.apache.httpcomponents:httpmime:4.3.6" level="project" />
<orderEntry type="library" exported="" name="Maven: org.json:json:20140107" level="project" />
<orderEntry type="library" exported="" name="Maven: com.googlecode.juniversalchardet:juniversalchardet:1.0.3" level="project" />
<orderEntry type="library" exported="" name="org.apache.servicemix.bundles:org.apache.servicemix.bundles.not-yet-commons-ssl:0.3.11_1" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: com.github.bingoohuang:unirest-java:0.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.3.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.3.3" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.3" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.0.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.3.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.3.6" level="project" />
<orderEntry type="library" name="Maven: org.json:json:20140107" level="project" />
<orderEntry type="library" name="Maven: com.googlecode.juniversalchardet:juniversalchardet:1.0.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.servicemix.bundles:org.apache.servicemix.bundles.not-yet-commons-ssl:0.3.11_1" level="project" />
</component>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public IResponse Token() throws GeneralException, AuthException, IOException {
AuthRequest req = new AuthRequest();
return req.sendRequest(settings);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ public IResponse Cancelation(String uuid, String rfc) throws AuthException, Gene
CancelationRequest req = new CancelationRequest();
return req.sendRequestUuid(settings);
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/Services/Stamp/SWStampService.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ public IResponse Stamp(byte[] xmlFile, String version) throws AuthException, Gen
return req.sendRequest(settings);

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,33 @@
import Utils.Requests.IRequest;

public class AuthOptionsRequest extends IRequest {
private String ProxyHost = null;
private String PortHost = null;

public void setProxyHost(String proxyHost) {
ProxyHost = proxyHost;
}

public void setPortHost(String portHost) {
PortHost = portHost;
}

public AuthOptionsRequest(String URI, String user, String password) {
super(URI+ Constants.AUTH_PATH, user, password);
}

public String getProxyHost() {
return ProxyHost;
}

public String getPortHost() {
return PortHost;
}

public AuthOptionsRequest(String URI, String user, String password, String hostProxy, String portProxy) {

super(URI+ Constants.AUTH_PATH, user, password);
this.setPortHost(portProxy);
this.setProxyHost(hostProxy);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ public IResponse sendRequest(IRequest request) throws GeneralException, AuthExce

}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public class CancelationOptionsRequest extends IRequest{
private String b64Pfx;

private String xml;
private String ProxyHost;
private String PortHost;


public CancelationOptionsRequest(String token, String URI, String uuid, String password_csd, String rfc, String b64Cer, String b64Key) {
Expand All @@ -22,6 +24,17 @@ public CancelationOptionsRequest(String token, String URI, String uuid, String p
this.b64Cer = b64Cer;
this.b64key = b64Key;
}

public CancelationOptionsRequest(String token, String URI, String uuid, String password_csd, String rfc, String b64Cer, String b64Key, String proxyHost, String portHst) {
super(token, URI+ Constants.CANCELATION_CSD_PATH);
this.uuid = uuid;
this.password_csd = password_csd;
this.rfc = rfc;
this.b64Cer = b64Cer;
this.b64key = b64Key;
ProxyHost = proxyHost;
PortHost = portHst;
}

public CancelationOptionsRequest(String token, String URI, String uuid, String password_csd, String rfc, String b64Pfx) {
super(token, URI+ Constants.CANCELATION_PFX_PATH);
Expand All @@ -41,6 +54,23 @@ public CancelationOptionsRequest(String token, String URI, String uuid, String r
this.rfc = rfc;
}

public String getProxyHost() {
return ProxyHost;
}

public String getPortHost() {
return PortHost;
}

public CancelationOptionsRequest(String token, String URI, String xml, String proxyHost, String portHst) {
super(token, URI+ Constants.CANCELATION_XML_PATH);
this.xml = xml;
ProxyHost = proxyHost;
PortHost = portHst;


}

public String getUuid() {
return uuid;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ public StampOptionsRequest(String token, String URI, String xml, String version)
this.version = version;
}

}
}
2 changes: 1 addition & 1 deletion src/main/java/Utils/Requests/Stamp/StampRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,4 @@ public IResponse sendRequest(IRequest request) throws GeneralException, AuthExce
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,19 @@ public void testAuth(){
e.printStackTrace();
}
}

public void testAuthProxy(){
SWAuthenticationService auth = new SWAuthenticationService("demo","123456789","http://services.test.sw.com.mx","127.0.0.1","8888");
try {
SuccessAuthResponse res = (SuccessAuthResponse) auth.Token();
String expected = "success";
System.out.println(res.token);
System.out.println(res.message);
System.out.println(res.messageDetail);
Assert.assertTrue(expected.equalsIgnoreCase(res.Status));
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}
Loading

0 comments on commit 5859b3f

Please sign in to comment.