Nov 7, 2009

Thomson Prometric Testing Centres, Hyderabad


PROMETRIC TESTING (P) LTD
HYDERABAD, Andhra Pradesh 500034
Phone: 4023303903 Site Code: II001

AVENUE 1 STREET 20, ABOVE SBI
PLOT 1672 ROAD 12
BANJARA HILLS


Telesis Technologies P Ltd.
Hyderabad, Andhra Pradesh 500020
Phone: 27666894 Site Code: II412

1-1-162,
III floor, Crystal building
RTC X Raods
Opp Big Bazaar


NIIT Ltd.
Hyderabad, Andhra Pradesh 500063
Phone: 66622249 Site Code: IIC

2nd Floor
Prashanti Complex
Opp. to Old Gandhi Medical College
Basheerbagh


CMS Info Systems Private Limited
Hyderabad, Andhra Pradesh 500003
Phone: 40100088 Site Code: IIH50

CMS COMPUTERS LTD
#19,2ND FLOOR,HARDY COMPLEX
OPP.CHERMAS,M.G.ROAD,
Paradise,Secunderabad


NIIT Ltd.-Ameerpet
Hyderabad, Arunachal Pradesh 500016
Phone: 66747792 Site Code: IIN36

4th Floor
Pavan Vanijya Vihar
Beside R S Brothers
Above Srikrishna Sweets


KARROX TECHNOLOGIES LTD
Hyderabad, Andhra Pradesh 500016
Phone: 66625561 Site Code: II449

6-3-788/A/10
Opp. Lane Chandana Bros
Durganagar Colony
Ameerpet


HCL Infosystems Limited
Hyderabad, Andhra Pradesh 500003
Phone: 27890520 Site Code: II582

503-504,5th Floor
Minerva Complex
S D Road
Near Park Lane

Oct 7, 2009

Steps to Increase ulimit

Steps to Increase ulimit for RedHat Linux

for more info about ulimit:- http://uw713doc.sco.com/en/man/html.1/ulimit.1.html

Add below line to /etc/profile
ulimit -n 10000

Add below lines to /etc/security/limits.conf
GUID  hard    nofile  10000
GUID  hard    nofile  10000

& Restart the system.

Sep 26, 2009

Dependency Injection (DI)



The primary goal of dependency injection (DI) is to make component interdependencies as loosely coupled as possible. In real terms, this means that one component should call another component or resource only through an interface and that components and resources should be glued together using configuration instead of code. As a result, component implementations can easily be swapped out as necessary simply by reconfiguring the application.

Add Image

Sep 18, 2009

Weblogic Logging

$BEA_HOME/user_projects/domains/base_domain/config/fmwconfig/servers/logger.xml
$BEA_HOME/user_projects/domains/base_domain/servers/new_ManagedServer_1/logs
/new_ManagedServer_1.log

Aug 16, 2009

Weblogic server path

String user_dir = System.getProperty ("user.dir");
System.out.println(user_dir);

Output:-
C:\Documents and Settings\userid\Application Data\JDeveloper\system11.1.1.1.32.52.37\DefaultDomain

Jul 15, 2009

JUnits - Do’s and Dont’s

After the Junit cleanup last whole month, here are my few cents.

A JUnit test case can contain multiple tests. Each test is implemented by a method. The declaration of a test method must comply to a set of conventions in order to help JUnit and associated tools to automate the discovery and execution of tests. These conventions are:
1. The name of the method must begin with “test”, like in “testValidateOperator”,
2. The return type of a test method must be null,
3. A test method must not throw any exception,
4. A test method must not have any parameter.

There are a few details of which you should be aware of when writing JUnit tests. First of all, when executing a test case, JUnit will instantiate the test case class as many time as there are test methods. That is, each test method will be executed on a different instance of the test case class. Before calling the test method, JUnit will call the setUp() method. The tearDown() method will be called after the test method completes – successfully or not. The setUp() and tearDown() methods should be used to create and then clean up the test environment.

Good practices to be followed while writing a JUnit:

• Write tests for methods that have the fewest dependencies first. If you start by testing a high-level method, your test may fail because a subordinate method may return an incorrect value to the method under test. This increases the time spent finding the source of the problem, and you will still have to test the subordinate method anyway to be sure it does not contain other bugs.

• Tests should be logically simple as possible, preferably with no decisions at all. Every decision added to a test method increases the number of possible ways that a test method can be executed. Testing is meant to be a controlled environment; the only thing you want to change is the input to the method under test, not the test method itself.

• Wherever possible, use constant as expected values in your assertions instead of computed values. Consider these two assertions:

returnVal = getDiscountCode(input);
assertEquals(returnVal, computeDiscountCode(input));
assertEquals(returnVal, “023”);

In order for computeDiscountCode() to return the proper result it probably has to implement the same logic as the getDiscountCode(), which is what you are trying to test for in the first place. Further, suppose you fixed a defect in the getDiscountCode (). Now you have to change computeDiscountCode () in the same manner. The second assertion is easier to understand and maintain.

• Each unit test should be independent of all other tests.
A unit test should execute one specific behavior for a single method. Validating behavior of multiple methods is problematic as such coupling can increase refactoring time and effort. Consider the following example:

void testAdd()
{
int return1 = myClass.add(1,2);
int return2 = myclass.add(-1,-2);
assertTrue (return1 – return2 == 0);
}

If the assertions fails in this case, it will be difficult to determine which invocation of add() caused the problem.

• Each unit test should be clearly named and documented.
The name of the test method should clearly indicate which method is being tested because improperly named tests increase maintenance and refactoring efforts. Comments should also be used to describe the test or any special conditions.

• All methods, regardless of visibility, should have appropriate unit tests.
Public, private and protected methods that contain data and decisions should be unit tested in isolation.

• One assertion per test case.
Avoid using multiple assertions in one test case. For example, if a test case with five assertions fails on the first assertion, then the remaining four are not executed. Only when the first assertion is corrected will the other assertions execute. If assertion two fails, then that also must be corrected before the remaining three assertions are verified. Although the unit test file may be large, it will be easier to find and fix defects.

• Create unit tests that target exceptions.
Exceptions are thrown when a method finds itself in a state it cannot handle. These cases should be tested just like a method’s normal state of operations. If a method is declared to throw one or more exceptions, then unit tests must be create that simulate the circumstances under which those exceptions could be thrown. The unit tests should assert that the exceptions are thrown as expected.

Please let me know if this helps. Happy coding Junits…!!