Using Instrumentation during ActivityInstrumentationTestCase

by James » Tue, 23 Dec 2008 22:17:34 GMT


Sponsored Links
 I'm running my ActivityInstrumentationTestCase.  it runs in the
emulator.  I can watch the Intents triggering Activities in 'adb
logcat".  I see in the logcat output that the Activity was displayed:

I/ActivityManager(   50): Displayed activity my.manifest.packate/
my.package.CountingActivity: 556 ms

so I believe I've sent the keys to press the button that fire the
startActivity.  What I'm not seeing is the monitor that I've added
through the test.  My waitForMonitorWithTimeout always times out.
Here is the part of the unit test that sets up the monitor, triggers
it, then waits:

                ActivityResult result = new ActivityResult(1, null);
                String activityClassName = "my.manifest.packate/
my.package.CountingActivity";
                ActivityMonitor monitor = getInstrumentation().addMonitor
(activityClassName, result, true);

                sendKeys(KeyEvent.KEYCODE_ENTER);

                System.out.println("wait for timeout");
                Activity actualActivity = getInstrumentation
().waitForMonitorWithTimeout(monitor, 20000);
                System.out.println("after timeout");
                assertNotNull("non null activity means the monitor was invoked",
actualActivity);

The activity implementation "CountingActivity" has a sysout, it always
prints in logcat after "wait for timeout" and before "after timeout",
but the actualActivity is always null.  I show here using the full
<package>/<full-class-name> for the activityClassName.  I began with
out the "<package>/" and used just the classname, but that had the
same effect -- never triggering the monitor.  Further evidence that
I'm not registering the monitor correctly is that that addMonitor call
with true at the end should skip the actual Activity and return my
canned result.

Has anyone successfully tested with this process?
--~--~---------~--~----~------------~-------~--~----~



Using Instrumentation during ActivityInstrumentationTestCase

by James » Tue, 30 Dec 2008 03:12:58 GMT


 I didn't get any responses from the "Android Beginners" group, so
after a few days wait I'm trying this group.  I'm trying to use the
provided methods on the Instrumentation instance given to
ActivityInstrumentationTestCase classes.  I could not find a book
listed on Amazon (available or pre-release) that covered unit
testing.  I scanned the table of contents of all the Android books I
found.  If you know of one, please point it out.

I'm running my ActivityInstrumentationTestCase.  it runs in the
emulator.  I can watch the Intents triggering Activities in 'adb
logcat".  I see in the logcat output that the Activity was displayed:

I/ActivityManager(   50): Displayed activity my.manifest.package/
my.package.CountingActivity: 556 ms

so I believe I've sent the keys to press the button that fire the
startActivity.  What I'm not seeing is the monitor that I've added
through the test.  My waitForMonitorWithTimeout always times out.
Here is the part of the unit test that sets up the monitor, triggers
it, then waits:

                ActivityResult result = new ActivityResult(1, null);
                String activityClassName = "my.manifest.packate/
my.package.CountingActivity";
                ActivityMonitor monitor = getInstrumentation
().addMonitor
(activityClassName, result, true);

                sendKeys(KeyEvent.KEYCODE_ENTER);

                System.out.println("wait for timeout");
                Activity actualActivity = getInstrumentation
().waitForMonitorWithTimeout(monitor, 20000);
                System.out.println("after timeout");
                assertNotNull("non null activity means the monitor was
invoked",
actualActivity);

The activity implementation "CountingActivity" has a sysout, it always
prints in logcat after "wait for timeout" and before "after timeout",
but the actualActivity is always null.  I show here using the full
<package>/<full-class-name> for the activityClassName.  I began with
out the "<package>/" and used just the classname, but that had the
same effect -- never triggering the monitor.  Further evidence that
I'm not registering the monitor correctly is that that addMonitor call
with true at the end should skip the actual Activity and return my
canned result.

Has anyone successfully tested with these methods from
Instrumentation?

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Debt Consolidation Program: Pay lowers rates and consolidates your Payments[finance4u.yolasite]

.
.
.
READ MORE----------------
http://finance4u.yolasite.com/online-make-money/debt-consolidation-program-pay-lowers-rates-and-consolidates-your-payments-finance4u-yolasite-
.
.
.




Debt Consolidation Program: Pay lowers rates and consolidates your
Payments[finance4u.yolasite]

Are you struggling to handle your bills? A good bill consolidation or
debt consolidation program could help you to manage it better. This
program  s main objective is to provide necessary aids to you, for
meeting your existing monthly payments, as well as to help you to wipe
out your debt.

Working principle of debt consolidation programs

Consolidation programs have adopted an approach, which could help you
to lower the monthly payments that you have to make. Moreover, they
will help you to get rid of extra charges or late fees.
Important steps involved in a consolidation program are given below

.
.
.
READ MORE----------------
http://finance4u.yolasite.com/online-make-money/debt-consolidation-program-pay-lowers-rates-and-consolidates-your-payments-finance4u-yolasite-
.
.
.

First Step: Avail free debt counseling without obligation

First of all, get in touch with any debt relief firm. Then, try to
attend their free counseling session undertaken by their consultant.
Their consultant will analyze the financial situation that you are
currently facing. Consultant will conduct your income as well as
expenditure review, for finding out the amount that you could afford
to pay, to meet your various monthly bills.

Second Step: Register your name with a debt consolidation program

Your consultant will mail you the necessary documents that you will
have to sign, if he comes across any consolidation program, which will
offer you the most suitable solution. From the consultant, you will
receive the details about the required fees as well as the authority
form, which will entitle him to have meetings and discussions with
your creditors, as your representative.

.
.
.
READ MORE----------------
http://finance4u.yolasite.com/online-make-money/debt-consolidation-program-pay-lowers-rates-and-consolidates-your-payments-finance4u-yolasite-
.
.
.

Third step: Consultant will begin handling your creditor calls

After you receive the documents, your consultant will contact you for
clarifying your doubts, before you put signature on those documents.
At this juncture, you can start diverting calls from your creditors to
your consultant, and he will speak up for you.

Fourth Step: Consultant will negotiate for you as your representative

regarding your unsettled balances remaining on your debt accounts.
This will help your consultant to undertake a comprehensive income as
well as expenditure analysis. After that, he will send the report to
your


.
.
.
READ MORE----------------
http://finance4u.yolasite.com/online-make-money/debt-consolidation-program-pay-lowers-rates-and-consolidates-your-payments-finance4u-yolasite-
.
.
.



various creditors, incorporating a payment plan proposal, which is
affordable for you.
Subsequently, your consultant will work with all your creditors or
collection agencies for lowering the interest rates, which you pay,
thereby reducing monthly payments. Consultant will ask your creditors
to waive or lower additional charges as well as late fees, which are
added on to your debt accounts, inorder to avoid those payments
altogether.

Fifth Step: You can send the monthly payment through your consolidation firm
You should send your monthly payment to your consolidation firm, and
they will disburse that amount to various collection agencies or
creditors, whom you owe money. Therefore, various bills get
consolidated into one entity of monthly payment. Hence, you can have
sigh of relief about the managing numerous creditors simultaneously.

Sixth step: Your creditors will get their payment from consolidation firm
After receiving payment from you, consolidation firm will forward that
amount to various creditors, in matter of few days. You might get
creditor statements from creditors as proof of receiving your payment.


.
.
.
READ MORE----------------
http://finance4u.yolasite.com/online-make-money/debt-consolidation-program-pay-lowers-rates-and-consolidates-your-payments-finance4u-yolasite-
.
.
.

-- 

2. How to succeed with affiliate marketing[finance4u.yolasite]

.
.
.
READ MORE--------
http://finance4u.yolasite.com/online-make-money/how-to-succeed-with-affiliate-marketing-finance4u-yolasite-
.
.
.
,
Getting started in internet marketing seems easy at first, but later
most of the people struggle with the information overload. You have to
keep your focus otherwise you will get lost in the jungle!

