Commit f286590a authored by Rafa Hernandez's avatar Rafa Hernandez Committed by Alexander Salas Bastidas

test(package): rename test

parent 7aef82f8
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());
}
}
......@@ -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"
......
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());
}
}
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);
}
}
}
package org.flyve.glpi;
package org.glpi;
import org.junit.Test;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment