Archive Page 2

Installing Subversion? Just follow this 7 Steps

During  this week I had installed and configured Subversion and Cruise Control in my office. We all know its relatively simple to configure these but then also here in this post I am just writing the installation and configuration of Subversion into some simple steps. Hope it will be helpful to any of you in future [ Surely. for me too ;) ].

Versions used here are:

Apache HTTP Server 2.2 [ Download] and Subversion 1.4.6 [Download]

1. Installing Apache HTTP server.

Download the Apache HTTP Server from Here. You can download the binary version or the Windows installer from the site. Specify a location to install, for example here Im using D:\Subversion\Apache\Server.

2. Installing Subversion.

Download the Subversion installer from Here. Just follow the steps in the instalation wizard to install the subversion. Here I am installing subversion into the root folder with a different child direcotry. D:\Subversion\Subversion

3. Configuring the Apache Server.

Okey.. So u completed two “Complex” :) steps now. But the third one is  very simple. It contains two steps

    1. Copy the files mod_authz_svn.so and mod_dav_svn.so from the [Installation path]\Subversion\bin folder to the [Installation path]\modules folder. Actually we are adding two module files into the Apache server.
    2. Go to the conf directory of Apache server [Installation path]\conf and edit the httpd.conf file. Add the following lines into the modules including part

LoadModule  dav_module             modules/mod_dav.so
LoadModule  dav_svn_module         modules/mod_dav_svn.so
LoadModule  authz_svn_module       modules/mod_authz_svn.so

3. Creating the Project repository locations.
Create a Repository Folder where you want to store all the projects. For example I am creating folders called DFRepository and SFRepository in my E drive.

E:\Repositories\DFRepository
E:\Repositories\SFRepository

These are just directories to hold our repositories, now we must create the repositories themselves, using the svnadmin utility

svnadmin create E:\Repositories\DFRepository
svnadmin create C:\Repositories\SFRepository

Then Subversion will create a folder predifined structure inside this repository folder.

4. Creating the Users authentication file
               We can create a folder called etc in the root location where we had installed Subversion and Apache server. Open the command promt and just go to the bin directory of Apache Server and run the following commands.

htpasswd -cm D:\Subversion\svn-auth-file usernameOne
New password: *****
Re-type new password: *****
Adding password for user usernameOne

htpasswd -cm D:\Subversion\svn-auth-file usernameTwo
New password: *****
Re-type new password: *****
Adding password for user usernameTwo

When using the command for the first time, add the -c option. This creates the file named D:\Subversion\svn-auth-file . The -m option instructs the htpasswd utility to use MD5 algorithm to encrypt the passwords.

5. Creating the Access - rights file 
Create a file called svn-acl in the etc folder and add the following content into it. You can modify this content as per your need.

# specifinh groups here
[groups]
DFTeam = name1, name2

# DFTeam group has a read/write access to ‘DFRepository’ repository
# all subdirectories; all others have read access only
[DFRepository:/]
@DFTeam = rw
* = r

# ‘SFRepository’ repository, only harry and sally have read-write access.
[SFRepository:/]
harry = rw
sally = rw
* = r

# ross is helping with the time zone part of the project2
[SFRepository:/timezone]
harry = rw
sally = rw
ross = rw
* = r

6. Creating the SVN Location module

Create another file called Subversion.conf in the same etc folder which contains the following data.

<Location /DFRepos>
  DAV svn
  SVNPath E:\Repositories\DFRepository

  AuthType Basic
  AuthName “Subversion Project1 repository”
  AuthUserFile c:/etc/svn-auth-file

  Require valid-user
  AuthzSVNAccessFile c:/etc/svn-acl
</Location>

<Location /SFRepos>
  DAV svn
  SVNPath E:\Repositories\SFRepository
  AuthType Basic
  AuthName “Subversion Project2 repository”
  AuthUserFile c:/etc/svn-auth-file

  Require valid-user
  AuthzSVNAccessFile c:/etc/svn-acl
</Location>
 

If u dont want to include the access defenitions file and just want to check the user is valid or not the just change the Subversion.conf as follows.

<Location /SFRepos>
  DAV svn
  SVNPath E:\Repositories\SFRepository
  AuthType Basic
  AuthName “Subversion Project2 repository”
  AuthUserFile c:/etc/svn-auth-file

  <LimitExcept GET PROPFIND OPTIONS REPORT>  Require valid-user  </LimitExcept>
       </Location>

7. Configuring Location in httpd.conf file

This is very simple step. Just add this Subversion.conf file to the end of httpd.conf file as follows

Include D:\Subversion\etc\subversion.conf

Restart the Apache Server :). Finished…

Reference: This link helped me a lot to configure the repository

TestNG 5.6 and Junit 4.4 : which framework you will choose for unit testing?

