Search in sources :

Example 6 with IRecommendationsChangeListener

use of android.printservice.recommendation.IRecommendationsChangeListener in project android_frameworks_base by ResurrectionRemix.

the class IPrintManagerParametersTest method testAddPrintServiceRecommendationsChangeListener.

/**
     * test IPrintManager.addPrintServiceRecommendationsChangeListener
     */
@MediumTest
public void testAddPrintServiceRecommendationsChangeListener() throws Exception {
    final IRecommendationsChangeListener listener = createMockIPrintServiceRecommendationsChangeListener();
    mIPrintManager.addPrintServiceRecommendationsChangeListener(listener, mUserId);
    assertException(new Invokable() {

        @Override
        public void run() throws Exception {
            mIPrintManager.addPrintServiceRecommendationsChangeListener(null, mUserId);
        }
    }, NullPointerException.class);
// Cannot test bad user Id as these tests are allowed to call across users
}
Also used : IRecommendationsChangeListener(android.printservice.recommendation.IRecommendationsChangeListener) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 7 with IRecommendationsChangeListener

use of android.printservice.recommendation.IRecommendationsChangeListener in project android_frameworks_base by DirtyUnicorns.

the class IPrintManagerParametersTest method testAddPrintServiceRecommendationsChangeListener.

/**
     * test IPrintManager.addPrintServiceRecommendationsChangeListener
     */
@MediumTest
public void testAddPrintServiceRecommendationsChangeListener() throws Exception {
    final IRecommendationsChangeListener listener = createMockIPrintServiceRecommendationsChangeListener();
    mIPrintManager.addPrintServiceRecommendationsChangeListener(listener, mUserId);
    assertException(new Invokable() {

        @Override
        public void run() throws Exception {
            mIPrintManager.addPrintServiceRecommendationsChangeListener(null, mUserId);
        }
    }, NullPointerException.class);
// Cannot test bad user Id as these tests are allowed to call across users
}
Also used : IRecommendationsChangeListener(android.printservice.recommendation.IRecommendationsChangeListener) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 8 with IRecommendationsChangeListener

use of android.printservice.recommendation.IRecommendationsChangeListener in project android_frameworks_base by DirtyUnicorns.

the class IPrintManagerParametersTest method testRemovePrintServiceRecommendationsChangeListener.

/**
     * test IPrintManager.removePrintServicesChangeListener
     */
@MediumTest
public void testRemovePrintServiceRecommendationsChangeListener() throws Exception {
    final IRecommendationsChangeListener listener = createMockIPrintServiceRecommendationsChangeListener();
    mIPrintManager.addPrintServiceRecommendationsChangeListener(listener, mUserId);
    mIPrintManager.removePrintServiceRecommendationsChangeListener(listener, mUserId);
    // Removing unknown listeners is a no-op
    mIPrintManager.removePrintServiceRecommendationsChangeListener(listener, mUserId);
    mIPrintManager.addPrintServiceRecommendationsChangeListener(listener, mUserId);
    assertException(new Invokable() {

        @Override
        public void run() throws Exception {
            mIPrintManager.removePrintServiceRecommendationsChangeListener(null, mUserId);
        }
    }, NullPointerException.class);
// Cannot test bad user Id as these tests are allowed to call across users
}
Also used : IRecommendationsChangeListener(android.printservice.recommendation.IRecommendationsChangeListener) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 9 with IRecommendationsChangeListener

use of android.printservice.recommendation.IRecommendationsChangeListener in project android_frameworks_base by crdroidandroid.

the class IPrintManagerParametersTest method testRemovePrintServiceRecommendationsChangeListener.

/**
     * test IPrintManager.removePrintServicesChangeListener
     */
@MediumTest
public void testRemovePrintServiceRecommendationsChangeListener() throws Exception {
    final IRecommendationsChangeListener listener = createMockIPrintServiceRecommendationsChangeListener();
    mIPrintManager.addPrintServiceRecommendationsChangeListener(listener, mUserId);
    mIPrintManager.removePrintServiceRecommendationsChangeListener(listener, mUserId);
    // Removing unknown listeners is a no-op
    mIPrintManager.removePrintServiceRecommendationsChangeListener(listener, mUserId);
    mIPrintManager.addPrintServiceRecommendationsChangeListener(listener, mUserId);
    assertException(new Invokable() {

        @Override
        public void run() throws Exception {
            mIPrintManager.removePrintServiceRecommendationsChangeListener(null, mUserId);
        }
    }, NullPointerException.class);
// Cannot test bad user Id as these tests are allowed to call across users
}
Also used : IRecommendationsChangeListener(android.printservice.recommendation.IRecommendationsChangeListener) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 10 with IRecommendationsChangeListener

use of android.printservice.recommendation.IRecommendationsChangeListener in project android_frameworks_base by crdroidandroid.

the class IPrintManagerParametersTest method testAddPrintServiceRecommendationsChangeListener.

/**
     * test IPrintManager.addPrintServiceRecommendationsChangeListener
     */
@MediumTest
public void testAddPrintServiceRecommendationsChangeListener() throws Exception {
    final IRecommendationsChangeListener listener = createMockIPrintServiceRecommendationsChangeListener();
    mIPrintManager.addPrintServiceRecommendationsChangeListener(listener, mUserId);
    assertException(new Invokable() {

        @Override
        public void run() throws Exception {
            mIPrintManager.addPrintServiceRecommendationsChangeListener(null, mUserId);
        }
    }, NullPointerException.class);
// Cannot test bad user Id as these tests are allowed to call across users
}
Also used : IRecommendationsChangeListener(android.printservice.recommendation.IRecommendationsChangeListener) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Aggregations

IRecommendationsChangeListener (android.printservice.recommendation.IRecommendationsChangeListener)10 MediumTest (android.test.suitebuilder.annotation.MediumTest)10