Loading
BuildProcess Interview Questions

Java Quick Notes

Refresh Your Java

We are Agile, believe in less Documentation - Only Quick notes of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

"Click on other Tabs for more Questions"  

"BuildProcess "


This section focuces Build and deployment Process.

1 )   What is continuous Integration ?


Ans)

Continuous Integration is a software development practice where members of a team integrate
their work (Code) frequently, usually each person integrates at least daily - leading to multiple
integrations per day. By having scheduled automated builds we can determine if are there any
integration issues , also by running the Unit Testcases as part of these builds and verify
if is the existing functionality is broken. Automated tools such as CruiseControl, Jenkins,
Hudson, Bamboo, BuildMaster, AnthillPro or Teamcity offer this scheduling automatically.

Here are the principles of "Continuous Integration"

Maintain a code repository :
Code should be maintained in a Version Control such as CVS,SVN,VSS,ClearCase etc., which could allow
multiple developers to work collaboratively in parallel by Versioning the Files (code).

Automate the build :
Should Have scheduled automated builds by using the tools like "Hudson,TeamCity, CruiseControl" etc.,
which could automatically checkout(Get) the code from Code Repository and build.

Make the build self-testing :
During the build process, after compiling the code we can make the Code Self-Testing by
executing the Unit Test cases such as JUNIT or Cactus or EasyMock etc. and confirms that
nothings is broken.

Automate deployment :
Once build and self-testing process is done, we should have automated Deployments.

Tools such as  "Hudson,TeamCity, CruiseControl" do complete "Continuous Integation" for you,
but you have to have some build script such as ANT or MAVEN scripts to perform some of these Tasks.

Here is the sequence of tasks that could be done by above tools.
i) Having Scheduled Builds. (Daily or Hours)
i) Checkout the code.
ii) Compile the Code.
iii) Running Unit Test-Casess.
iv) FTP code to different hosts
v) Deploy the artifacts.



Back to top

2 )   What is Version Control ?


Ans)

A "Version control" system (also known as a Revision Control System) is a repository of files,
often the files for the source code of computer programs, with monitored access. Every change
made to the source is tracked, along with who made the change, why they made it, and references
to problems fixed, or enhancements introduced, by the change.

Version control systems are essential for any form of distributed, collaborative development,
as different teams want to design, develop and deploy software in parallel and merge them easily.

Key Terms :

Check in :
 Saving your charges into Version Control .

Check Out :
 Getting the latest version from Version Control.

Conflict :
In general the "Version Control" merges your changes with existing Code automatically, and
merges them automatically , but sometimes the "Versions Control" detect Conflicts, and
the "Version Control" would not be able resolve, it would require a  manual
intervention to resolve the Conflict. 

Merge :
Combining multiple changes made to different working copies of the same files in the
source repository. Merging is a strategy for managing conflicts by letting multiple developers
work at the same time (with no locks on files), and then incorporating their work into one
combined version.

Trunk:
"Trunk" refers to the unnamed branch (version) of a file tree under revision control. The
trunk is usually meant to be the base of a project on which development progresses.

Branching :
Branching, in revision control and software configuration management, is the duplication
of an object under revision control (such as a source code file, or a directory tree) so that
modifications can happen in parallel along both branches.



Back to top

3 )   SVN ?


Ans)


  • SVN ?
    Sample Img 3

As we discssed SVN is a Sourcecode Version Control, you could manage
the files and folders in SVN by using the Command Line commands as
shown below or You could also use the some SVN clients like SmartSVN
or Tortoisesvn

svn diff
Shows line-level details of a particular change

svn log
Shows you broad information: log messages with date and author information attached to
 revisions and which paths changed in each revision

svn cat
Retrieves a file as it existed in a particular revision number and displays it on your screen

svn list
Displays the files in a directory for any given revision

Please take a look at above Sceenshot for getting an idea on how SmartSVN looks like. 

 



Back to top

4 )   CVS VS SVN ?


Ans)

 

Feature CSV SVN
Revision Numbers In CVS, revision numbers are per file. This is because CVS stores its data in RCS files; each file has a corresponding RCS file in
the repository, and the repository is roughly laid out according to the structure of your project tree.
In Subversion, the repository looks like a single filesystem. Each commit results in an entirely new filesystem tree; in essence, the
repository is an array of trees. Each of these trees is labeled with a single revision number.
A tag or branch A tag or branch is an annotation on the file or on the version information for that individual file. In Subversion, a tag or branch is  a copy of an entire tree (by convention, into the /branches or /tags directories that appear at the toplevel of the repository, beside /trunk). In the repository as a whole, many versions of each file may be visible: the latest version  on each branch, every tagged version, and of course the latest version on the trunk itself.
Directory Versions   The Subversion tracks tree structures, not just file contents. It's one of the biggest reasons Subversion was written to replace CVS.
The svn add and svn delete commands work on directories now, just as they work on files.
Binary Files and Translation   Subversion handles binary files more gracefully than CVS does. Because CVS uses RCS, it can only  store successive full copies of a changing binary file. Subversion, however, expresses differences between files using a binary differencingalgorithm, regardless of whether they contain textual or binary data. That means all files are stored differentially
(compressed) in the repository.

 



Back to top

5 )   JIRA , DOORs ?


Ans)

JIRA :

JIRA is the project tracker for teams building great software.

JIRA sits at the center of your development team, connecting the people and the
work being done. Track bugs and tasks, link issues to related source code, plan
agile development, monitor activity, report on project status, and more.

DOORS:

