-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better SOAP fault handling. timeout for soap requests
- Loading branch information
Showing
14 changed files
with
177 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using SharpSapRfc.Plain; | ||
using SharpSapRfc.Soap; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Xunit; | ||
|
||
namespace SharpSapRfc.Test.TestCases | ||
{ | ||
public class Soap_AccessDeniedTestCase : AccessDeniedTestCase | ||
{ | ||
protected override SapRfcConnection GetConnection() | ||
{ | ||
return new SoapSapRfcConnection("TST_DENY_ACCESS-SOAP"); | ||
} | ||
} | ||
|
||
public class Plain_AccessDeniedTestCase : AccessDeniedTestCase | ||
{ | ||
protected override SapRfcConnection GetConnection() | ||
{ | ||
return new PlainSapRfcConnection("TST_DENY_ACCESS"); | ||
} | ||
} | ||
|
||
public abstract class AccessDeniedTestCase | ||
{ | ||
protected abstract SapRfcConnection GetConnection(); | ||
|
||
[Fact] | ||
public void ShouldNotExecuteFunctionBecauseItIsNotAllowed() | ||
{ | ||
using (SapRfcConnection conn = this.GetConnection()) | ||
{ | ||
Assert.Throws<SharpRfcException>(() => { | ||
var result = conn.ExecuteFunction("Z_SSRT_SUM", | ||
new RfcParameter("i_num1", 2), | ||
new RfcParameter("i_num2", 4) | ||
); | ||
}); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using SharpSapRfc.Plain; | ||
using SharpSapRfc.Soap; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Xunit; | ||
|
||
namespace SharpSapRfc.Test.TestCases | ||
{ | ||
public class Soap_TimeoutTestCase : TimeoutTestCase | ||
{ | ||
protected override SapRfcConnection GetConnection() | ||
{ | ||
return new SoapSapRfcConnection("TST-SOAP"); | ||
} | ||
|
||
[Fact] | ||
public void ShouldThrowTimeoutException() | ||
{ | ||
using (SapRfcConnection conn = this.GetConnection()) | ||
{ | ||
Assert.Throws<TimeoutException>(() => | ||
{ | ||
var result = conn.ExecuteFunction("Z_SSRT_LONG_PROCESS", new | ||
{ | ||
i_seconds = 6 | ||
}); | ||
}); | ||
} | ||
} | ||
} | ||
|
||
public class Plain_TimeoutTestCase : TimeoutTestCase | ||
{ | ||
protected override SapRfcConnection GetConnection() | ||
{ | ||
return new PlainSapRfcConnection("TST"); | ||
} | ||
} | ||
|
||
public abstract class TimeoutTestCase | ||
{ | ||
protected abstract SapRfcConnection GetConnection(); | ||
|
||
[Fact] | ||
public void ShouldNotThrowTimeoutException() | ||
{ | ||
using (SapRfcConnection conn = this.GetConnection()) | ||
{ | ||
var result = conn.ExecuteFunction("Z_SSRT_LONG_PROCESS", new | ||
{ | ||
i_seconds = 1 | ||
}); | ||
} | ||
} | ||
} | ||
} |