I am having big problemes with the uiautomator from google. I have a S3 not rooted and I can't run my tests on the device.
Error:
INSTRUMENTATION_RESULT: shortMsg=java.lang.RuntimeException
INSTRUMENTATION_RESULT: longMsg=com.test1.test
INSTRUMENTATION_CODE: 0
I saw some answers that pointed me to root the phone. I do not want to do that.
Please give me some answers how to use the tests.
I was having this same issue! I'm not 100% sure why it was happening, but I think it has to do with the way ant builds the JAR file. When I first started writing my uiautomation tests, I put them in the same project as some JUnit tests, which were in separate packages (one for the source classes and one for the tests). I created my uiautomation tests in the test package, and when I went to build and run them, I got an error that my test classes weren't being found.
I believe this was because the JAR file only included the source package and not the test package. So, I made a new project and put my uiautomation tests in a single source package, built the project, and pushed the JAR to my device. They ran smoothly after that!
I'm pretty new to this stuff too, so I'm not entirely sure if that answers your question. An alternative solution might be to move the UIA tests to the source package instead of creating a whole new project.
Also, Google's resources are really good for getting a basic feel for setting up and using uiautomation (if you haven't checked them out already). If you really can't find a fix, I'd recommend copying and pasting their demo into a fresh project and trying to get that to run: http://developer.android.com/tools/testing/testing_ui.html
Related
I've been having a problem with NetBeans plugin development. I was writing a plugin and was having some trouble with it, so I deleted the plugin folder and started over again. — It's worth noting at this point that I am using a Module Suite, not just a standalone Module.
That all worked fine, until I tried to test another module from the same suite. When I ran the suite and tried to open Tools>Plugins it keeps popping up an error message that said could not find localizing bundle [path to Bundle.properties]
My question is this:
How do I go about clearing the cache of the missing modules so I can test in peace again?
Thanks,
-tlf
The solution to fix this is very simple.
Open the 'files' tab/window/pane/whatever in NetBeans (or open the project in your file browser of choice).
Navigate to your Module.
NOTE: If you are using a Module Suite, navigate to that instead. All further instructions are the same.
Open the build folder.
For precise adjustment, open the testuserdir folder, and tweak away.
To simply reset the test IDE, delete the testuserdir entirely because you, like me, have no idea what to tweak to set what you want, then restart NetBeans (yes you have to, sorry), and run your project!
-tlf
P.S. I want to mention, to prevent confusion, that this question was posted with the "Answer your own question" box checked.
I've tried looking at many other pages and nothing has seemed to solve the problem. I have a program that was written on another computer, and I would like to work on it on the computer I am currently using. I have a bunch of .java files from the other computer and I've put them into the source folder of a Java project I've just created on the computer I'm using, as I'm trying to reproduce the project on the computer I'm currently using. However when I try to run the code it only lets me use ant build. How can I get it to run normally? I do have a main method and I'm trying to run it from that main method.
Yo you may have to make a new project then copy and paste the code in to the package explorer.
Here's a video I found that may help you out. Hit me back if this helps.
https://www.youtube.com/watch?v=bOGxozUTm3Q
I'm using Cobertura 2.3.0 from http://cobertura.github.io/cobertura/ to analyze my project for test coverage, and I'm getting a
Error: Could not find or load main class net.sourceforge.cobertura.instrument.Main
When trying to execute cobertura-instrument.bat from the command line. I've looked at this batch file and it's trying to load several JARs from the %COBERTURA_HOME%/lib folder that don't exist. I've manually downloaded these JARs but am getting other strange errors.
java.lang.IncompatibleClassChangeError: class net.sourceforge.cobertura.instrument.pass1.DetectIgnoredCodeClassVisitor has interface org.objectweb.asm.ClassVisitor as super class
Is it possible that this release was incorrectly updated? I don't see a way to make this work any other way. Further, does anybody know of a working test-coverage utility, preferably a working different version of Cobertura?
I've tried Nounit and several others, but have not gotten the type of clean output that I know Cobertura can produce.
Answering my own question in hopes it can help somebody.
At time of writing, there is a known bug with Cobertura throwing a ClassNotFoundException in certain circumstances. See the following issue tracker page: https://github.com/cobertura/cobertura/issues/74#issuecomment-41383903
For the time being, I've gone with EclEmma Eclipse plugin for EMMA for my test code coverage, and got nice, pretty results the way I wanted.
So my issue is the same as the title. I have TeamCity v. 8.0.3 (build 27540), and have several test packs set in place. The issue is that I wrote a test in Eclipse, moved it to another package, and now every time that the test build kicks off in TC it runs that test two times, once for the original package(even though it's not there anymore), and once for the new package.
I haven't seen this happening for any test before, and would like to know if anyone encountered this situation and if they have a solution.
Any help is much appreciated.
Most likely files left from the previous build. If you enable Swabra it will clean such files automatically.
You probably need to clean your project - the old .class files are likely to be hanging around. If you're using maven, change the invocation to include the clean phase. Make sure you didn't accidentally check in the .class files, too.
I am trying to get our build machine to consistently build our Blackberry project (build using the Eclipse plugin not the JDE) on check-in. We are using Jenkins to call the project and sometimes it works but only after I've fired up the project in eclipse on the far machine but then restarting causes the error to come back.
The first error I get is (the following errors are all in the same vein):
[javac] c:\<path_to_project>\src\path\to\package\class.java:6: error: package net.rim.device.api.ui does not exist
And every other reference to a net.rim.* object. Clearly it's because it's not linking to the target net_rim_api.jar file but I can't figure out what on earth is going wrong. I've tried poking at the build.xml file but I just get more errors and other versions of this error in other threads turn out to be not the same thing.
I have tried installing and using BB-Ant (roughly following this tutorial) but it has not provided me with the solution - I'm prepared to admit that I may have made a mistake in the implementation but I followed it as closely as I could with the current project that I have.
I would appreciate any help that you can give me.
EDIT
So I've now altered the project to use <rapc> instead of <javac> which appears to do the linking to the .jar for you but it's still frustrating that you can't simply use the auto generated build.xml. Is this a known (and due to lack of information available on the internet, accepted) issue with Eclipse?
I went down the BB Ant build script road a year or so ago, got a lot of help on this site, and tried to document my progress on this site. Hopefully the links I place will help you and others.
I have marked this as "community wiki" since it doesn't directly answer the question but I do think it is useful.
Basic algorithm
My answer on this page shows the algorithm for a working build script (BlackBerry: create COD from JAR source file in Ant script). Perhaps this is more complicated than you are looking for, but it does show the relationship I found between javac and rapc.
To summarise, I wanted to include my SDK into the final build, and the steps were:
javac the SDK to create CLASS files
preverify the CLASS files
jar the SDK
Copy the SDK JAR file into the project
javac the project - use the SDK JAR as the classpath
preverify the project CLASS files (again, use the SDK JAR in the
classpath)
jar the project - add the SDK JAR as a zipfileset
jarjar this project JAR to refactor package names as required
Finally, run rapc on this JAR - it will find no duplicate COD files
& should run fine.
Please read the other answers on that page, since they offer great advice that I used in my end result.
Extra Info & Including a JAR into final output
I'd recommend this page just for the extra links that I included in it - the exact question is unrelated (BlackBerry - Ant script to include JAR in project without external dependancies).
Again, the value is in the answers that the other guys provided.
Misc
Here are a couple of links to other BB build script issues that I had - you or someone may find them useful:
BlackBerry - Ant build script for more complex apps
BlackBerry - final step of build process
Finally this one speaks to a mistake in the documentation when compiling your own code into a library for import into a different project:
BlackBerry - use own JAR file in own project