Search in sources :

Example 1 with PredictionsCategory

use of com.amplifyframework.predictions.PredictionsCategory in project amplify-android by aws-amplify.

the class AWSPredictionsInterpretTest method setUp.

/**
 * Configure Predictions category before each test.
 * @throws Exception if mobile client initialization fails
 */
@Before
public void setUp() throws Exception {
    Context context = getApplicationContext();
    // Set up Auth
    SynchronousMobileClient.instance().initialize();
    // Delegate to Predictions category
    PredictionsCategory asyncDelegate = TestPredictionsCategory.create(context, R.raw.amplifyconfiguration);
    predictions = SynchronousPredictions.delegatingTo(asyncDelegate);
}
Also used : Context(android.content.Context) ApplicationProvider.getApplicationContext(androidx.test.core.app.ApplicationProvider.getApplicationContext) PredictionsCategory(com.amplifyframework.predictions.PredictionsCategory) Before(org.junit.Before)

Example 2 with PredictionsCategory

use of com.amplifyframework.predictions.PredictionsCategory in project amplify-android by aws-amplify.

the class AWSPredictionsTextToSpeechTest method setUp.

/**
 * Configure Predictions category before each test.
 * @throws Exception if mobile client initialization fails
 */
@Before
public void setUp() throws Exception {
    Context context = getApplicationContext();
    // Set up Auth
    SynchronousMobileClient.instance().initialize();
    // Delegate to Predictions category
    PredictionsCategory asyncDelegate = TestPredictionsCategory.create(context, R.raw.amplifyconfiguration);
    predictions = SynchronousPredictions.delegatingTo(asyncDelegate);
}
Also used : Context(android.content.Context) ApplicationProvider.getApplicationContext(androidx.test.core.app.ApplicationProvider.getApplicationContext) PredictionsCategory(com.amplifyframework.predictions.PredictionsCategory) Before(org.junit.Before)

Example 3 with PredictionsCategory

use of com.amplifyframework.predictions.PredictionsCategory in project amplify-android by aws-amplify.

the class AWSPredictionsIdentifyCelebritiesTest method setUp.

/**
 * Configure Predictions category before each test.
 * @throws Exception if mobile client initialization fails
 */
@Before
public void setUp() throws Exception {
    Context context = getApplicationContext();
    // Set up Auth
    SynchronousMobileClient.instance().initialize();
    // Delegate to Predictions category
    PredictionsCategory asyncDelegate = TestPredictionsCategory.create(context, R.raw.amplifyconfiguration);
    predictions = SynchronousPredictions.delegatingTo(asyncDelegate);
}
Also used : Context(android.content.Context) ApplicationProvider.getApplicationContext(androidx.test.core.app.ApplicationProvider.getApplicationContext) PredictionsCategory(com.amplifyframework.predictions.PredictionsCategory) Before(org.junit.Before)

Example 4 with PredictionsCategory

use of com.amplifyframework.predictions.PredictionsCategory in project amplify-android by aws-amplify.

the class AWSPredictionsIdentifyEntitiesTest method setUp.

/**
 * Configure Predictions category before each test.
 * @throws Exception if mobile client initialization fails
 */
@Before
public void setUp() throws Exception {
    Context context = getApplicationContext();
    // Set up Auth
    SynchronousMobileClient.instance().initialize();
    // Delegate to Predictions category
    PredictionsCategory asyncDelegate = TestPredictionsCategory.create(context, R.raw.amplifyconfiguration);
    predictions = SynchronousPredictions.delegatingTo(asyncDelegate);
}
Also used : Context(android.content.Context) ApplicationProvider.getApplicationContext(androidx.test.core.app.ApplicationProvider.getApplicationContext) PredictionsCategory(com.amplifyframework.predictions.PredictionsCategory) Before(org.junit.Before)

Example 5 with PredictionsCategory

use of com.amplifyframework.predictions.PredictionsCategory in project amplify-android by aws-amplify.

the class AWSPredictionsIdentifyLabelsTest method setUp.

/**
 * Configure Predictions category before each test.
 * @throws Exception if mobile client initialization fails
 */
@Before
public void setUp() throws Exception {
    Context context = getApplicationContext();
    // Set up Auth
    SynchronousMobileClient.instance().initialize();
    // Delegate to Predictions category
    PredictionsCategory asyncDelegate = TestPredictionsCategory.create(context, R.raw.amplifyconfiguration);
    predictions = SynchronousPredictions.delegatingTo(asyncDelegate);
}
Also used : Context(android.content.Context) ApplicationProvider.getApplicationContext(androidx.test.core.app.ApplicationProvider.getApplicationContext) PredictionsCategory(com.amplifyframework.predictions.PredictionsCategory) Before(org.junit.Before)

Aggregations

PredictionsCategory (com.amplifyframework.predictions.PredictionsCategory)8 Context (android.content.Context)7 ApplicationProvider.getApplicationContext (androidx.test.core.app.ApplicationProvider.getApplicationContext)7 Before (org.junit.Before)7 AmplifyException (com.amplifyframework.AmplifyException)1 CategoryConfiguration (com.amplifyframework.core.category.CategoryConfiguration)1