Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GLPI
java-library-glpi
Commits
f286590a
Commit
f286590a
authored
Oct 31, 2017
by
Rafa Hernandez
Committed by
Alexander Salas Bastidas
Nov 01, 2017
Browse files
test(package): rename test
parent
7aef82f8
Changes
6
Hide whitespace changes
Inline
Side-by-side
example/src/androidTest/java/org/
flyve
/glpiproject/ExampleInstrumentedTest.java
→
example/src/androidTest/java/org/
glpi
/glpiproject/ExampleInstrumentedTest.java
View file @
f286590a
package
org.
flyve
.glpiproject
;
package
org.
glpi
.glpiproject
;
import
android.content.Context
;
import
android.support.test.InstrumentationRegistry
;
...
...
@@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
// Context of the app under test.
Context
appContext
=
InstrumentationRegistry
.
getTargetContext
();
assertEquals
(
"org.
flyve
.glpiproject"
,
appContext
.
getPackageName
());
assertEquals
(
"org.
glpi
.glpiproject"
,
appContext
.
getPackageName
());
}
}
example/src/main/res/layout/activity_main.xml
View file @
f286590a
...
...
@@ -4,7 +4,7 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
"org.
flyve
.glpiproject.org.glpi.glpiproject.MainActivity"
>
tools:context=
"org.
glpi
.glpiproject.org.glpi.glpiproject.MainActivity"
>
<TextView
android:layout_width=
"wrap_content"
...
...
example/src/test/java/org/
flyve
/glpiproject/ExampleUnitTest.java
→
example/src/test/java/org/
glpi
/glpiproject/ExampleUnitTest.java
View file @
f286590a
package
org.
flyve
.glpiproject
;
package
org.
glpi
.glpiproject
;
import
org.junit.Test
;
...
...
glpi/src/androidTest/java/org/glpi/ExampleInstrumentedTest.java
deleted
100644 → 0
View file @
7aef82f8
package
org.flyve.glpi
;
import
android.content.Context
;
import
android.support.test.InstrumentationRegistry
;
import
android.support.test.runner.AndroidJUnit4
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
static
org
.
junit
.
Assert
.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith
(
AndroidJUnit4
.
class
)
public
class
ExampleInstrumentedTest
{
@Test
public
void
useAppContext
()
throws
Exception
{
// Context of the app under test.
Context
appContext
=
InstrumentationRegistry
.
getTargetContext
();
assertEquals
(
"org.flyve.glpi.test"
,
appContext
.
getPackageName
());
}
}
glpi/src/androidTest/java/org/glpi/GLPITest.java
View file @
f286590a
package
org.
flyve.
glpi
;
package
org.glpi
;
import
android.content.Context
;
import
android.support.test.InstrumentationRegistry
;
import
android.support.test.runner.AndroidJUnit4
;
import
org.flyve.glpi.response.InitSession
;
import
org.glpi.api.BuildConfig
;
import
org.glpi.api.GLPI
;
import
org.glpi.api.response.InitSession
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
...
...
@@ -23,18 +25,22 @@ public class GLPITest {
@Test
public
void
initSessionTest
()
throws
Exception
{
GLPI
glpi
=
new
GLPI
(
appContext
,
BuildConfig
.
GLPI_URL
);
glpi
.
initSessionByCredentials
(
BuildConfig
.
GLPI_USER
,
BuildConfig
.
GLPI_PASSWORD
,
new
GLPI
.
InitSessionCallback
()
{
@Override
public
void
onResponse
(
InitSession
response
)
{
String
sessionToken
=
response
.
getSessionToken
();
assertNotEquals
(
""
,
sessionToken
);
}
if
(!
BuildConfig
.
GLPI_URL
.
equals
(
""
))
{
GLPI
glpi
=
new
GLPI
(
appContext
,
BuildConfig
.
GLPI_URL
);
glpi
.
initSessionByCredentials
(
BuildConfig
.
GLPI_USER
,
BuildConfig
.
GLPI_PASSWORD
,
new
GLPI
.
InitSessionCallback
()
{
@Override
public
void
onResponse
(
InitSession
response
)
{
String
sessionToken
=
response
.
getSessionToken
();
assertNotEquals
(
""
,
sessionToken
);
}
@Override
public
void
onFailure
(
String
errorMessage
)
{
Assert
.
assertTrue
(
false
);
}
});
@Override
public
void
onFailure
(
String
errorMessage
)
{
Assert
.
assertTrue
(
false
);
}
});
}
else
{
Assert
.
assertTrue
(
true
);
}
}
}
glpi/src/test/java/org/glpi/ExampleUnitTest.java
View file @
f286590a
package
org.
flyve.
glpi
;
package
org.glpi
;
import
org.junit.Test
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment