Powered By Blogger

Wednesday, 8 October 2008

How to Automate BVTs in TFS

Following Post gives you an idea about configuring BVTs in TFS. Please follow the steps below.

A build verification test (BVT) typically consists of a broad suite of tests that are used to verify the overall quality of a particular build. BVTs are usually automated and run on a set schedule, frequently at night. They can also be run manually, such as after an automated run has failed. A build is considered a success if all the tests in the BVT have passed.
BVTs use different areas of Visual Studio Team System: Visual Studio Team System Test Edition, Team Foundation version control, and Team Foundation Build. First you use Test Edition to create a test list that contains the tests you want included in your BVT. Then you check in that test list to source control, using Team Foundation version control. Finally you use Team Foundation Build to run the BVT, or to schedule regular runs of the BVT.

This topic describes all the procedures that are required to create, store, and run build verification tests:

1.         Create a BVT Test List.

To create a BVT test list in the Test List Editor do the following.

1. In the Test List Editor, click By Test List to display the test list pane.

2. Right-click Lists of Tests and then click New Test List.

              This displays the Create New Test List dialog box.

3. Type the name of the test list that will contain your build verification tests; for example, type BVTs.

4. (Optional) Type a description of your BVT test list, and select a location in the test list hierarchy to put the new test list.

5. Click OK.

              Your new BVTs test list is created and appears in the test list hierarchy pane.

6. Click All Loaded Tests to display all the tests in your solution.

7. Select the tests that you want to run as your build verification tests and drag them into the new BVTs test list.

8. (Optional) To verify the contents of the test list, click it in the test list hierarchy pane.

                       This BVTs test list, together with all the test lists in your solution, resides in your solution's test metadata file. Test metadata files have the extension .vsmdi.

 

2.         Check in the BVT

In this procedure, you check in all the files of your solution. This includes the test metadata file of your solution, which contains your test lists and tests. Whenever you add, delete, or reorganize test lists, or change the contents of test lists, your test metadata file is automatically updated to reflect those changes.

To check in the BVT to source control

1. Connect to a Team Foundation Server computer.

2. If your solution is not already in source control, add it to source control.

3. Click View and then click Pending Checkins to display the Pending Checkin window.

4. After the check-in operation is finished, a padlock icon is displayed next to each file in Solution Explorer to indicate its Checked In status.

5. Your checked-in tests are available to the Team Foundation Build feature of Team System. You can now create a build type that contains the tests you want to run in your BVT.

 

3.         Create a Build Type

To create the BVT build type

1. In the Team Explorer window, click your team project.

2. Right-click Team Builds and then click New Team Build Type.

              The New Team Build Type Creation Wizard appears.

3. Follow the steps in the New Team Build Type Creation Wizard.

4. When you have finished entering information in the wizard, click Finish.

              Your new build type appears in the Team Explorer window under the Team Builds folder.

 

4.         Run the BVT Build Type

To run the BVT using Team Build

1. On the Build menu, click Build {Team Project Name}.

2. The Build {Team Project Name} dialog box is displayed with a list of all existing build types. Make sure your build type is selected.

3. (Optional) Change the build location and directory.

4. Click Build.

Wednesday, 16 July 2008

VBScript to compare local administrators in the sytem with the list provided and logging event accordingly

''******************************************************************************''
''*** File Name: LocalAdminsCompare.vbs ***''
''*** Description: ***''
''*** - Compare local Adiminstrators against the source File ***''
''*** Requirements: ***''
''*** Parameters: ***''
''*** ServerName - Name of the Server ***''
''*** DomainName - Name of the Domain ***''
''*** SourceFile - WINS_localadmins.txt ***''
''*** Last Updated: 05/27/2008 ***''
''*********************************************************************************''
on error resume next
''*** event constants ***''
Const ForReading = 1, ForWriting = 2
Dim strComputer, strEntry1a, strEntry1b, strEntry2, strKey, strValue1, strValue2, strSubkey, ServerName, DomainName, DataCenter
Dim fso, f, f1, strM, Val, Val1, Val2, Val3, Val4, objReg, arrSubkeys, intRet1, strMsg, SourceFile, objGroup
Dim fso1, txtSourceFile, txtCompFile, strLine1, strLine2, strLine3, strLine4, strMatch, strMatch1
Set oAPI = CreateObject("MOM.ScriptAPI")

Set fso = CreateObject("Scripting.FileSystemObject")
strComputer = "."

call Begin()

function Begin()
''****************************************************************************''
''*** Check if the Parrameters are present ***''
''****************************************************************************''
strProc = "(Begin)"
call Main()
end function

function Main()
On Error Resume Next
strProc = "(Main)"

ServerName = "01hw000000"
DomainName = "DomainName"
SourceFile = "C:\Temp\AppTest.txt"
DataCenter = WScript.Arguments(3)

Set f = fso.OpenTextFile("C:\Local_Admin_details.txt", ForWriting, True)
call LocalAdminMembers()
Call AdminCompare()
f.close
fso.DeleteFile("C:\Local_Admin_details.txt")
end function


''****************************************************************************''
''*** Function creates a temp file to write Admini Group Members ***''
''****************************************************************************''
function LocalAdminMembers()

strProc = "(LocalAdminMembers)"

Dim objComp, strM
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
For Each mem In objGroup.Members
strM = replace(Right(mem.adsPath,Len(mem.adsPath) - 8),"/","\")
f.writeline strM
Next

if err.number<>0 then Call oAPI.LogScriptEvent("Local Administrator Compare", 400, 1, strProc & err.description)
end function


''****************************************************************************''
''*** Function To compare Admin group members ***''
''****************************************************************************''
function AdminCompare()
on error resume next

strProc = "(AdminCompare)"

Dim compName, retVal

retVal = InStr(ServerName,".")
if (retVal > 0) then
compName = Left(ServerName, retVal-1)
end if

Set fso1 = CreateObject("Scripting.FileSystemObject")
if fso1.fileexists(SourceFile) then
Set txtSourceFile = fso1.OpenTextFile(SourceFile, ForReading)
Do Until txtSourceFile.AtEndOfStream
strMatch1 = False
strLine3 = txtSourceFile.Readline
strLine3 = Replace(strLine3,"",compName)
strLine3 = Replace(strLine3,"",DataCenter)
Set txtCompFile = fso1.OpenTextFile("C:\Local_Admin_details.txt", ForReading)
Do Until txtCompFile.AtEndOfStream
strLine4 = txtCompFile.Readline
If Trim(UCase(strLine4)) = Trim(UCase(strLine3)) Then
strMatch1 = True
Exit Do
End If
Loop
txtCompFile.Close
If strMatch1 <> True then
strMsg = strMsg & "::" & strLine3
End If
Loop
If strMsg <> vbempty Then
Call oAPI.LogScriptEvent("Local Administrator Compare", 403, 1, "" & vbcrlf & strProc & " " & strMsg & " accounts are present in source file " & SourceFile & " and are not present in " & ServerName & " System Administrator Group")
End IF
else
Call oAPI.LogScriptEvent("Local Administrator Compare", 404, 1, "" & vbcrlf & strProc & " Source File at the following location " & SourceFile & " Not Found")
end if
end function

Three Mistakes MBA Aspirants Make In The Personal Interview

Following are the three mistakes MBA aspirants make in the personal interview

1. Blaming your College/School Professor for low scores: You are always 100% responsible for your grades. If you have low scores then don’t ever state that your teacher did not clarify the subject or rushed the topic. Do you think studies at IIM’s or any MBA institutes are designed to be studied in an easy relaxed spoon fed manner? Wrong the MBA curriculum is a real test of your abilities to stay awake and perform at your best. If you blame your teachers – you are out.

2. Blaming ill health: What are you LOSER NO 1? If exam days give you bad health, how will you be able to achieve corporate profit targets? Unless you are actually physically handicapped you cannot be expected to fall ill under mysterious circumstances whenever pressure builds around you. Even if you were truly sick - try to come out with some other reason for your lack of extra curricular activities or low scores.

3. State hobbies just for the heck of it: OK so you enjoy cricket. Do you know the technical details of the game? How many members are there in the BCCI governing council? The IIM professors do not appreciate mere couch potatoes. Hobbies are not merely for adding spice to your CV. State only 2 hobbies and try to learn everything there is to that hobby.

The MBA Personal Interview is actually tougher than job interviews. In job interviews they actually need manpower so they don’t ask tough questions. Here you are being SHORTLISTED against equally capable competitors so they are trying to find means to NOT SELECT you. So be careful with your replies.

Why Should You Study Abroad?

Nowadays it seems like all Indian students want to go abroad for their studies. What do they get out of an opportunity like this? Well there are, actually, many advantages that the Indian youth perceive in a foreign school experience. Are you contemplating going abroad? Below are some important points that you should note if you are trying to make this decision.


Academically Speaking

Students are attracted to technological nations such as Canada, Australia, the USA, and the UK where they look forward to a different experience as well as better job prospects. The academic programs that these nations offer are excellent and you will benefit from any one of them immensely. Here are some attractive qualities of these academic programs that you should take into consideration.


• Some programs give you the opportunity to interact directly with some of the finest minds in their chosen traditional/professional disciplines.

• Others may give you a chance to gain work experience thereby improving your job prospects.
• Different universities will have different teaching styles. While some focus more on exams, others may consist of lots of group work and module assignments. You can choose the university that best suits your learning style.
• There are universities that are flexible in their courses and in their modules. If you are one of those people who is not sure this would be a great option for you, the university will allow you to change in the first month.
• You will have the opportunity to develop strong relationships with your faculty and fellow students as you work with and learn from both.
• There is an emphasis on imparting practice-oriented education. This generates valuable employment-related skills in you as a student.
• The avenues for interdisciplinary research and training are better explored in the west than in India.


The predominant principles and practices of the system for higher education abroad have something for everyone from even the most diverse walks of life. The points mentioned above are just some benefits of the academic opportunities abroad. There are, in fact, many more.


Our Technological World

We are living in a world where information is accessed and shared in nanoseconds. The better connectivity translates directly into a competitive edge. Whatever your field of study, most universities abroad equip you with the latest technology. You will use their technology to obtain and process both subject-specific and general information. On these lines, many universities abroad remain unmatched. The technological skills that you obtain will open doors for you in the job market.


Your Social Life

Most universities abroad provide you with a whole list of extra curricular activities that you can choose to do. If you are a person who is very interested in sports, for example, you will find that some universities have excellent sport facilities that you can benefit from, other people may be attracted to theatre, or music facilities. Some of you may want to join a university in an urban area which will provide you with eating, entertainment, shopping and cultural facilities whereas others may be attracted to a rural area university. All in all universities abroad provide a rich variety of activities as part of their campus life. These factors add a unique dimension to your educational and cross-cultural experience.

The Value of Adapting

As a foreigner in a different nation you will learn to adapt to a culture that is completely different from yours. As globalization is on the rise companies are looking to be established internationally. They will value the skills that you gain from having to adapt to a different culture.


Choosing Your University

Here are some factors that will affect your choice in universities:

• Academic experience
• Tuition expenditure
• Cost of living
• Cultural encounters
• Internship opportunities
• Work Permit access
• Career aspirations
• Available options for study



When choosing the destination of your university it is easier when the destinations are classified into regions. Destinations within a certain region will have a lot in common. From a broad yet relevant perspective the options for your destinations are:

• United States and Canada
• Europe
• Australia
• Asia-Pacific

Saturday, 28 June 2008

VBScript to reads number of lines in a text file

'********************************************************************
' VBScript that reads number of lines in a text file
'
'********************************************************************
' Program by:
' Created:
' Updated: N/A
'********************************************************************

' Variable declaration
'
Option explicit
Const cRead=1, cWrite=2, cAppend=8
Dim FSO, Source
set FSO=CreateObject("Scripting.FileSystemObject")
Dim fileInput, fileOutput
Dim sTempPath, sTempName
Dim sLine, i
Source = “C:\Deepak.txt”

'********************************************************************
' Main
'********************************************************************
Set fileInput=FSO.OpenTextFile(Source, cRead)
sTempPath=FSO.GetFile(Source).ParentFolder.Path
sTempName=FSO.GetTempName
Set fileOutput=FSO.GetFolder(sTempPath).CreateTextFile(sTempName)

i=0
Do While not(fileInput.AtEndOfStream)
i=i+1
sLine=fileInput.ReadLine
' Process the read line here...
fileOutput.WriteLine(sLine)
Loop
MsgBox "" &sLine
fileInput.Close
fileOutput.Close

Friday, 25 April 2008

WIX 3.0 Code to Create MSI, which deploys WEBSITE / WEBSERVICE / Runs a BATCH FILE internally / Creates APP POOL


<?xml version="1.0" encoding="UTF-8"?>
<?define INSTALLABLES="PATH_TO_BINARIES"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="26062F4C-B48D-4e2e-ACE1-B58F53BC60AE" Name="WebSiteName" Language="1033" Version="1.0.0" Manufacturer="WebSiteName" UpgradeCode="2343F03B-5410-4039-8EC9-6B08DA693C13">
<Package Id="*" Description="WebSiteName Deployment" Comments="This program is used to deploy WebSiteName" InstallerVersion="200" Compressed="yes" />
<Upgrade Id='2343F03B-5410-4039-8EC9-6B08DA693C13'>
<UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND' Minimum='1.0.0.0' IncludeMinimum='no' />
</Upgrade>
<CustomAction Id='NoDowngrade' Error='A later version of [ProductName] is already installed.' />
<Media Id="1" Cabinet="WebSiteName.cab" EmbedCab="yes" />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id="IISMain" Name="Inetpub">
<Directory Id="WWWMain" Name="wwwroot">
<Directory Id='INSTALLDIR' Name='WebSiteName'>
<Directory Id='temp' Name='Temp'>
<Component Id='temp' Guid='C1776274-E3EF-4df6-8686-426DE709865F'>
<File Id="Web1.Config" Name="Web1.config" Source="$(var.INSTALLABLES)\Web1.config" DiskId="1" />
</Component>
</Directory>
<Component Id='C_Default' Guid='A3E880D7-5B06-402d-8AAD-4B9BBBA1AF22' DiskId='1'>
<File Id='Default.aspx' Name='Default.aspx' Source='$(var.INSTALLABLES)\Default.aspx' />
<File Id='Web.config' Name='Web.config' Source='$(var.INSTALLABLES)\Web.config' />
<!-- Editing XML File-->
<util:XmlFile Id="XML" Action="setValue" File="[INSTALLDIR]Web.config" Name="connectionString" ElementPath="//configuration/connectionStrings/add" Value=" " />
<File Id='WebService.asmx' Name='WebService.asmx' Source='$(var.INSTALLABLES)\WebService.asmx' />
<File Id='WebSiteName.bat' Name='WebSiteName.bat' Source='Binary\WebSiteName.bat' />
</Component>
<Directory Id='bin' Name='bin'>
<Component Id='C_Bin' Guid='105A7186-7290-47f5-85D7-D5C13B988CAB' DiskId='1'>
<File Id='Common.dll' Name='Common.dll' Source='$(var.INSTALLABLES)\bin\Common.dll' />
<File Id='WebSiteName.dll' Name='WebSiteName.dll' Source='$(var.INSTALLABLES)\bin\WebSiteName.dll' />
<File Id='Web.Business.dll' Name='Web.Business.dll' Source='$(var.INSTALLABLES)\bin\Web.Business.dll' />
<File Id='Web.Business.Interface.dll' Name='Web.Business.Interface.dll' Source='$(var.INSTALLABLES)\bin\Web.Business.Interface.dll' />
</Component>
</Directory>
<Directory Id='images' Name='images'>
<Component Id='C_Images' Guid='4C47FF1A-746C-4852-990C-5F34905798F8' DiskId='1'>
<File Id='GenericBanner' Name='GenericBanner.gif' Source='$(var.INSTALLABLES)\images\GenericBanner.gif ' />
<File Id='HelpAndSupport' Name='HelpAndSupport.jpg' Source='$(var.INSTALLABLES)\images\HelpAndSupport.jpg ' />
</Component>
</Directory>
<Directory Id='Include' Name='Include'>
<Directory Id='styles' Name='styles'>
<Component Id='C_Styles' Guid='2EC61DC6-96B5-4ff9-BD80-47986F4273BE' DiskId='1'>
<File Id='stylesheet' Name='stylesheet.css' Source='$(var.INSTALLABLES)\Include\styles\stylesheet.css ' />
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
<Component Id='C_WebVirDir' Guid='3C19F08D-2D9F-4950-B35B-7FA12B8DD1B8' DiskId='1'>
<iis:WebAppPool Id="WebSiteNameAppPool" Name="WebSiteNameAppPool" Identity="networkService"/>
<iis:WebVirtualDir Id="WebSiteName" Alias="WebSiteName" Directory="INSTALLDIR" WebSite="DefaultWebSite" DirProperties="WebSiteNameProp">
<iis:WebApplication Id="WebSiteName" Name="WebSiteName" WebAppPool="WebSiteNameAppPool"/>
</iis:WebVirtualDir>
</Component>
</Directory>
<CustomAction Id="CA1" Directory="INSTALLDIR" ExeCommand='"[INSTALLDIR]WebSiteName.bat" "[INSTALLDIR]" "[OPTIONS]"' Return='check' Execute='immediate'/>
<CustomAction Id="CA2" Directory="INSTALLDIR" ExeCommand='"[SystemFolder]cmd.exe" /c del /q "[INSTALLDIR]WebSiteName.bat"'/>
<iis:WebSite Id='DefaultWebSite' Description='Default Web Site' Directory='INSTALLDIR' >
<iis:WebAddress Id="AllUnassigned" Port="80"/>
</iis:WebSite>
<Feature Id="WebSiteNameFeature" Title="WebSiteName" Level="1">
<ComponentRef Id='C_Default' />
<ComponentRef Id='C_Bin' />
<ComponentRef Id='C_Images' />
<ComponentRef Id='C_Styles' />
<ComponentRef Id='C_WebVirDir' />
<ComponentRef Id='temp' />
</Feature>
<iis:WebDirProperties Id='WebSiteNameProp' WindowsAuthentication='yes' LogVisits='yes' Execute='yes' Read='yes'/>
</Product>
</Wix>