DOORS, a leading solution for requirements management, provide capabilities including:
o A collaborative requirements management environment that allows all stakeholders to actively
     participate in the requirements process
o The ability to manage changing requirements
o Powerful life cycle traceability to help teams align their efforts with the business needs
    and measure the impact that changes will have on everything from business goals to development
o Support for requirements-driven testing with built-in test tracking tool and integrations with
     Rational Quality Manager and HP Quality Center
o Integrates with enterprise architecture, product portfolio management, model-driven development,
 quality management, and change and release management solutions from IBM and third party companies.



Back to top

6 )   What is Hudson ? How to use this ?


Ans)


  • Hudson ?
    Sample Img 6

Hudson is a continuous integration (CI) tool written in Java, which runs in a servlet
container, such as Apache Tomcat or the Weblogic application server. It supports SCM
tools including CVS, Subversion, Git, Perforce and Clearcase and can execute Apache Ant
and Apache Maven based projects, as well as arbitrary shell scripts and Windows batch commands.

Please take a look at above screenshot to get an undestanding how the Hudson looks like.

 



more info...       Back to top

7 )   Hudson Part2 Image


Ans)


  • Hudson Part2
    Sample Img 7

Please take a look at Hudson Part2



more info...       Back to top

8 )   How to Compile classes using ANT ?


Ans)

  <target name="compile-tests" depends="init">
    <!--touch>
  <fileset dir="${test.src.dir}"/>
    </touch-->
    <javac srcdir="${test.src.dir}" destdir="${test.build.dir}" verbose="false" debug="on">
      <classpath refid="classpath.test"/>
    </javac>

  </target>



Back to top

9 )   How to start Tomcat by using ANT ?


Ans)

 <target name="start-tomcat" if="start.tomcat.jdpa">
   <echo>Starting Tomcat with JDPA on port ${jpda.port}</echo>
    <java jar="${container.home}/bin/bootstrap.jar" fork="true">
        <jvmarg value="-Xms512m"/>
        <jvmarg value="-Xmx1280m"/>
        <jvmarg value="-Dcatalina.home=${container.home}"/>
        <jvmarg value="-Dcatalina.base=${container.home}"/>
        <jvmarg value="-Djava.endorsed.dirs=${container.home}\common\endorsed"/>
        <jvmarg value="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"/>
     <jvmarg value="-Xdebug"/>
     <jvmarg value="-Xrunjdwp:transport=dt_socket,address=5454,server=y,suspend=n"/>
    </java>
  </target>



Back to top

10 )    How to stop the Tomcat using ANT Target ?


Ans)

  <target name="stop-tomcat">
    <java jar="${container.home}/bin/bootstrap.jar" fork="true">
        <jvmarg value="-Dcatalina.home=${container.home}"/>
        <arg line="stop"/>

    </java>
  </target>



Back to top

11 )   How to run JUNIT and generate a Report by using ANT ?


Ans)

 <target name="test-Junit" depends="init">
      <junit fork="no" haltonfailure="no" failureproperty="tests.failed">
        <classpath refid="classpath.clientside" />
        <formatter type="xml" />
        <test name="test.TestSuite" haltonfailure="no" todir="${reports.junit.dir}" />
      </junit>

    </target>



Back to top

12 )   How to run more than one Task in Parell by using ANT


Ans)

<target name="run-tests"
        description="Runs alltests in-container.">
        <parallel>
            <antcall target="start-tomcat" />
            <sequential>
                 <antcall target="test-Junit" />
                  <parallel>
                    <antcall target="stop-tomcat" />
                  <sequential>
                     ----- Some Other Ant Taget
      </sequential>

              </parallel>
            </sequential>
        </parallel>
    </target>



Back to top

13 )   How to do GWTC with ANT ?


Ans)

 

<target name="gwtc" depends="compile,server-jar" description="GWT compile to JavaScript">
  <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
   <classpath>
    <pathelement location="../gwt/src/main/java"/>
    <pathelement path="src/main/java" />
    <path refid="project.class.path" />
   </classpath>
   <jvmarg value="-Xmx256M" />
   <arg value="com.test.gwt" />
  </java>
  <copy todir="../../../web/gwt/">
   <fileset dir="war/"/>
  </copy>
  <zip destfile="../../../web/WEB-INF/lib/gwt.jar">
   <fileset dir="war/WEB-INF/classes"  includes="**/*.class,**/*.xml" />
  </zip>
 </target>



Back to top

14 )   What is Team City ?


15 )   How to pre-compile the JSPs ?


Ans)

<taskdef classname="org.apache.jasper.JspC" name="jasper" >
     <classpath>
         <pathelement location="${java.home}/../lib/tools.jar"/>
         <fileset dir="${ENV.CATALINA_HOME}/lib">
             <include name="*.jar"/>
         </fileset>
         <path refid="myjars"/>
      </classpath>
 </taskdef>

 <jasper verbose="0"
          package="my.package"
          uriroot="${webapps.dir}/${webapp.name}"
          webXmlFragment="${build.dir}/generated_web.xml"
          outputDir="${webapp.dir}/${webapp.name}/WEB-INF/src/my/package" />



Back to top

Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

This Portal is intended to put all Java/J2ee related topics at one single place for quick referance, not only Technical , but also the Project Management Related thing such as Development Process methodoogies build process, unit testing etc.,

This Portal has More than 500 Java Interview Questions (also could be Considered as Quick Notes) very neatly separated topic by topic with simple diagrams which makes you easily understandable. Importantly these are from our Realtime expericance.




Face Book

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free

Go To Site Map