Posts

How to  Implement a Fall-Back Feature How will you handle the situation when you have a big release which consists of multiple modules being integrated in one go for Production Release of your appilcation ?  Taking into consideration there might be issue with any of one of ingredient module’s code, will make entire application do go down - and hence the business will be down. A simple flaw in one file may make your entire application to get down. = Here is the approach:  Design a Table in database which will hold two columns ModuleNames and  flag. ModuleName will store the name of multiple modules which are being released in current release. When the application starts it reads the ModuleName & Flag in memory.  We may store the value from the following table in a static HashMap as  < String, boolean > . Module_id (PK) Module_Name isEnabled (Flag) Dependent_Module_id(FK) 1 Prot...
MAVEN : How to read Jar files or library from intranet of your Company. You might be given the POM.XML information to download the jars, like: Maven Plugin : explanation: < dependency >    < groupId >com.mycompany.165654.GMNABRAVE.PUSH< /groupId >    < artifactId >GMPPUSH< /artifactId >    < version >GMNABRAVEPUSH-3.0.1< /version > < /dependency > Means look SETTING.XML  it should have URL and location of above JAR, like: < repository > < id >releases< /id > < url >http://sd-879d-d482:8081/nexus/content/repositories/releases< /url > < releases > < enabled >true< /enabled > < /releases > < /repository > < repository > It means go to browser and open the following link. There you will see the required JAR: http://sd-879d-d482:8081/nexus/content/repositories/snapshots/com/mycompany/165654/GMNABRAVE/PUSH/GMPPUSH...
MVN Build: Sometime you will see the MVN build in Eclipse is failing and the same is successful in command promt. Here are some commands that you can use to run on command prompt. C:\ mvn clean install -X To escapre test cases: C:\ mvn clean install -X -DskipTests

SonarLint & SonarQube implementation in your Project

Image
SonarQube : SonarQube is very strong tool available for Code review. How to integrate the   plugin into your Development studio, ie. Eclipse or STS. Go to, Eclipse -> Help -> Install New Software-> And enter there  “http://downloads.sonarsource.com/eclipse/eclipse/” Checking the code ceoverage: Go to SonarQube view - > SonarLInt: http://eclipse.sonarlint.org/ Then Run the GREEN ALAYZE on SonarQube(that will be for SonarLint):-> Sometimes you might get SonarQube errors indicating you to change the code, which you might not want to do because of any reason. Then you can write //NOSONAR next to the line. This will discard the block  or the line where you write this comment.

RTC - Repository : How to Revert Back the Changes

Image
HOW TO REVERT BACK THE CHANGES WHICH HAVE COMMITED INTO RTC REPOSITORY: = IN ECLIPSE Right click on the owning component in the Pending Changes view and select Show->History. The change set will appear in the History view.   Right click on the change set and choose Discard... This will discard the change set from your workspace. So your workspace should now have all change from the stream *except* the one you want to remove. You can verify this by checking that your bad change set is the only thing you see Incoming.   Right click on the component and choose "Replace in [your stream name]..."  RTC (Jazz) : How to point your stream to different stream and take codes into your local: Example: you have local worskapce set up from dev stream, but now you have PATCH stream and want to take latest code. Go to ‘Pending Changes’ and select “Change Flow Target” to the required stream. How to remove namespace from xml file ? Step 1: ...
Image
Hibernate - How to implement a 'Composite Key' : Suppose we have a Table in database which has many coulumns, among which two columns are PRIMARY KEY : UNIQUE_ID, NOTIFICATION_CHANNEL. We will write a separate Class which will contain these two columsn which are a part of COMPOSIT PRIMARY KEY. We will write a separate class for rest of the fields in that Table; and this class will also hold the reference of COMPOSIT PRIMARY KEY classs :->

Writing Test Cases

Image
1. Writing Test Cases for POJO classes Most of the time we need to write test cases for POJO classes. So that Test case Coverage can shoot up. We need to identify the package where we have pojo classes and count the number of POJO classes present on that package. Add 1 into the total count which will include the JUnit test class for  itself. For example if there are 4 POJO classes for which you wish to write test cases, write the "EXPECTED_CLASS_COUNT = 5;" into your test case. Here is the example:-- Add dependency in POM.XML:-               < dependency >                      < groupId > com.openpojo </ groupId >                      < artifactId > openpojo </ artifactId > ...