Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-android
Commits
edf48bdb
Commit
edf48bdb
authored
12 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
#15052: Implement test for placeCall method using both good and bad phone number
parent
974363d4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/com/savoirfairelinux/sflphone/client/ManagerImpl.java
+1
-1
1 addition, 1 deletion
src/com/savoirfairelinux/sflphone/client/ManagerImpl.java
tests/src/com/savoirfairelinux/sflphone/client/ManagerImplTest.java
+56
-0
56 additions, 0 deletions
...com/savoirfairelinux/sflphone/client/ManagerImplTest.java
with
57 additions
and
1 deletion
src/com/savoirfairelinux/sflphone/client/ManagerImpl.java
+
1
−
1
View file @
edf48bdb
...
...
@@ -48,5 +48,5 @@ public class ManagerImpl {
public
static
native
String
getJniString
();
public
static
native
void
initN
(
String
config_file
);
public
static
native
void
placeCall
(
String
accountID
,
String
callID
,
String
to
);
public
static
native
void
hangUp
(
String
account
ID
);
public
static
native
void
hangUp
(
String
call
ID
);
}
This diff is collapsed.
Click to expand it.
tests/src/com/savoirfairelinux/sflphone/client/ManagerImplTest.java
+
56
−
0
View file @
edf48bdb
...
...
@@ -31,12 +31,35 @@
package
com.savoirfairelinux.sflphone
;
import
java.lang.Thread
;
import
android.test.AndroidTestCase
;
import
com.savoirfairelinux.sflphone.client.ManagerImpl
;
public
class
ManagerImplTest
extends
AndroidTestCase
{
public
static
final
String
PACKAGE_NAME
=
"com.savoirfairelinux.sflphone"
;
public
static
final
String
ACCOUNT_ID
=
"IP2IP"
;
public
static
final
String
CALLING_VALID_IP
=
"127.0.0.1"
;
public
static
final
String
CALLING_BAD_IP
=
"123.234.123.234"
;
public
static
final
String
CALL_ID
=
"1234567"
;
public
static
final
int
CALL_SLEEP_TIME
=
1000
;
// in ms
static
{
System
.
loadLibrary
(
"gnustl_shared"
);
System
.
loadLibrary
(
"expat"
);
System
.
loadLibrary
(
"yaml"
);
System
.
loadLibrary
(
"ccgnu2"
);
System
.
loadLibrary
(
"crypto"
);
System
.
loadLibrary
(
"ssl"
);
System
.
loadLibrary
(
"ccrtp1"
);
System
.
loadLibrary
(
"dbus"
);
System
.
loadLibrary
(
"dbus-c++-1"
);
System
.
loadLibrary
(
"samplerate"
);
System
.
loadLibrary
(
"codec_ulaw"
);
System
.
loadLibrary
(
"codec_alaw"
);
System
.
loadLibrary
(
"speexresampler"
);
System
.
loadLibrary
(
"sflphone"
);
}
ManagerImpl
managerimpl
;
...
...
@@ -45,6 +68,7 @@ public class ManagerImplTest extends AndroidTestCase {
super
.
setUp
();
managerimpl
=
new
ManagerImpl
();
managerimpl
.
initN
(
""
);
}
@Override
...
...
@@ -56,4 +80,36 @@ public class ManagerImplTest extends AndroidTestCase {
managerimpl
.
setAppPath
(
PACKAGE_NAME
);
assertTrue
(
managerimpl
.
getAppPath
()
==
PACKAGE_NAME
);
}
public
void
testPlaceCallSuccessful
()
{
try
{
managerimpl
.
placeCall
(
ACCOUNT_ID
,
CALL_ID
,
CALLING_VALID_IP
);
assertTrue
(
true
);
// FIXME: We should have a method returning the call state
// and wait for the call to be in state CURRENT.
Thread
.
sleep
(
CALL_SLEEP_TIME
);
managerimpl
.
hangUp
(
CALL_ID
);
assertTrue
(
true
);
}
catch
(
InterruptedException
e
)
{
assertTrue
(
false
);
}
}
public
void
testPlaceCallBad
()
{
try
{
managerimpl
.
placeCall
(
ACCOUNT_ID
,
CALL_ID
,
CALLING_BAD_IP
);
assertTrue
(
true
);
Thread
.
sleep
(
CALL_SLEEP_TIME
);
managerimpl
.
hangUp
(
CALL_ID
);
assertTrue
(
true
);
}
catch
(
InterruptedException
e
)
{
assertTrue
(
false
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment