Skip to content

Commit

Permalink
apparently android doesn't want us to test content providers 🤷 lmk if…
Browse files Browse the repository at this point in the history
… there's something not deprecated or broken
  • Loading branch information
F43nd1r committed Nov 27, 2022
1 parent e312b20 commit 13e841b
Showing 1 changed file with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,25 @@

package org.acra.attachment;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import android.provider.OpenableColumns;
import android.test.ProviderTestCase2;
import android.webkit.MimeTypeMap;

import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.provider.ProviderTestRule;

import org.acra.ACRA;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand All @@ -35,22 +44,26 @@
* @author F43nd1r
* @since 04.12.2017
*/
@Ignore
@RunWith(AndroidJUnit4.class)
public class AcraContentProviderTest extends ProviderTestCase2<AcraContentProvider> {
public class AcraContentProviderTest {

@Rule
public ProviderTestRule rule = new ProviderTestRule.Builder(AcraContentProvider.class, "org.acra.test.acra").build();
private static final String JSON_EXTENSION = "json";
private static final String JSON_MIMETYPE = "application/json";

private ContentResolver resolver;
private File file;

public AcraContentProviderTest() {
super(AcraContentProvider.class, ApplicationProvider.getApplicationContext().getPackageName() + ".acra");
InstrumentationRegistry.getInstrumentation()
}

@Before
public void setUp() throws Exception {
ACRA.DEV_LOGGING = true;
resolver = ApplicationProvider.getApplicationContext().getContentResolver();
resolver = rule.getResolver();
file = File.createTempFile("test", "." + JSON_EXTENSION);
}

Expand Down

0 comments on commit 13e841b

Please sign in to comment.