As we all know JUnit is the most famous unit testing framework. Nobody needs any type of introduction for this small and easy framework. Most of the developers are using this as their unit testing framework in their day to day development life. And can I ask one question? Do you know TestNG? a unit testing framework which is named as ‘Next Generation test ing tool’. Here is a small comparison on these two unit testing frameworks.

  TestNG Version 5.6   JUnit  Version 4.4
1 Extensive annotation support 1 Supports Annotations but not that much rich as TestNG
2 Flexible test configuration in an external XML file. 2 Configuration is less and no XML file configuration at all.
3 External configuration gives more flexibility. 3 Less configuration makes it more easy and really fast to create :)
4 Support for data-driven testing (with @DataProvider). 4 We have to integrate with EasyMock for Mock object testing
5 Support for parameters using @Parameters 5 No such type of annotations
6 Allows distribution of tests on slave machines. 6 NA
7 Supported by a variety of tools and plug-ins (Eclipse, IDEA, Maven, etc…). 7 Cant defeat JUnit in this matter. It has a lot of supporting tools and plugins.
8 Embeds BeanShell (scripting)  for further flexibility. 8 JUnit dont have this feature at all.
9 Default JDK functions for runtime and logging (no dependencies). 9 I dont aware of logging support in JUnit.
10 Dependent methods for application server testing. 10 NA
11 Creates a small HTML report at eash time of testing. Which will display the passed/failed tests and errors. It gives the XML output for testing also. 11 JUnit also creates the test report in XML form. But it will not create an HTML form with passed/failed testnames at each test run. But we can create a very useful JavaDoc Style report for entire JUnit testing
12 We dont need a specific name for setup and tearDown. We can make any method/ any number of methods that works on start up 12 Same in Junit also.
13 Here we can create Groups, Suites, etc and it also gives more annotations like
@After/BeforeSuite.
@After/BeforeGroup.
@After/BeforeClass.
@After/BeforeMethod
etc
13 @After/Before works in methods and @After/BeforeClass will work with classes. But no groups or suites.
14 No annotation like @Ignore. But we can ignore through XML congiurations. 14 @Ignore annotation is there for ignoring a method.
15 Dependancy of previous methods can be managed easily 15 Methods dependancy handling between each test methods is not possible easily.
16 Option to run failed tests only/ last test only in the IDE 16 We have to select and run each methods which are failed
17 No AssertThat method support 17 It gives a method AssertThat that is very much flexible for giving a Business type result message for the tests.
18 Using ‘ExpectedExceptions in @Test Annotation’ we can expect some exceptions in the test methods and thus the method will be success. 18 We can use (expected = Exception.class) in the @Test annotation

Conclusion

If you are a very busy programmer and want very little time to spend on testing the code then go for JUnit. It is giving enough support for that. But you need a good testing and more configurable options for each test cases then choose TestNG. The depeneded methods are also can make work on TestNG very easily.

Sun Tech Days : In Hyderabad

std08_web_header.jpg

Yesterday I had attended Sun Developers Conference held here in Hitex Convensional center, Hyderabad, India. It was day ONE of three days conference.  The day ONE was really interesting and informative for me. Got an overview about the new Sun techs and got chance to interact with a lot of developers working in Java.

We reached there aroung 9.30 in the morning and done with our registration formalities. The first seesion as Sun keynote bye Rich Green, Executive Vice President, Software, Sun microsystems. After that there was a Demo showcase in which SIX SUN java professionals presented some software demos. Those were in jMaki, Sun SPOTS, J2ME, Swing, JavaFX etc. There are 30 sessions total in the First day and those are from 5 different categories. Five sessions are going on the same time and the whole day is divided in to Six layers. So a delegate can select a session as per his/her taste. If a person is attentding full sessions then they can attent maximum 6 sessions in a day.

The Sessions which I had attened are

1. JEE , Glassfish and their future

2. Testing with Junit and other Testing tools

3. Rapid development with Ruby, JRuby and rails

4. Java Persistence API : Further simplifying persistence.

5. Java troubleshooting tips.

6. JEE with Spring ad Seam.

You can check the other sessions here

The first day ended with a Welcome reception - delicious Dinner and a Music Mela. :) You can read more about each sessions in my next posts…

Scott Gavin’s Charlie goes mobile… Another Slide on Enterprise 2.0

I likes to visit Scott Gavin’s site now. Want to learn more about his views on Enterprise 2.0. I think its really interesting as well as useful in our future. Here is his another slide where he mentions Mobile apps usage in Enterprise world.

Please visit these two posts… here and here…. if you are interested in Enterprise 2.0 :)

Defining A Productive Worker…

This slide show is the follower of the excellent Meet Charlie :)

« Previous PageNext Page »


View Lijin Joseji's profile on LinkedIn

Disclaimer

The information on this site is for informational purposes only. The use of any Trademark or Copyrighted material is not intended to infringe Copyright. This blog is intended to be used under a policy of personal and non commercial use.

Adds

Add to Google

Blog Stats

  • 109,069 hits

Categories