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

DONT MERGE - 121 materialspinner unit tests #589

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
41 changes: 26 additions & 15 deletions android-json-form-wizard/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.android.tools.build:gradle:4.2.0'
classpath 'org.apache.commons:commons-lang3:3.7'
}
}
Expand All @@ -27,16 +27,14 @@ android {
defaultConfig {
minSdkVersion androidMinSdkVersion
targetSdkVersion androidTargetSdkVersion
versionCode Integer.parseInt(project.VERSION_CODE)
versionName project.VERSION_NAME
multiDexEnabled true
testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"

javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
}
}
// javaCompileOptions {
// annotationProcessorOptions {
// includeCompileClasspath = true
// }
// }
}

buildTypes {
Expand All @@ -57,14 +55,24 @@ android {
unitTests {
includeAndroidResources = true
}
execution 'ANDROIDX_TEST_ORCHESTRATOR'
unitTests.all {
useJUnitPlatform() // <--- this is the important part
}
}

packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}

configurations.all {
resolutionStrategy.force 'com.android.support:design:28.0.0'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}


Expand Down Expand Up @@ -137,23 +145,26 @@ dependencies {
exclude group: 'com.android.support.test.espresso', module: 'espresso-core'
}
implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.annotation:annotation:1.2.0'

// PowerMock
def powerMockVersion = '2.0.4'
def powerMockVersion = '2.0.7'
testImplementation "org.powermock:powermock-module-junit4:$powerMockVersion"
testImplementation "org.powermock:powermock-module-junit4-rule:$powerMockVersion"
testImplementation "org.powermock:powermock-api-mockito2:$powerMockVersion"
testImplementation "org.powermock:powermock-classloading-xstream:$powerMockVersion"
implementation('com.github.raihan-mpower:FancyAlertDialog-Android:0.3') {
exclude group: 'com.android.support', module: 'appcompat-v7'

}

testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.7.1'

