Setting up Eclipse

April 27th, 2010 -- No Comments

I wanted to talk about how to setup your Eclipse IDE to work with Selenium, Maven, and TestNG. For those who do not know what those are you can click on the link to learn more. I will be making some more posts/tutorials on how to use these items. Eclipse can run on Mac, Linux, and or Windows. You need to have Java installed and if you want to work with SVN then you need the command line SVN client.

From the video below here is the list of the sites that you will need to add to Eclipse:

  • Maven = http://m2eclipse.sonatype.org/sites/m2e
  • TestNG = http://beust.com/eclipse
  • Subclipse = http://subclipse.tigris.org/update_1.6.x

Here is the video. Below video I will paste the code that you want to add to the pom.xml

Here is the code that is remaining

<build>
  		<testResources>
  		</testResources>
  		<plugins>
			<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.4.3</version>
                <configuration>
                    <systemProperties>
                        <property>
                            <name>app.env</name>
                            <value>${app.env}</value>
                        </property>
                    </systemProperties>
					<excludes>
						<exclude>**/TestUtilities.java</exclude>
					</excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                    <skip>true</skip>
                    <failsOnError>true</failsOnError>
                    <consoleOutput>true</consoleOutput>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
  	</build>
  	<dependencies>
        <dependency>
			<groupId>net.sf.jacob-project</groupId>
			<artifactId>jacob</artifactId>
			<version>1.14.3</version>
		</dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring</artifactId>
            <version>2.5.5</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>2.5.5</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>2.5.3</version>
        </dependency> 
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.14</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>oracle</groupId>
            <artifactId>oracle</artifactId>
            <version>14</version>
            <scope>test</scope>
        </dependency>
        <dependency>
        	<groupId>org.testng</groupId>
        	<artifactId>testng</artifactId>
        	<version>5.11</version>
        	<classifier>jdk15</classifier>
        	<scope>test</scope>
        </dependency>
        <dependency>
        	<groupId>org.seleniumhq.selenium</groupId>
        	<artifactId>selenium</artifactId>
        	<version>2.0a2</version>
        </dependency>
        <dependency>
        	<groupId>org.seleniumhq.selenium</groupId>
        	<artifactId>selenium-server</artifactId>
        	<version>2.0a2</version>
        </dependency>
    </dependencies>

Java Hello World

April 1st, 2010 -- No Comments

Well I have decided to jump back into Java programming due to some recent events. I went out and bought Sams Teach Yourself Java in 24 Hours to help me in this journey. So to help me grasp the material I wanted to create blog posts/tutorials to help me and to help others who might be on this same goal.

….

Oh and the two things that you will not see the void main for is applets and servlets. Here is the source code of the file I created

class HelloWorld
{
	public static void main(String[] args)
	{
		String sayHello = "Hello, World!";
		String myName = "John Costanzo";
		int myAge = 28;
		boolean theTruth = false;
 
		System.out.println(sayHello + " My name is " + myName);
		System.out.println("Is my age " + myAge + "?\nThe answer is " + theTruth);
	}
}
Categories: Java, Tutorials