diff --git a/functional-test/src/main/java/org/zanata/page/glossary/GlossaryPage.java b/functional-test/src/main/java/org/zanata/page/glossary/GlossaryPage.java index e3cc93eb1e..4e4968417a 100644 --- a/functional-test/src/main/java/org/zanata/page/glossary/GlossaryPage.java +++ b/functional-test/src/main/java/org/zanata/page/glossary/GlossaryPage.java @@ -20,12 +20,14 @@ */ package org.zanata.page.glossary; +import java.util.ArrayList; import java.util.List; import lombok.extern.slf4j.Slf4j; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; import org.zanata.page.BasePage; import org.zanata.util.WebElementUtil; @@ -36,7 +38,10 @@ @Slf4j public class GlossaryPage extends BasePage { - private By glossaryTable = By.id("glossary_form:data_table"); + private By glossaryMain = By.id("glossary_form"); + private By entryCount = By.className("stats__figure"); + private By listItem = By.className("list__item--actionable"); + private By entryName = By.className("list__title"); public GlossaryPage(WebDriver driver) { super(driver); @@ -44,18 +49,30 @@ public GlossaryPage(WebDriver driver) { public List getAvailableGlossaryLanguages() { log.info("Query available glossary languages"); - return WebElementUtil.getColumnContents(getDriver(), glossaryTable, 0); + List availableLanguages = new ArrayList<>(); + for (WebElement element : getListItems()) { + availableLanguages.add(element.findElement(entryName) + .getText().trim()); + } + return availableLanguages; + } public int getGlossaryEntryCount(String lang) { log.info("Query number of glossary entries for {}", lang); - List langs = getAvailableGlossaryLanguages(); - int row = langs.indexOf(lang); + List langs = getListItems(); + int row = getAvailableGlossaryLanguages().indexOf(lang); if (row >= 0) { - return Integer - .parseInt(WebElementUtil.getColumnContents(getDriver(), - glossaryTable, 2).get(row)); + return Integer.parseInt(langs.get(row) + .findElement(entryCount).getText()); } return -1; } + + private List getListItems() { + return waitForElementExists( + waitForElementExists(glossaryMain), + By.className("list--stats")) + .findElements(listItem); + } } diff --git a/functional-test/src/main/java/org/zanata/page/projectversion/CreateVersionPage.java b/functional-test/src/main/java/org/zanata/page/projectversion/CreateVersionPage.java index beafb56f90..77f521b454 100644 --- a/functional-test/src/main/java/org/zanata/page/projectversion/CreateVersionPage.java +++ b/functional-test/src/main/java/org/zanata/page/projectversion/CreateVersionPage.java @@ -20,17 +20,15 @@ */ package org.zanata.page.projectversion; +import com.google.common.base.Function; import com.google.common.base.Predicate; import lombok.extern.slf4j.Slf4j; import org.openqa.selenium.By; +import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; import org.zanata.page.BasePage; -import org.zanata.util.Constants; - -import java.util.List; -import java.util.Map; @Slf4j public class CreateVersionPage extends BasePage { @@ -39,14 +37,13 @@ public class CreateVersionPage extends BasePage { "must start and end with letter or number, and contain only " + "letters, numbers, periods, underscores and hyphens."; + private By projectVersionID = By.id("create-version-form:slugField:slug"); private By projectTypeSelection = By.id("create-version-form:project-type"); - private By statusSelection = By.id("create-version-form:statusField:status"); private By saveButton = By.id("create-version-form:button-create"); private By copyFromPreviousVersionChk = By.id("create-version-form:copy-from-version"); - private By projectTypesList = By.id("create-version-form:project-type-list"); - private static final Map projectTypeOptions = - Constants.projectTypeOptions(); + private By projectTypesList = By.id("create-version-form:project-type-list"); + private By previousVersionsList = By.id("create-version-form:project-version"); public CreateVersionPage(final WebDriver driver) { super(driver); @@ -73,29 +70,78 @@ public boolean apply(WebDriver input) { return new CreateVersionPage(getDriver()); } - public CreateVersionPage clickCopyFromVersion() { - log.info("Click Copy From Previous checkbox"); - waitForWebElement(copyFromPreviousVersionChk).click(); + private boolean isCopyFromVersionAvailable() { + return getDriver() + .findElements(copyFromPreviousVersionChk) + .size() > 0; + } + + private void clickCopyFromCheckbox() { + ((JavascriptExecutor) getDriver()) + .executeScript("arguments[0].click();", + waitForWebElement(copyFromPreviousVersionChk) + .findElement(By.tagName("span"))); + + } + + public CreateVersionPage enableCopyFromVersion() { + log.info("Set Copy From Previous checkbox"); + if (!isCopyFromVersionAvailable()) { + log.warn("Copy Version not available!"); + return this; + } + if (copyFromVersionIsChecked()) { + log.warn("Checkbox already enabled!"); + } else { + clickCopyFromCheckbox(); + } + waitForWebElement(previousVersionsList); + return this; + } + + public CreateVersionPage disableCopyFromVersion() { + log.info("Unset Copy From Previous checkbox"); + if (!isCopyFromVersionAvailable()) { + log.warn("Copy Version not available!"); + return this; + } + if (!copyFromVersionIsChecked()) { + log.warn("Checkbox already disabled!"); + } else { + clickCopyFromCheckbox(); + } waitForWebElement(projectTypesList); - return new CreateVersionPage(getDriver()); + return this; + } + + public boolean copyFromVersionIsChecked() { + log.info("Query is Copy from Version checkbox checked"); + return waitForWebElement(copyFromPreviousVersionChk) + .findElement(By.tagName("input")).isSelected(); } private WebElement getVersionIdField() { log.info("Query Version ID"); - return waitForWebElement(By.id("create-version-form:slugField:slug")); + return waitForWebElement(projectVersionID); } - public CreateVersionPage selectProjectType(String projectType) { + public CreateVersionPage selectProjectType(final String projectType) { log.info("Click project type {}", projectType); - List projectTypes = waitForWebElement(projectTypeSelection) - .findElements(By.tagName("li")); - for (WebElement projectTypeLi : projectTypes) { - if (projectTypeLi.findElement(By.xpath(".//div/label")).getText() - .startsWith(projectType)) { - projectTypeLi.findElement(By.xpath(".//div")).click(); - break; + WebElement projectTypeCheck = waitForAMoment() + .until(new Function() { + @Override + public WebElement apply(WebDriver input) { + for (WebElement item : waitForWebElement(projectTypeSelection) + .findElements(By.tagName("li"))) { + if (item.findElement(By.tagName("label")).getText() + .startsWith(projectType)) { + return item; + } + } + return null; } - } + }); + projectTypeCheck.click(); return new CreateVersionPage(getDriver()); } diff --git a/functional-test/src/main/java/org/zanata/page/projectversion/VersionLanguagesPage.java b/functional-test/src/main/java/org/zanata/page/projectversion/VersionLanguagesPage.java index 9a66a5df4c..6433a203b5 100644 --- a/functional-test/src/main/java/org/zanata/page/projectversion/VersionLanguagesPage.java +++ b/functional-test/src/main/java/org/zanata/page/projectversion/VersionLanguagesPage.java @@ -28,7 +28,6 @@ import org.zanata.page.webtrans.EditorPage; import com.google.common.base.Function; import com.google.common.base.Preconditions; -import com.google.common.base.Predicate; import lombok.extern.slf4j.Slf4j; @@ -44,61 +43,71 @@ public VersionLanguagesPage(final WebDriver driver) { super(driver); } + private By languageList = By.id("languages-language_list"); + private By languageItemTitle = By.className("list__item__meta"); + private By languageItemStats = By.className("stats__figure"); + private By languageDocumentList = By.id("languages-document_list"); + private By documentListItem = By.className("list__item--actionable"); + private By documentListItemTitle = By.className("list__title"); + private List getLanguageTabLocaleList() { - return waitForWebElement(By.id("languages-language_list")) - .findElements(By.tagName("li")); + return waitForWebElement(languageList).findElements(By.tagName("li")); } - public EditorPage translate(final String locale, final String docName) { - log.info("Click on {} : {} to begin translation", locale, docName); - gotoLanguageTab(); - return refreshPageUntil(this, new Function() { - @Override - public EditorPage apply(WebDriver driver) { - List localeList = getLanguageTabLocaleList(); - for (WebElement localeRow : localeList) { - WebElement link = localeRow.findElement(By.xpath(".//a")); - if (link.findElement(By.className("list__item")) - .findElement(By.className("list__item__info")) - .findElement(By.className("list__item__meta")) - .getText().equals(locale)) { - clickLinkAfterAnimation(link); - - List documentList = - getVersionTabDocumentList(); - for (int i = 0; i < documentList.size(); i++) { - WebElement document = documentList.get(i); - if (document - .findElement( - By.xpath(".//a/div/div/h3[@class='list__title']")) - .getText().equals(docName)) { - - clickLinkAfterAnimation(document.findElement(By - .id(i + ":" + "link-translate-options"))); + private List getLanguageTabDocumentList() { + log.info("Query documents list"); + return waitForWebElement(languageDocumentList) + .findElement(By.className("list--stats")) + .findElements(documentListItem); + } - clickLinkAfterAnimation(document - .findElement( - By.id(i - + ":" - + "link-translate-online")) - .findElement(By.tagName("a"))); + public VersionLanguagesPage clickLocale(final String locale) { + log.info("Click locale {}", locale); + WebElement listItem = waitForAMoment() + .until(new Function() { + @Override + public WebElement apply(WebDriver input) { + for (WebElement localeRow : getLanguageTabLocaleList()) { + WebElement link = localeRow + .findElement(By.xpath(".//a")); // Top + if (link.findElement(languageItemTitle) + .getText().equals(locale)) { + return link; + } + } + return null; + } + }); + clickLinkAfterAnimation(listItem); + return new VersionLanguagesPage(getDriver()); + } - return new EditorPage(getDriver()); + public EditorPage clickDocument(final String docName) { + log.info("Click document {}", docName); + WebElement document = waitForAMoment() + .until(new Function() { + @Override + public WebElement apply(WebDriver input) { + for (WebElement document : getLanguageTabDocumentList()) { + if (waitForElementExists(document, + documentListItemTitle) + .getText().equals(docName)) { + return document + .findElement(documentListItemTitle); } } + return null; } - } - throw new IllegalArgumentException("can not translate locale: " - + locale); - } - }); + }); + clickLinkAfterAnimation(document); + return new EditorPage(getDriver()); } - private List getVersionTabDocumentList() { - log.info("Query documents list"); - return waitForWebElement( - By.xpath("//form[@id='languages-document_list']/ul[@class='list--stats']")) - .findElements(By.tagName("li")); + public EditorPage translate(final String locale, final String docName) { + log.info("Click on {} : {} to begin translation", locale, docName); + return gotoLanguageTab() + .clickLocale(locale) + .clickDocument(docName); } public String getStatisticsForLocale(final String localeId) { @@ -112,12 +121,10 @@ public String apply(WebDriver webDriver) { List localeList = getLanguageTabLocaleList(); for (WebElement locale : localeList) { - if (locale.findElement( - By.xpath(".//a/div/div/span[@class='list__item__meta']")) + if (locale.findElement(languageItemTitle) .getText() .equals(localeId)) { - figure = locale.findElement( - By.xpath(".//a/div/div[2]/span/span[@class='stats__figure']")) + figure = locale.findElement(languageItemStats) .getText(); break; } diff --git a/functional-test/src/main/java/org/zanata/workflow/ProjectWorkFlow.java b/functional-test/src/main/java/org/zanata/workflow/ProjectWorkFlow.java index 64a0afad4a..a6f4a582d9 100644 --- a/functional-test/src/main/java/org/zanata/workflow/ProjectWorkFlow.java +++ b/functional-test/src/main/java/org/zanata/workflow/ProjectWorkFlow.java @@ -138,7 +138,7 @@ public VersionLanguagesPage createNewProjectVersion(String projectName, if (driver.findElements(By.id("create-version-form:copy-from-version")) .size() > 0) { createVersionPage = createVersionPage - .clickCopyFromVersion() + .disableCopyFromVersion() .selectProjectType(versionType); } return createVersionPage.inputVersionId(versionID).saveVersion(); diff --git a/functional-test/src/test/java/org/zanata/feature/Feature.java b/functional-test/src/test/java/org/zanata/feature/Feature.java index 942dbd6753..1df39534e5 100644 --- a/functional-test/src/test/java/org/zanata/feature/Feature.java +++ b/functional-test/src/test/java/org/zanata/feature/Feature.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.feature; import java.lang.annotation.ElementType; diff --git a/functional-test/src/test/java/org/zanata/feature/account/InvalidEmailAddressTest.java b/functional-test/src/test/java/org/zanata/feature/account/InvalidEmailAddressTest.java index 7516866528..a7ca65e745 100644 --- a/functional-test/src/test/java/org/zanata/feature/account/InvalidEmailAddressTest.java +++ b/functional-test/src/test/java/org/zanata/feature/account/InvalidEmailAddressTest.java @@ -22,7 +22,6 @@ import lombok.extern.slf4j.Slf4j; -import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Rule; import org.junit.experimental.categories.Category; @@ -35,7 +34,6 @@ import org.zanata.feature.testharness.ZanataTestCase; import org.zanata.feature.testharness.TestPlan.DetailedTest; import org.zanata.page.account.RegisterPage; -import org.zanata.page.utility.HomePage; import org.zanata.util.EnsureLogoutRule; import org.zanata.util.rfc2822.InvalidEmailAddressRFC2822; import org.zanata.workflow.BasicWorkFlow; diff --git a/functional-test/src/test/java/org/zanata/feature/clientserver/GettextPluralSupportTest.java b/functional-test/src/test/java/org/zanata/feature/clientserver/GettextPluralSupportTest.java index e7405e67bb..df52a0ebe5 100644 --- a/functional-test/src/test/java/org/zanata/feature/clientserver/GettextPluralSupportTest.java +++ b/functional-test/src/test/java/org/zanata/feature/clientserver/GettextPluralSupportTest.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.feature.clientserver; import java.io.File; diff --git a/functional-test/src/test/java/org/zanata/feature/clientserver/ProjectMaintainerTest.java b/functional-test/src/test/java/org/zanata/feature/clientserver/ProjectMaintainerTest.java index 02d1c92173..1474011239 100644 --- a/functional-test/src/test/java/org/zanata/feature/clientserver/ProjectMaintainerTest.java +++ b/functional-test/src/test/java/org/zanata/feature/clientserver/ProjectMaintainerTest.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.feature.clientserver; import com.google.common.base.Joiner; diff --git a/functional-test/src/test/java/org/zanata/feature/clientserver/PropertiesRoundTripTest.java b/functional-test/src/test/java/org/zanata/feature/clientserver/PropertiesRoundTripTest.java index 58fb5d6297..dfb021a47f 100644 --- a/functional-test/src/test/java/org/zanata/feature/clientserver/PropertiesRoundTripTest.java +++ b/functional-test/src/test/java/org/zanata/feature/clientserver/PropertiesRoundTripTest.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.feature.clientserver; import java.io.File; diff --git a/functional-test/src/test/java/org/zanata/feature/concurrentedit/ConcurrentAccessTest.java b/functional-test/src/test/java/org/zanata/feature/concurrentedit/ConcurrentAccessTest.java index 21d1e33b5b..a589e9c89f 100644 --- a/functional-test/src/test/java/org/zanata/feature/concurrentedit/ConcurrentAccessTest.java +++ b/functional-test/src/test/java/org/zanata/feature/concurrentedit/ConcurrentAccessTest.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.feature.concurrentedit; import java.util.Collections; diff --git a/functional-test/src/test/java/org/zanata/feature/concurrentedit/ConcurrentEditTest.java b/functional-test/src/test/java/org/zanata/feature/concurrentedit/ConcurrentEditTest.java index 6c8b134664..0c828af724 100644 --- a/functional-test/src/test/java/org/zanata/feature/concurrentedit/ConcurrentEditTest.java +++ b/functional-test/src/test/java/org/zanata/feature/concurrentedit/ConcurrentEditTest.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.feature.concurrentedit; import org.junit.Before; diff --git a/functional-test/src/test/java/org/zanata/feature/document/DocTypeUploadTest.java b/functional-test/src/test/java/org/zanata/feature/document/DocTypeUploadTest.java index 915eb81702..555f24aca2 100644 --- a/functional-test/src/test/java/org/zanata/feature/document/DocTypeUploadTest.java +++ b/functional-test/src/test/java/org/zanata/feature/document/DocTypeUploadTest.java @@ -23,17 +23,15 @@ import lombok.extern.slf4j.Slf4j; import org.junit.BeforeClass; import org.junit.ClassRule; -import org.junit.Rule; import org.junit.experimental.categories.Category; import org.junit.experimental.theories.DataPoint; import org.junit.experimental.theories.Theories; import org.junit.experimental.theories.Theory; import org.junit.runner.RunWith; import org.zanata.feature.testharness.TestPlan.BasicAcceptanceTest; +import org.zanata.feature.testharness.TestPlan.DetailedTest; import org.zanata.feature.testharness.ZanataTestCase; import org.zanata.page.projectversion.VersionDocumentsPage; -import org.zanata.page.projectversion.VersionLanguagesPage; -import org.zanata.page.projectversion.versionsettings.VersionDocumentsTab; import org.zanata.page.webtrans.EditorPage; import org.zanata.util.CleanDocumentStorageRule; import org.zanata.util.SampleProjectRule; @@ -51,6 +49,7 @@ */ @Slf4j @RunWith(Theories.class) +@Category(DetailedTest.class) public class DocTypeUploadTest extends ZanataTestCase { @ClassRule diff --git a/functional-test/src/test/java/org/zanata/feature/document/HTMLDocumentTypeTest.java b/functional-test/src/test/java/org/zanata/feature/document/HTMLDocumentTypeTest.java index 5c82671150..e6f3abb8af 100644 --- a/functional-test/src/test/java/org/zanata/feature/document/HTMLDocumentTypeTest.java +++ b/functional-test/src/test/java/org/zanata/feature/document/HTMLDocumentTypeTest.java @@ -22,10 +22,8 @@ import java.io.File; -import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; -import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.zanata.feature.Feature; diff --git a/functional-test/src/test/java/org/zanata/feature/document/MultiFileUploadTest.java b/functional-test/src/test/java/org/zanata/feature/document/MultiFileUploadTest.java index 64a33f45dc..d3c7a94471 100644 --- a/functional-test/src/test/java/org/zanata/feature/document/MultiFileUploadTest.java +++ b/functional-test/src/test/java/org/zanata/feature/document/MultiFileUploadTest.java @@ -24,8 +24,6 @@ import lombok.extern.slf4j.Slf4j; import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; diff --git a/functional-test/src/test/java/org/zanata/feature/document/SubtitleDocumentTypeTest.java b/functional-test/src/test/java/org/zanata/feature/document/SubtitleDocumentTypeTest.java index d4268939e9..44d54c7368 100644 --- a/functional-test/src/test/java/org/zanata/feature/document/SubtitleDocumentTypeTest.java +++ b/functional-test/src/test/java/org/zanata/feature/document/SubtitleDocumentTypeTest.java @@ -21,7 +21,6 @@ package org.zanata.feature.document; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; @@ -29,21 +28,16 @@ import org.zanata.feature.testharness.TestPlan.DetailedTest; import org.zanata.feature.testharness.ZanataTestCase; import org.zanata.page.projectversion.VersionDocumentsPage; -import org.zanata.page.projectversion.VersionLanguagesPage; -import org.zanata.page.projectversion.versionsettings.VersionDocumentsTab; import org.zanata.page.webtrans.EditorPage; import org.zanata.util.CleanDocumentStorageRule; import org.zanata.util.SampleProjectRule; import org.zanata.util.TestFileGenerator; import org.zanata.util.ZanataRestCaller; -import org.zanata.workflow.BasicWorkFlow; import org.zanata.workflow.LoginWorkFlow; -import org.zanata.workflow.ProjectWorkFlow; import java.io.File; import static org.assertj.core.api.Assertions.assertThat; -import static org.zanata.util.FunctionalTestHelper.assumeTrue; /** * Covers more detailed testing of the subtitle formats diff --git a/functional-test/src/test/java/org/zanata/feature/document/UploadTest.java b/functional-test/src/test/java/org/zanata/feature/document/UploadTest.java index d204902fbe..57a876f962 100644 --- a/functional-test/src/test/java/org/zanata/feature/document/UploadTest.java +++ b/functional-test/src/test/java/org/zanata/feature/document/UploadTest.java @@ -24,8 +24,6 @@ import lombok.extern.slf4j.Slf4j; import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.ClassRule; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; diff --git a/functional-test/src/test/java/org/zanata/feature/editor/EditorFilterMessagesTest.java b/functional-test/src/test/java/org/zanata/feature/editor/EditorFilterMessagesTest.java index 3ee96d9422..9136741ccf 100644 --- a/functional-test/src/test/java/org/zanata/feature/editor/EditorFilterMessagesTest.java +++ b/functional-test/src/test/java/org/zanata/feature/editor/EditorFilterMessagesTest.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.feature.editor; import static org.assertj.core.api.Assertions.assertThat; @@ -50,11 +70,12 @@ public void setUp() { tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0) @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION) public void canFilterByMultipleFields() { - EditorPage editorPage = - new BasicWorkFlow().goToEditor("about-fedora", "master", "fr", - document); + EditorPage editorPage = new BasicWorkFlow() + .goToEditor("about-fedora", "master", "fr", document); + assertThat(editorPage.getMessageSources()).containsExactly( "hello world", "greetings", "hey"); + final EditorPage page = editorPage.inputFilterQuery("resource-id:res2"); editorPage.waitFor(new Callable>() { diff --git a/functional-test/src/test/java/org/zanata/feature/editor/TranslateHTMLTest.java b/functional-test/src/test/java/org/zanata/feature/editor/TranslateHTMLTest.java index 5a6c05e859..6403e46b21 100644 --- a/functional-test/src/test/java/org/zanata/feature/editor/TranslateHTMLTest.java +++ b/functional-test/src/test/java/org/zanata/feature/editor/TranslateHTMLTest.java @@ -21,7 +21,6 @@ package org.zanata.feature.editor; import java.io.File; -import java.util.HashMap; import org.junit.Before; import org.junit.Rule; diff --git a/functional-test/src/test/java/org/zanata/feature/editor/TranslateIdmlTest.java b/functional-test/src/test/java/org/zanata/feature/editor/TranslateIdmlTest.java index 2a92fbdf0d..60084630e4 100644 --- a/functional-test/src/test/java/org/zanata/feature/editor/TranslateIdmlTest.java +++ b/functional-test/src/test/java/org/zanata/feature/editor/TranslateIdmlTest.java @@ -21,7 +21,6 @@ package org.zanata.feature.editor; import java.io.File; -import java.util.HashMap; import org.junit.Before; import org.junit.Rule; diff --git a/functional-test/src/test/java/org/zanata/feature/editor/TranslateOpenOfficeTest.java b/functional-test/src/test/java/org/zanata/feature/editor/TranslateOpenOfficeTest.java index 8c1a415704..bbf4d7fa4e 100644 --- a/functional-test/src/test/java/org/zanata/feature/editor/TranslateOpenOfficeTest.java +++ b/functional-test/src/test/java/org/zanata/feature/editor/TranslateOpenOfficeTest.java @@ -21,7 +21,6 @@ package org.zanata.feature.editor; import java.io.File; -import java.util.HashMap; import org.junit.Before; import org.junit.Rule; diff --git a/functional-test/src/test/java/org/zanata/feature/editor/TranslateTextTest.java b/functional-test/src/test/java/org/zanata/feature/editor/TranslateTextTest.java index 4a823f8548..4ac4cd89f1 100644 --- a/functional-test/src/test/java/org/zanata/feature/editor/TranslateTextTest.java +++ b/functional-test/src/test/java/org/zanata/feature/editor/TranslateTextTest.java @@ -21,7 +21,6 @@ package org.zanata.feature.editor; import java.io.File; -import java.util.HashMap; import org.junit.Before; import org.junit.Rule; diff --git a/functional-test/src/test/java/org/zanata/feature/editor/TranslationHistoryTest.java b/functional-test/src/test/java/org/zanata/feature/editor/TranslationHistoryTest.java index d1d9d90bae..42bc7451b0 100644 --- a/functional-test/src/test/java/org/zanata/feature/editor/TranslationHistoryTest.java +++ b/functional-test/src/test/java/org/zanata/feature/editor/TranslationHistoryTest.java @@ -22,6 +22,8 @@ import org.junit.Rule; import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.zanata.feature.testharness.TestPlan.DetailedTest; import org.zanata.feature.testharness.ZanataTestCase; import org.zanata.page.webtrans.EditorPage; import org.zanata.util.RetryRule; @@ -34,6 +36,7 @@ /** * @author Damian Jansen djansen@redhat.com */ +@Category(DetailedTest.class) public class TranslationHistoryTest extends ZanataTestCase { @Rule diff --git a/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryAdminTest.java b/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryAdminTest.java index 3139217c90..0b5e6101f2 100644 --- a/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryAdminTest.java +++ b/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryAdminTest.java @@ -27,6 +27,7 @@ import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.rules.TestRule; +import org.zanata.feature.Feature; import org.zanata.feature.testharness.ZanataTestCase; import org.zanata.feature.testharness.TestPlan.DetailedTest; import org.zanata.page.glossary.GlossaryPage; @@ -38,7 +39,6 @@ import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.greaterThan; @@ -59,10 +59,11 @@ public class GlossaryAdminTest extends ZanataTestCase { * Validates that a pushed glossary appears in the Glossary table. * After pushing, a table with Glossary statistics should be shown. * Validate that the the number of glossary entries per language matches - * the number of entries pushed from each of the test cases metnioned in the + * the number of entries pushed from each of the test cases mentioned in the * Setup. - * @see TCMS Test Case 181711 */ + @Feature(summary = "A user can push glossaries to Zanata", + tcmsTestPlanIds = 5316, tcmsTestCaseIds = 181711) @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION) public void testGlossaryView() { // Push a glossary @@ -71,12 +72,12 @@ public void testGlossaryView() { String userConfigPath = ClientWorkFlow.getUserConfigPath("glossaryadmin"); - List result = - clientWorkFlow - .callWithTimeout( - projectRootPath, - "mvn --batch-mode zanata:glossary-push -Dglossary.lang=hi -Dzanata.glossaryFile=compendium.csv -Dzanata.userConfig=" - + userConfigPath); + List result = clientWorkFlow .callWithTimeout( + projectRootPath, + "mvn --batch-mode zanata:glossary-push " + + "-Dglossary.lang=hi " + + "-Dzanata.glossaryFile=compendium.csv " + + "-Dzanata.userConfig=" + userConfigPath); assertThat(clientWorkFlow.isPushSuccessful(result), Matchers.is(true)); @@ -87,9 +88,11 @@ public void testGlossaryView() { List langs = glossaryPage.getAvailableGlossaryLanguages(); assertThat(langs.size(), greaterThan(0)); - assertThat(langs, containsInAnyOrder("pl", "hi", "en-US")); - assertThat(glossaryPage.getGlossaryEntryCount("pl"), greaterThan(1)); - assertThat(glossaryPage.getGlossaryEntryCount("hi"), greaterThan(1)); - assertThat(glossaryPage.getGlossaryEntryCount("en-US"), greaterThan(1)); + assertThat(langs, containsInAnyOrder("Polish", + "Hindi", "English (United States)")); + assertThat(glossaryPage.getGlossaryEntryCount("Polish"), greaterThan(1)); + assertThat(glossaryPage.getGlossaryEntryCount("Hindi"), greaterThan(1)); + assertThat(glossaryPage.getGlossaryEntryCount("English (United States)"), + greaterThan(1)); } } diff --git a/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryDeleteTest.java b/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryDeleteTest.java index 9cad9f3288..b224e1ac26 100644 --- a/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryDeleteTest.java +++ b/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryDeleteTest.java @@ -33,7 +33,6 @@ import org.zanata.workflow.BasicWorkFlow; import org.zanata.workflow.ClientWorkFlow; import org.zanata.workflow.LoginWorkFlow; -import org.zanata.workflow.ProjectWorkFlow; import java.io.File; import java.util.List; diff --git a/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryPushTest.java b/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryPushTest.java index 41e90f2fdb..ccd7e29e68 100644 --- a/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryPushTest.java +++ b/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryPushTest.java @@ -31,7 +31,6 @@ import org.zanata.feature.testharness.TestPlan.DetailedTest; import org.zanata.page.webtrans.EditorPage; import org.zanata.util.SampleProjectRule; -import org.zanata.workflow.BasicWorkFlow; import org.zanata.workflow.ClientWorkFlow; import org.zanata.workflow.LoginWorkFlow; diff --git a/functional-test/src/test/java/org/zanata/feature/language/ContactLanguageTeamTest.java b/functional-test/src/test/java/org/zanata/feature/language/ContactLanguageTeamTest.java index 1df3ae5f69..d78886e7f4 100644 --- a/functional-test/src/test/java/org/zanata/feature/language/ContactLanguageTeamTest.java +++ b/functional-test/src/test/java/org/zanata/feature/language/ContactLanguageTeamTest.java @@ -25,7 +25,7 @@ import org.junit.experimental.categories.Category; import org.subethamail.wiser.WiserMessage; import org.zanata.feature.Feature; -import org.zanata.feature.testharness.TestPlan; +import org.zanata.feature.testharness.TestPlan.DetailedTest; import org.zanata.feature.testharness.ZanataTestCase; import org.zanata.page.languages.LanguagesPage; import org.zanata.util.AddUsersRule; @@ -39,7 +39,7 @@ /** * @author Damian Jansen djansen@redhat.com */ -@Category(TestPlan.DetailedTest.class) +@Category(DetailedTest.class) public class ContactLanguageTeamTest extends ZanataTestCase { @Rule diff --git a/functional-test/src/test/java/org/zanata/feature/misc/ContactAdminTest.java b/functional-test/src/test/java/org/zanata/feature/misc/ContactAdminTest.java index 1815678509..673aa709ff 100644 --- a/functional-test/src/test/java/org/zanata/feature/misc/ContactAdminTest.java +++ b/functional-test/src/test/java/org/zanata/feature/misc/ContactAdminTest.java @@ -1,8 +1,27 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.feature.misc; import java.util.List; -import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -20,7 +39,6 @@ import org.zanata.workflow.LoginWorkFlow; import static org.assertj.core.api.Assertions.assertThat; -import static org.zanata.util.FunctionalTestHelper.loosely; /** * @author Patrick Huang djansen@redhat.com */ +@Category(DetailedTest.class) public class VersionFilteringTest extends ZanataTestCase { @ClassRule diff --git a/functional-test/src/test/java/org/zanata/feature/rest/CopyTransTest.java b/functional-test/src/test/java/org/zanata/feature/rest/CopyTransTest.java index 998eb69b6e..000e62cd86 100644 --- a/functional-test/src/test/java/org/zanata/feature/rest/CopyTransTest.java +++ b/functional-test/src/test/java/org/zanata/feature/rest/CopyTransTest.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.feature.rest; import org.hamcrest.Matchers; diff --git a/functional-test/src/test/java/org/zanata/feature/security/SecurityTest.java b/functional-test/src/test/java/org/zanata/feature/security/SecurityTest.java index 417a9d9e22..3b7ffc4cf4 100644 --- a/functional-test/src/test/java/org/zanata/feature/security/SecurityTest.java +++ b/functional-test/src/test/java/org/zanata/feature/security/SecurityTest.java @@ -20,7 +20,6 @@ */ package org.zanata.feature.security; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -33,7 +32,6 @@ import org.zanata.util.AddUsersRule; import org.zanata.util.EnsureLogoutRule; import org.zanata.util.HasEmailRule; -import org.zanata.util.RetryRule; import org.zanata.workflow.BasicWorkFlow; import org.zanata.workflow.LoginWorkFlow; diff --git a/functional-test/src/test/java/org/zanata/feature/testharness/DetailedTestSuite.java b/functional-test/src/test/java/org/zanata/feature/testharness/DetailedTestSuite.java index d83f66f810..a017fdb4df 100644 --- a/functional-test/src/test/java/org/zanata/feature/testharness/DetailedTestSuite.java +++ b/functional-test/src/test/java/org/zanata/feature/testharness/DetailedTestSuite.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.feature.testharness; import org.junit.experimental.categories.Categories; diff --git a/functional-test/src/test/java/org/zanata/feature/testharness/TestPlan.java b/functional-test/src/test/java/org/zanata/feature/testharness/TestPlan.java index f382958770..45a9812607 100644 --- a/functional-test/src/test/java/org/zanata/feature/testharness/TestPlan.java +++ b/functional-test/src/test/java/org/zanata/feature/testharness/TestPlan.java @@ -27,11 +27,20 @@ import org.zanata.feature.clientserver.*; import org.zanata.feature.concurrentedit.*; import org.zanata.feature.dashboard.DashboardTest; +import org.zanata.feature.document.DocTypeUploadTest; import org.zanata.feature.document.HTMLDocumentTypeTest; +import org.zanata.feature.document.MultiFileUploadTest; +import org.zanata.feature.document.SubtitleDocumentTypeTest; import org.zanata.feature.document.UploadTest; import org.zanata.feature.editor.*; +import org.zanata.feature.glossary.GlossaryAdminTest; +import org.zanata.feature.glossary.GlossaryDeleteTest; +import org.zanata.feature.glossary.GlossaryPushTest; +import org.zanata.feature.glossary.InvalidGlossaryPushTest; +import org.zanata.feature.googleopenid.GoogleOpenIDTest; import org.zanata.feature.infrastructure.RetryRuleTest; import org.zanata.feature.language.AddLanguageTest; +import org.zanata.feature.language.ContactLanguageTeamTest; import org.zanata.feature.language.JoinLanguageTeamTest; import org.zanata.feature.misc.*; import org.zanata.feature.project.*; @@ -75,7 +84,6 @@ AutoRoleAssignmentTest.class, EditHomePageTest.class, EditTranslationMemoryTest.class, - EditTranslationMemoryTest.class, ManageSearchTest.class, ManageUsersTest.class, @@ -103,18 +111,38 @@ * Document * Source document upload and management */ + DocTypeUploadTest.class, HTMLDocumentTypeTest.class, + MultiFileUploadTest.class, + SubtitleDocumentTypeTest.class, UploadTest.class, /* * Editor * Translation editor general features */ + EditorFilterMessagesTest.class, TranslateHTMLTest.class, TranslateIdmlTest.class, TranslateOdsTest.class, TranslateOpenOfficeTest.class, TranslateTextTest.class, + TranslationHistoryTest.class, + + /* + * Glossary + * Glossary management features + */ + GlossaryAdminTest.class, + GlossaryDeleteTest.class, + GlossaryPushTest.class, + InvalidGlossaryPushTest.class, + + /* + * Google OpenID + * Registration and log in with Google OpenID + */ + GoogleOpenIDTest.class, /* * Infrastructure @@ -127,6 +155,7 @@ * Participation in an management of language teams */ AddLanguageTest.class, + ContactLanguageTeamTest.class, JoinLanguageTeamTest.class, /* diff --git a/functional-test/src/test/java/org/zanata/util/AddUsersRule.java b/functional-test/src/test/java/org/zanata/util/AddUsersRule.java index c534a57a99..2c14b4a36e 100644 --- a/functional-test/src/test/java/org/zanata/util/AddUsersRule.java +++ b/functional-test/src/test/java/org/zanata/util/AddUsersRule.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.util; import org.junit.rules.ExternalResource; diff --git a/functional-test/src/test/java/org/zanata/util/CleanDatabaseRule.java b/functional-test/src/test/java/org/zanata/util/CleanDatabaseRule.java index 24c5ba9d38..bc4fd352a8 100644 --- a/functional-test/src/test/java/org/zanata/util/CleanDatabaseRule.java +++ b/functional-test/src/test/java/org/zanata/util/CleanDatabaseRule.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.util; import org.junit.rules.ExternalResource; diff --git a/functional-test/src/test/java/org/zanata/util/CleanDocumentStorageRule.java b/functional-test/src/test/java/org/zanata/util/CleanDocumentStorageRule.java index 527ead8d64..1738bd63bd 100644 --- a/functional-test/src/test/java/org/zanata/util/CleanDocumentStorageRule.java +++ b/functional-test/src/test/java/org/zanata/util/CleanDocumentStorageRule.java @@ -1,6 +1,25 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.util; -import com.google.common.base.Throwables; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.FileUtils; import org.junit.rules.ExternalResource; diff --git a/functional-test/src/test/java/org/zanata/util/EnsureLogoutRule.java b/functional-test/src/test/java/org/zanata/util/EnsureLogoutRule.java index ab92d4e635..0104d89eae 100644 --- a/functional-test/src/test/java/org/zanata/util/EnsureLogoutRule.java +++ b/functional-test/src/test/java/org/zanata/util/EnsureLogoutRule.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.util; import org.junit.rules.TestRule; diff --git a/functional-test/src/test/java/org/zanata/util/FeatureInventoryRecorder.java b/functional-test/src/test/java/org/zanata/util/FeatureInventoryRecorder.java index 3e98bc2d43..3d5aac12a5 100644 --- a/functional-test/src/test/java/org/zanata/util/FeatureInventoryRecorder.java +++ b/functional-test/src/test/java/org/zanata/util/FeatureInventoryRecorder.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.util; import java.io.File; diff --git a/functional-test/src/test/java/org/zanata/util/HasEmailRule.java b/functional-test/src/test/java/org/zanata/util/HasEmailRule.java index b4792bd2ef..39f584d9f2 100644 --- a/functional-test/src/test/java/org/zanata/util/HasEmailRule.java +++ b/functional-test/src/test/java/org/zanata/util/HasEmailRule.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.util; import java.util.List; diff --git a/functional-test/src/test/java/org/zanata/util/NoScreenshot.java b/functional-test/src/test/java/org/zanata/util/NoScreenshot.java index ef6974c692..48254df77c 100644 --- a/functional-test/src/test/java/org/zanata/util/NoScreenshot.java +++ b/functional-test/src/test/java/org/zanata/util/NoScreenshot.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.util; import java.lang.annotation.ElementType; diff --git a/functional-test/src/test/java/org/zanata/util/SampleDataResourceClient.java b/functional-test/src/test/java/org/zanata/util/SampleDataResourceClient.java index 4d0eee3b7c..c73a2585fa 100644 --- a/functional-test/src/test/java/org/zanata/util/SampleDataResourceClient.java +++ b/functional-test/src/test/java/org/zanata/util/SampleDataResourceClient.java @@ -1,12 +1,30 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.util; -import java.util.Set; import javax.ws.rs.core.Response; import org.hamcrest.Matchers; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; -import org.zanata.common.LocaleId; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/functional-test/src/test/java/org/zanata/util/SampleProjectRule.java b/functional-test/src/test/java/org/zanata/util/SampleProjectRule.java index a7c03f03c6..665432c5d3 100644 --- a/functional-test/src/test/java/org/zanata/util/SampleProjectRule.java +++ b/functional-test/src/test/java/org/zanata/util/SampleProjectRule.java @@ -21,11 +21,7 @@ package org.zanata.util; -import java.util.Set; - import org.junit.rules.ExternalResource; -import org.zanata.common.LocaleId; -import com.google.common.collect.Sets; import lombok.extern.slf4j.Slf4j; import static org.zanata.util.SampleDataResourceClient.*; diff --git a/functional-test/src/test/java/org/zanata/util/ScreenshotEnabledTestRunListener.java b/functional-test/src/test/java/org/zanata/util/ScreenshotEnabledTestRunListener.java index 300504d6ad..d079ecf996 100644 --- a/functional-test/src/test/java/org/zanata/util/ScreenshotEnabledTestRunListener.java +++ b/functional-test/src/test/java/org/zanata/util/ScreenshotEnabledTestRunListener.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.util; import java.io.File; diff --git a/functional-test/src/test/java/org/zanata/util/ZanataRestCaller.java b/functional-test/src/test/java/org/zanata/util/ZanataRestCaller.java index db4d3a2df1..4136ec3c13 100644 --- a/functional-test/src/test/java/org/zanata/util/ZanataRestCaller.java +++ b/functional-test/src/test/java/org/zanata/util/ZanataRestCaller.java @@ -1,3 +1,23 @@ +/* + * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the + * @author tags. See the copyright.txt file in the distribution for a full + * listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF + * site: http://www.fsf.org. + */ package org.zanata.util; import java.net.URI; @@ -27,7 +47,6 @@ import org.zanata.rest.dto.resource.TextFlowTarget; import org.zanata.rest.dto.resource.TranslationsResource; import org.zanata.rest.dto.stats.ContainerTranslationStatistics; -import com.google.common.base.Preconditions; import com.google.common.base.Throwables; import com.google.common.collect.Lists; import com.google.common.collect.Sets; diff --git a/zanata-war/src/main/java/org/zanata/webtrans/client/view/SourceContentsView.ui.xml b/zanata-war/src/main/java/org/zanata/webtrans/client/view/SourceContentsView.ui.xml index e9135e303e..9571d40eef 100644 --- a/zanata-war/src/main/java/org/zanata/webtrans/client/view/SourceContentsView.ui.xml +++ b/zanata-war/src/main/java/org/zanata/webtrans/client/view/SourceContentsView.ui.xml @@ -14,7 +14,7 @@
  • - +