androidTestImplementation 'com.jayway.android.robotium:robotium-solo:5.6.3'
androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'junit:junit:4.13.2'
androidTestImplementation("com.android.support.test:runner:1.0.2") {
exclude group: 'com.android.support', module: 'appcompat-v7'

Expand All @@ -166,11 +177,11 @@ dependencies {

}

testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.apache.maven:maven-ant-tasks:2.1.3'
testImplementation 'org.mockito:mockito-core:3.1.0'
testImplementation 'org.mockito:mockito-core:3.11.2'
testImplementation('com.squareup:fest-android:1.0.8') { exclude module: 'support-v4' }
testImplementation 'org.robolectric:robolectric:4.3.1'
testImplementation 'org.robolectric:robolectric:4.6.1'
testImplementation "org.json:json:20190722"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.vijay.jsonwizard;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import org.smartregister.client.utils.contract.ClientFormContract;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.support.v7.app.AlertDialog;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;

import com.vijay.jsonwizard.NativeFormLibrary;
import com.vijay.jsonwizard.R;
import com.vijay.jsonwizard.constants.JsonFormConstants;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package com.vijay.jsonwizard.activities;

import static android.view.inputmethod.InputMethodManager.HIDE_NOT_ALWAYS;
import static com.vijay.jsonwizard.utils.FormUtils.getCheckboxValueJsonArray;
import static com.vijay.jsonwizard.utils.FormUtils.getCurrentCheckboxValues;

import android.Manifest;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
Expand All @@ -14,11 +18,6 @@
import android.graphics.drawable.GradientDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.util.Pair;
import android.support.v7.widget.AppCompatRadioButton;
import android.text.Html;
import android.text.Spanned;
import android.text.TextUtils;
Expand All @@ -36,6 +35,12 @@
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatRadioButton;
import androidx.core.app.ActivityCompat;
import androidx.core.util.Pair;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.rengwuxian.materialedittext.MaterialEditText;
Expand Down Expand Up @@ -101,10 +106,6 @@

import timber.log.Timber;

import static android.view.inputmethod.InputMethodManager.HIDE_NOT_ALWAYS;
import static com.vijay.jsonwizard.utils.FormUtils.getCheckboxValueJsonArray;
import static com.vijay.jsonwizard.utils.FormUtils.getCurrentCheckboxValues;

public class JsonFormActivity extends JsonFormBaseActivity implements JsonApi {

private FormUtils formUtils = new FormUtils();
Expand Down Expand Up @@ -1209,7 +1210,7 @@ private void setReadOnlyAndFocus(View view, boolean visible, boolean popup) {
}

/**
* Gets the {@link AppCompatRadioButton} views on the whole {@link com.vijay.jsonwizard.widgets.NativeRadioButtonFactory} and updates the enabled status
* Gets the {@link androidx.appcompat.widget.AppCompatRadioButton} views on the whole {@link com.vijay.jsonwizard.widgets.NativeRadioButtonFactory} and updates the enabled status
*
* @param view {@link View}
* @param enabled {@link Boolean}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package com.vijay.jsonwizard.activities;

import static com.vijay.jsonwizard.utils.NativeFormLangUtils.getTranslatedString;

import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.widget.Toolbar;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.vijay.jsonwizard.NativeFormLibrary;
Expand Down Expand Up @@ -45,8 +48,6 @@

import timber.log.Timber;

import static com.vijay.jsonwizard.utils.NativeFormLangUtils.getTranslatedString;

public abstract class JsonFormBaseActivity extends MultiLanguageActivity implements OnFieldsInvalid, ClientFormContract.View {
protected static final String TAG = JsonFormActivity.class.getSimpleName();
protected static final String JSON_STATE = "jsonState";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.vijay.jsonwizard.activities;

import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;

import com.vijay.jsonwizard.utils.NativeFormLangUtils;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.vijay.jsonwizard.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.vijay.jsonwizard.adapter;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.vijay.jsonwizard.R;
import com.vijay.jsonwizard.domain.MultiSelectItem;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.vijay.jsonwizard.adapter;

import android.graphics.Typeface;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.vijay.jsonwizard.R;
import com.vijay.jsonwizard.constants.JsonFormConstants;
import com.vijay.jsonwizard.domain.MultiSelectItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.view.MotionEvent;

import androidx.annotation.NonNull;

import com.rey.material.drawable.RippleDrawable;
import com.rey.material.widget.RippleManager;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
package com.vijay.jsonwizard.customviews;

import static android.view.inputmethod.InputMethodManager.HIDE_NOT_ALWAYS;

import android.app.Activity;
import android.app.DialogFragment;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.DatePicker;

import androidx.annotation.Nullable;

import com.vijay.jsonwizard.R;
import com.vijay.jsonwizard.utils.DatePickerUtils;

import java.util.Calendar;
import java.util.Date;

import static android.view.inputmethod.InputMethodManager.HIDE_NOT_ALWAYS;

/**
* Created by Jason Rogena - jrogena@ona.io on 08/05/2017.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.vijay.jsonwizard.customviews;

import static android.view.inputmethod.InputMethodManager.HIDE_NOT_ALWAYS;

import android.app.Activity;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.AppCompatImageButton;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -18,6 +17,10 @@
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toolbar;

import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatImageButton;

import com.vijay.jsonwizard.R;
import com.vijay.jsonwizard.constants.JsonFormConstants;
Expand All @@ -37,8 +40,6 @@

import timber.log.Timber;

import static android.view.inputmethod.InputMethodManager.HIDE_NOT_ALWAYS;

/**
* Performs the expansion panel's {@link com.vijay.jsonwizard.widgets.ExpansionPanelFactory} functionality, which includes
* Reading and assigning values on load
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.vijay.jsonwizard.customviews;

import android.content.Context;
import android.support.v7.widget.LinearLayoutCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.widget.LinearLayoutCompat;

import com.vijay.jsonwizard.R;
import com.vijay.jsonwizard.utils.ValidationStatus;

Expand Down
Loading