From 6566bcaa5e8fe918d3e0803b02b6085ad428f9a2 Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Wed, 13 Apr 2011 03:28:45 +0000 Subject: [PATCH] [MRM-1111] fix xpath after reverting to default freemarker templates git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1091636 13f79535-47bb-0310-9956-ffa450edef68 --- .../web/test/RepositoryScanningTest.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/RepositoryScanningTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/RepositoryScanningTest.java index 5dcabd470..860382d0d 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/RepositoryScanningTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/RepositoryScanningTest.java @@ -47,10 +47,15 @@ public class RepositoryScanningTest { setFieldValue( "newpattern_0", "**/*.zip" ); clickAddIcon( "newpattern_0" ); - Assert.assertEquals( getSelenium().getText( "//ul[@class='errorMessage']/li/span" ), + Assert.assertEquals( getErrorMessageText(), "Not adding pattern \"**/*.zip\" to filetype artifacts as it already exists." ); } + private static String getErrorMessageText() + { + return getSelenium().getText( "//ul[@class='errorMessage']/li/span" ); + } + @Test( dependsOnMethods = { "testAddArtifactFileType_ExistingValue" } ) public void testDeleteArtifactFileType() { @@ -72,7 +77,7 @@ public class RepositoryScanningTest { setFieldValue( "newpattern_1", "**/*-" ); clickAddIcon( "newpattern_1" ); - Assert.assertEquals( getSelenium().getText( "//span[@class='errorMessage']" ), + Assert.assertEquals( getErrorMessageText(), "Not adding pattern \"**/*-\" to filetype auto-remove as it already exists." ); } @@ -97,7 +102,7 @@ public class RepositoryScanningTest { setFieldValue( "newpattern_2", "" ); clickAddIcon( "newpattern_2" ); - Assert.assertEquals( getSelenium().getText( "//span[@class='errorMessage']" ), + Assert.assertEquals( getErrorMessageText(), "Unable to process blank pattern." ); } @@ -106,7 +111,7 @@ public class RepositoryScanningTest { setFieldValue( "newpattern_2", "**/*.sh" ); clickAddIcon( "newpattern_2" ); - Assert.assertEquals( getSelenium().getText( "//span[@class='errorMessage']" ), + Assert.assertEquals( getErrorMessageText(), "Not adding pattern \"**/*.sh\" to filetype ignored as it already exists." ); } @@ -132,7 +137,7 @@ public class RepositoryScanningTest { setFieldValue( "newpattern_3", "" ); clickAddIcon( "newpattern_3" ); - Assert.assertEquals( getSelenium().getText( "//span[@class='errorMessage']" ), + Assert.assertEquals( getErrorMessageText(), "Unable to process blank pattern." ); } @@ -141,7 +146,7 @@ public class RepositoryScanningTest { setFieldValue( "newpattern_3", "**/*.xml" ); clickAddIcon( "newpattern_3" ); - Assert.assertEquals( getSelenium().getText( "//span[@class='errorMessage']" ), + Assert.assertEquals( getErrorMessageText(), "Not adding pattern \"**/*.xml\" to filetype indexable-content as it already exists." ); }