In today's financial situation huge masses are turning to the internet
trying to discover a solution for their hardened financial situation.
The most popular way to earn money online is called affiliate
marketing
, as it is actually the kind of business
that requires the least investment (usually zero) and can be
advantageously learned by everyday individuals. However you have to
get used to having no bosses, deadlines, and you have to create your
own resources, statistics, methods, blueprints and manage your own
budget. You don't have fixed hours, set pile of work for the day, so
many folks just get carried away with no chance to realizing what they
are doing to develop their affiliate marketing business.
.
.
.
READ MORE--------
http://finance4u.yolasite.com/online-make-money/how-to-succeed-with-affiliate-marketing-finance4u-yolasite-
.
.
.
,
There are a couple of qualities you have to have in order to succeed
in affiliate marketing. Remember your hold up job interview when they
asked you why do you desire to work for the particular company? What
they really meant: do you have the qualities we need, the insight to
the industry you can create wealth from while you are working for us?
It exists the same with using affiliate marketing, too. You have to
have the background, willingness and tools in order to become
successful and become a master of your field.

You want to have a strong desire to go through a learning curve. You
likewise require the willingness and ability to be trained. You have
to have the frame of mind, and also a strong work ethic. As you don't
have teachers or bosses, your time compromises in your hand and you
have to make sure that you are using it to develop your affiliate
marketing business. When you are starting up, you have to keep your
eyes and ears open, listening to different people's stories,
experience and testimonials.
.
.
.
READ MORE--------
http://finance4u.yolasite.com/online-make-money/how-to-succeed-with-affiliate-marketing-finance4u-yolasite-
.
.
.
,
The only reason people feel they are struggling in internet marketing
is that they keep on losing focus. You should always keep your goals
fresh, keep on doing the things that produce the most results first,
and don't get distracted by the latest "guru hype" every minute, build
a path and follow it, if you think it is not the right one, or
something is not working, tweak it until it serves your business.
Super Affiliates are not born: they are created. And they can only be
created by themselves. If you don't have the wilfulness and motivation
to succeed, you can pay thousands of dollars to teach you affiliate
marketing, you will still fail.
You need to invest time and effort especially when you are starting
up. You must be ready to work on your goals and set up a realistic
plan ordinary that you would like to achieve and keep your knowledge
up to date. You cannot expect overnight success, so it represents
important that you don't give up in the beginning, if you are with no
chance to producing sales, it exists ok, work harder or smarter,
analyze your methods and change them to the better. with no chance to
everything you try out represents going to be a success in your
affiliate marketing business, so you will have to spend loads of time
testing which can be sometimes boring, and time consuming as well.

You require a huge amount of determination. If you want to build up a
success in the affiliate marketing world, you must be self motivated
enough to push yourself forward every day. The amount of courage you
have to motivate yourself equals going to detect your affiliate
marketing business's future.

You will want discipline. If you are ready to teach yourself to work
every single never special masses pushing you, you're on the way to
success, therefore you will be able to achieve more results every
single day by keeping your goals ahead of you, and finally achieve
them.

You have to keep being optimistic. Your failures and disappointments
shouldn't deter an affiliate marketer from working towards their
dreams in order to build up their life develop. You shouldn't have a
negative attitude even when it comes to your online business
, it should always be good, as you are the head and your attitude will
find your whole business and your affiliate marketer future.
.
.
.
READ MORE--------
http://finance4u.yolasite.com/online-make-money/how-to-succeed-with-affiliate-marketing-finance4u-yolasite-
.
.
.
,
If you are keeping up your motivation, willingness to go through a
learning curve and attitude, you will achieve more than you even
thought possible in your affiliate marketing business. You will
require these abilities to build your online business' success,
affiliate marketing can be a really rewarding long term outlook with
the chance of cutting back on your tasks and still increasing your
profits with time.
Once you managed to find the promotion methods that work for you, you
really just have to tweak your online marketing to maximize your
success.
.
.
.
READ MORE--------
http://finance4u.yolasite.com/online-make-money/how-to-succeed-with-affiliate-marketing-finance4u-yolasite-
.
.
.
,

-- 

3. Change the font size of the Progress Dialog box

4. Change the font size of the Progress Dialog box

5. Change the font size of the Progress Dialog box

6. How can I get all the name of activities in the android system ?

7. How should I handle a DB Delete Confirmation?