Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new file tests to OdkWebserverServiceTest #270

Open
wants to merge 6 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,14 @@

import androidx.test.espresso.action.ViewActions;
import androidx.test.espresso.contrib.RecyclerViewActions;
import androidx.test.espresso.intent.Intents;

import org.junit.After;
import org.junit.Test;
import org.opendatakit.BaseUITest;
import org.opendatakit.consts.IntentConsts;
import org.opendatakit.properties.CommonToolProperties;
import org.opendatakit.properties.PropertiesSingleton;
import org.opendatakit.services.R;
import org.opendatakit.services.preferences.activities.AppPropertiesActivity;
import org.opendatakit.services.preferences.activities.ClearAppPropertiesActivity;
import org.opendatakit.utilities.LocalizationUtils;
import org.opendatakit.utilities.ODKFileUtils;

import java.io.File;

public class GeneralAdminConfigurationTest extends BaseUITest<AppPropertiesActivity> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package org.opendatakit.services.sync.service.logic;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;

import android.Manifest;
import android.app.Application;
import android.content.Context;

import androidx.test.InstrumentationRegistry;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.filters.Suppress;
import androidx.test.rule.GrantPermissionRule;

Expand Down Expand Up @@ -57,10 +61,6 @@
import java.util.Map;
import java.util.UUID;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;

/**
* This set of tests relies on a propery configured test cloud endpoint.
* Do not adorn this with RunWith unless that server is configured.
Expand Down Expand Up @@ -101,7 +101,6 @@ public class AggregateSynchronizerTest {

@Before
public void setUp() throws Exception {

agg_url = "https://test.appspot.com";
absolutePathOfTestFiles = "testfiles/test/";
batchSize = 1000;
Expand All @@ -115,9 +114,8 @@ public void setUp() throws Exception {
boolean beganUninitialized = !initialized;
if (beganUninitialized) {
initialized = true;
application = InstrumentationRegistry.getInstrumentation().newApplication(this.getClass()
.getClassLoader(), "org.opendatakit.services.application.Services",
InstrumentationRegistry.getTargetContext());
Context context = ApplicationProvider.getApplicationContext();
application = ApplicationProvider.getApplicationContext();
// Used to ensure that the singleton has been initialized properly
AndroidConnectFactory.configure();
}
Expand Down Expand Up @@ -164,7 +162,8 @@ public void clearVerificationNotification(String appName, String title, String t
}

private SyncExecutionContext getSyncExecutionContext() {
Context context = InstrumentationRegistry.getTargetContext();
//Context context = InstrumentationRegistry.getTargetContext();
Context context = ApplicationProvider.getApplicationContext();
SyncProgressTracker syncProg = new SyncProgressTracker(context,
new GlobalSyncNotificationManagerStub(), appName);
SyncOverallResult syncRes = new SyncOverallResult();
Expand Down
Loading