continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbac...@apache.org
Subject svn commit: r917845 - /continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java
Date Tue, 02 Mar 2010 02:49:38 GMT
Author: mbaclay
Date: Tue Mar  2 02:49:38 2010
New Revision: 917845

URL: http://svn.apache.org/viewvc?rev=917845&view=rev
Log:
[CONTINUUM-2474] Fix selenium failing test in windows
- added a check on OS being used (failing test that appears in InstallationTest in windows)


Modified:
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java?rev=917845&r1=917844&r2=917845&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java
Tue Mar  2 02:49:38 2010
@@ -33,18 +33,37 @@
     public void testAddJdkToolWithoutBuildEnvirotment()
     {
         String INSTALL_TOOL_JDK_NAME = getProperty( "INSTALL_TOOL_JDK_NAME" );
-        String INSTALL_TOOL_JDK_PATH = getEscapeProperty( "INSTALL_TOOL_JDK_PATH" );
-        goToAddInstallationTool();
-        addInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, false, true,
true );
+		if(isWindows())
+		{
+			String INSTALL_TOOL_JDK_PATH = getProperty( "INSTALL_TOOL_JDK_PATH" );
+			goToAddInstallationTool();
+			addInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, false, true, true
);
+		} 
+		else if(isMac() || isUnix())
+		{
+			String INSTALL_TOOL_JDK_PATH = getEscapeProperty( "INSTALL_TOOL_JDK_PATH" );
+			goToAddInstallationTool();
+			addInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, false, true, true
);
+		}
     }
 
     public void testAddMavenToolWithBuildEnvirotment()
     {
         String INSTALL_TOOL_MAVEN_NAME = getProperty( "INSTALL_TOOL_MAVEN_NAME" );
-        String INSTALL_TOOL_MAVEN_PATH = getEscapeProperty( "INSTALL_TOOL_MAVEN_PATH" );
-        goToAddInstallationTool();
-        addInstallation( INSTALL_TOOL_MAVEN_NAME, "Maven 2", INSTALL_TOOL_MAVEN_PATH, true,
true, true );
-        // TODO: Validate build envirotment
+        if(isWindows())
+		{
+			String INSTALL_TOOL_MAVEN_PATH = getProperty( "INSTALL_TOOL_MAVEN_PATH" );
+			goToAddInstallationTool();
+			addInstallation( INSTALL_TOOL_MAVEN_NAME, "Maven 2", INSTALL_TOOL_MAVEN_PATH, true, true,
true );
+			// TODO: Validate build envirotment
+		}
+		else if(isMac() || isUnix())
+		{
+			String INSTALL_TOOL_MAVEN_PATH = getEscapeProperty( "INSTALL_TOOL_MAVEN_PATH" );
+			goToAddInstallationTool();
+			addInstallation( INSTALL_TOOL_MAVEN_NAME, "Maven 2", INSTALL_TOOL_MAVEN_PATH, true, true,
true );
+			// TODO: Validate build envirotment
+		}
     }
 
     public void testAddInstallationVariableWithBuildEnvirotment()
@@ -100,10 +119,20 @@
     public void testAddDuplicatedInstallationTool()
     {
         String INSTALL_TOOL_JDK_NAME = getProperty( "INSTALL_TOOL_JDK_NAME" );
-        String INSTALL_TOOL_JDK_PATH = getEscapeProperty( "INSTALL_TOOL_JDK_PATH" );
-        goToAddInstallationTool();
-        addInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, false, true,
false );
-        assertTextPresent( "Installation name already exists" );
+		if(isWindows())
+		{
+			String INSTALL_TOOL_JDK_PATH = getProperty( "INSTALL_TOOL_JDK_PATH" );
+			goToAddInstallationTool();
+			addInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, false, true, false
);
+			assertTextPresent( "Installation name already exists" );
+		}
+		else if(isMac() || isUnix())
+		{
+			String INSTALL_TOOL_JDK_PATH = getEscapeProperty( "INSTALL_TOOL_JDK_PATH" );
+			goToAddInstallationTool();
+			addInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, false, true, false
);
+			assertTextPresent( "Installation name already exists" );
+		}
     }
 
     @Test( dependsOnMethods = { "testAddInstallationVariableWithBuildEnvirotment" } )
@@ -121,12 +150,24 @@
     public void testEditInstallationTool()
     {
         String INSTALL_TOOL_JDK_NAME = getProperty( "INSTALL_TOOL_JDK_NAME" );
-        String INSTALL_TOOL_JDK_PATH = getEscapeProperty( "INSTALL_TOOL_JDK_PATH" );
-        String newName = "new_name";
-        goToEditInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, true );
-        editInstallation( newName, "JDK", INSTALL_TOOL_JDK_PATH, true, true );
-        goToEditInstallation( newName, "JDK", INSTALL_TOOL_JDK_PATH, true );
-        editInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, true, true
);
+		if(isWindows())
+		{
+			String INSTALL_TOOL_JDK_PATH = getProperty( "INSTALL_TOOL_JDK_PATH" );
+			String newName = "new_name";
+			goToEditInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, true );
+			editInstallation( newName, "JDK", INSTALL_TOOL_JDK_PATH, true, true );
+			goToEditInstallation( newName, "JDK", INSTALL_TOOL_JDK_PATH, true );
+			editInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, true, true );
+		}
+		else if(isMac() || isUnix())
+		{
+			String INSTALL_TOOL_JDK_PATH = getEscapeProperty( "INSTALL_TOOL_JDK_PATH" );
+			String newName = "new_name";
+			goToEditInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, true );
+			editInstallation( newName, "JDK", INSTALL_TOOL_JDK_PATH, true, true );
+			goToEditInstallation( newName, "JDK", INSTALL_TOOL_JDK_PATH, true );
+			editInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, true, true );
+		}
     }
 
     @Test( dependsOnMethods = { "testAddInstallationVariableWithBuildEnvirotment" } )
@@ -157,4 +198,22 @@
         String INSTALL_VAR_NAME = getProperty( "INSTALL_VAR_NAME" );
         removeInstallation( INSTALL_VAR_NAME );
     }
+	
+	public static boolean isWindows()
+	{
+		String os = System.getProperty("os.name").toLowerCase();
+		return (os.indexOf( "win" ) >= 0); 
+	}
+ 
+	public static boolean isMac()
+	{
+		String os = System.getProperty("os.name").toLowerCase();
+		return (os.indexOf( "mac" ) >= 0); 
+	}
+ 
+	public static boolean isUnix()
+	{
+		String os = System.getProperty("os.name").toLowerCase();
+		return (os.indexOf( "nix") >=0 || os.indexOf( "nux") >=0);
+	}
 }



Mime
View raw message