Displaying keyword search results 1 - 6
Created by freyo on September 07, 2011 16:46:14 Last update: September 07, 2011 19:23:00
The Android unit test framework is based on JUnit 3 , not JUnit 4. Test cases have to extend junit.framework.TestCase or a subclass (such as android.test.InstrumentationTestCase ). Tests are identified by public methods whose name starts with test , not methods annotated with @Test (as in JUnit 4). An Android test suite is packaged as an APK, just like the application being tested. To create a test package, first you need to identify the application package it is testing. Google suggests to put the test package source in a directory named tests/ alongside the src/ directory of the main application. At runtime, Android instrumentation loads both the test package and the application under test into the same process. Therefore, the tests can invoke methods on...
Created by jinx on April 29, 2011 15:03:10 Last update: April 29, 2011 15:04:02
The PHP function is_callable verifies that a variable can be invoked as a function. Example:
<?php define('F', 'f'); function...Output:
var_dump: string(1) "f" is_callable: 1 Calla...
Created by Dr. Xi on March 02, 2011 11:39:18 Last update: March 09, 2011 12:19:30
Some peculiarities about Java PrintWriter: PrintWriter never throws any exceptions. From JavaDoc : Methods in this class never throw I/O exceptions, although some of its constructors may. The client may inquire as to whether any errors have occurred by invoking checkError(). When error occurs, you'll never know anything more than that it occured, because checkError returns boolean. When a character is out of the range of the character encoding of the PrintWriter, it prints a question mark (?). But this is not an error. Test code:
import java.io.*; public class TestPrintWri...Latin1 test result:
java TestPrintWriter iso-8859-1 | od -bc 000000...UTF-8 test result:
java TestPrintWriter utf-8 | od -bc 0000000 141...Also, the constructor throws a FileNotFoundException when you try to write to a...
Created by Dr. Xi on January 07, 2010 22:56:20 Last update: March 22, 2010 01:52:48
If the error reads:
java.lang.LinkageError: Class javax/xml/rpc/encodi...then the class javax.xml.rpc.encoding.TypeMappingRegistry is loaded by two or more different class loaders, and the versions are not compatible. For example, one might be under WEB-INF/lib, another might be loaded through an EJB. The solution is to get rid of the duplicate versions .
OC4J: Exception creating EntityManagerFactory using PersistenceProvider class org.hibernate.ejb.HibernatePersistence for persistence unit DefaultPU
Created by Dr. Xi on March 02, 2010 00:07:48 Last update: March 02, 2010 00:07:48
OC4J didn't offer much help in the console. This is all it displayed:
2010-03-01 15:48:21.372 ERROR J2EE EJB-03027 [Fab...However, in the em console, Logs -> Diagnostic Logs gives more details: Message Text
[FabulousApp] An error occured deploying EJB mod...Supplemental Text
com.evermind.server.ejb.exception.DeploymentExcept...The error was caused by a relationship annotation between two entities, the referenced attribute was removed from the owner side:
Created by Dr. Xi on August 15, 2007 18:08:34 Last update: November 08, 2007 22:00:01
I had this problem when deploying a J2EE application into Oracle app server. It worked fine with an OC4J container configured in the default group. But it failed to start with an OC4J container I created. Here's a sample stack trace of the initialization exception:
07/08/14 13:32:46.34 10.1.3.3.0 Started 07/08/1...The problem was, the struts ActionServlet loads commons logging LogFactory, the log factory somehow knows that it needs log4j, but it can't load log4j since it's loaded by a different class loader. The solution for Oracle is to omit commons logging from the list of inherited libraries. Add this to META-INF/orion-application.xml solves the problem:
<imported-shared-libraries> <remove-inhe...Actually, this is a quite common problem with commons-logging. If you search the web, you'll find that people have...