Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge branch 'integration/master' into enforcedValidation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed Sep 10, 2013
2 parents 1aba6bc + 627dd85 commit a72aea8
Show file tree
Hide file tree
Showing 42 changed files with 1,411 additions and 634 deletions.
35 changes: 35 additions & 0 deletions .gitattributes
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/dealing-with-line-endings

# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto

# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.css text
*.csv text
*.groovy text
*.h text
*.html text
*.ini text
*.java text
*.js text
*.launch text
*.po text
*.pot text
*.properties text
*.sh text
*.sql text
*.txt text
*.xhtml text
*.xml text

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.gif binary
*.jar binary
*.jpg binary
*.png binary
79 changes: 58 additions & 21 deletions functional-test/pom.xml
Expand Up @@ -68,27 +68,48 @@
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<artifactId>selenium-api</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
<version>${selenium.version}</version>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
</exclusion>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
<exclusion>
<artifactId>xml-apis</artifactId>
<groupId>xml-apis</groupId>
</exclusion>
<exclusion>
<artifactId>xercesImpl</artifactId>
<groupId>xerces</groupId>
</exclusion>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
<exclusion>
<artifactId>xml-apis</artifactId>
<groupId>xml-apis</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand All @@ -107,10 +128,6 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down Expand Up @@ -164,6 +181,11 @@
<scope>${hibernate.scope}</scope>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>

<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
Expand Down Expand Up @@ -415,6 +437,21 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<failOnWarning>true</failOnWarning>
<usedDependencies combine.children="append">
<usedDependency>com.h2database:h2</usedDependency>
<usedDependency>org.hibernate:hibernate-core</usedDependency>
<usedDependency>org.hibernate:hibernate-envers</usedDependency>
<usedDependency>org.hibernate:hibernate-entitymanager</usedDependency>
<usedDependency>org.hibernate:hibernate-infinispan</usedDependency>
<usedDependency>org.projectlombok:lombok</usedDependency>
</usedDependencies>
</configuration>
</plugin>

<!--we want to run tests in integration phase-->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
11 changes: 7 additions & 4 deletions functional-test/src/main/java/org/zanata/page/AbstractPage.java
Expand Up @@ -82,11 +82,14 @@ protected void clickAndCheckErrors(WebElement button)
protected void clickAndExpectErrors(WebElement button)
{
button.click();
List<String> errors = getErrors();
if (errors.isEmpty())
refreshPageUntil(this, new Predicate<WebDriver>()
{
throw new RuntimeException("Errors expected, none found.");
}
@Override
public boolean apply(WebDriver input)
{
return getErrors().size() > 0;
}
});
}

public List<String> getErrors()
Expand Down
Expand Up @@ -15,7 +15,6 @@
import org.zanata.util.TableRow;
import org.zanata.util.WebElementUtil;

import javax.annotation.Nullable;

import java.util.List;

Expand Down Expand Up @@ -113,7 +112,7 @@ public VersionGroupPage closeSearchResult(final int expectedRow)
return refreshPageUntil(this, new Predicate<WebDriver>()
{
@Override
public boolean apply(@Nullable WebDriver input)
public boolean apply(@javax.annotation.Nullable WebDriver input)
{
List<TableRow> tableRows = WebElementUtil.getTableRows(input, versionsInGroupTableBy);
int size = tableRows.size();
Expand Down
Expand Up @@ -7,11 +7,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

import javax.annotation.Nullable;

import org.concordion.api.Resource;
import org.concordion.internal.ClassPathSource;
import org.junit.runners.Suite;
Expand All @@ -20,7 +17,6 @@
import com.google.common.base.Joiner;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;

import lombok.extern.slf4j.Slf4j;
Expand Down
Expand Up @@ -116,11 +116,6 @@ public void invalidResetPasswordFieldEntries()
@Test
public void emptyResetPasswordFieldEntries()
{
// Both are valid, but show seemingly at random
List<String> emptyUsernameErrors = new ArrayList<String>();
emptyUsernameErrors.add("size must be between 3 and 20");
emptyUsernameErrors.add("must match ^[a-z\\d_]{3,20}$");

SignInPage signInPage = new BasicWorkFlow().goToHome().clickSignInLink();
ResetPasswordPage resetPasswordPage = signInPage.gotToResetPassword();
resetPasswordPage = resetPasswordPage.clearFields();
Expand All @@ -129,8 +124,11 @@ public void emptyResetPasswordFieldEntries()
assertThat("Empty email error is displayed", resetPasswordPage.waitForErrors(),
hasItem("may not be empty"));


assertThat(resetPasswordPage.getErrors().get(0), equalTo("may not be empty"));
// All are valid, but may show at random
assertThat(resetPasswordPage.getErrors().get(0),
either(equalTo("size must be between 3 and 20"))
.or(equalTo("may not be empty"))
.or(equalTo("must match ^[a-z\\d_]{3,20}$")));

}

Expand Down
6 changes: 6 additions & 0 deletions functional-test/src/test/resources/conf/standalone.xml
Expand Up @@ -218,6 +218,7 @@
<subsystem xmlns="urn:jboss:domain:naming:1.3">
<bindings>
<simple name="java:global/zanata/security/auth-policy-names/internal" value="zanata.internal"/>
<simple name="java:global/zanata/security/auth-policy-names/openid" value="zanata.openid"/>
<simple name="java:global/zanata/security/admin-users" value="admin"/>
<simple name="java:global/zanata/email/default-from-address" value="no-reply@zanata.org" />
<simple name="java:global/zanata/files/document-storage-directory" value="${project.build.directory}/zanata-documents"/>
Expand Down Expand Up @@ -262,6 +263,11 @@
<login-module code="org.jboss.seam.security.jaas.SeamLoginModule" flag="required"/>
</authentication>
</security-domain>
<security-domain name="zanata.openid">
<authentication>
<login-module code="org.zanata.security.OpenIdLoginModule" flag="required"/>
</authentication>
</security-domain>
</security-domains>
</subsystem>
<subsystem xmlns="urn:jboss:domain:threads:1.1"/>
Expand Down

0 comments on commit a72aea8

Please sign in to comment.