Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
3b9036ac
by Tony CHEMIT at 2018-01-28T02:58:19+01:00
3 changed files:
- client/src/test/java/fr/ird/observe/ui/text/ObserveTextTemplateTest.java → client/src/test/java/fr/ird/observe/ui/text/ClientTextTemplatesTest.java
- + client/src/test/java/fr/ird/observe/ui/text/UiDataSourceTextTemplatesTest.java
- + client/src/test/java/fr/ird/observe/ui/text/UiMainTextTemplatesTest.java
Changes:
| ... | ... | @@ -23,9 +23,6 @@ package fr.ird.observe.ui.text; |
| 23 | 23 |
*/
|
| 24 | 24 |
|
| 25 | 25 |
import com.google.common.collect.ImmutableSet;
|
| 26 |
-import fr.ird.observe.ui.main.ObserveTestSupport;
|
|
| 27 |
-import fr.ird.observe.ui.main.ObserveMainUIApplicationContext;
|
|
| 28 |
-import fr.ird.observe.ui.admin.validate.ValidateModel;
|
|
| 29 | 26 |
import fr.ird.observe.services.ds.ClientDataSource;
|
| 30 | 27 |
import fr.ird.observe.services.service.actions.validate.DataValidationRequest;
|
| 31 | 28 |
import fr.ird.observe.services.service.actions.validate.ValidateService;
|
| ... | ... | @@ -33,6 +30,9 @@ import fr.ird.observe.services.service.actions.validate.ValidationResult; |
| 33 | 30 |
import fr.ird.observe.services.test.DatabaseName;
|
| 34 | 31 |
import fr.ird.observe.services.test.spi.DatabaseNameConfiguration;
|
| 35 | 32 |
import fr.ird.observe.test.ObserveFixtures;
|
| 33 |
+import fr.ird.observe.ui.admin.validate.ValidateModel;
|
|
| 34 |
+import fr.ird.observe.ui.main.ObserveMainUIApplicationContext;
|
|
| 35 |
+import fr.ird.observe.ui.main.ObserveTestSupport;
|
|
| 36 | 36 |
import org.apache.commons.logging.Log;
|
| 37 | 37 |
import org.apache.commons.logging.LogFactory;
|
| 38 | 38 |
import org.junit.Assert;
|
| ... | ... | @@ -44,13 +44,13 @@ import org.nuiton.validator.NuitonValidatorScope; |
| 44 | 44 |
*
|
| 45 | 45 |
* @author Tony Chemit - dev@tchemit.fr
|
| 46 | 46 |
*/
|
| 47 |
-public class ObserveTextTemplateTest extends ObserveTestSupport {
|
|
| 47 |
+@DatabaseNameConfiguration(DatabaseName.dataForTestSeine)
|
|
| 48 |
+public class ClientTextTemplatesTest extends ObserveTestSupport {
|
|
| 48 | 49 |
|
| 49 |
- private static final Log log = LogFactory.getLog(ObserveTextTemplateTest.class);
|
|
| 50 |
+ private static final Log log = LogFactory.getLog(ClientTextTemplatesTest.class);
|
|
| 50 | 51 |
|
| 51 |
- @DatabaseNameConfiguration(DatabaseName.dataForTestSeine)
|
|
| 52 | 52 |
@Test
|
| 53 |
- public void getValidationReport() {
|
|
| 53 |
+ public void applyValidateReportTemplate() {
|
|
| 54 | 54 |
|
| 55 | 55 |
ObserveMainUIApplicationContext applicationContext = getClassRule().getApplicationContext();
|
| 56 | 56 |
|
| 1 |
+package fr.ird.observe.ui.text;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Client
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import fr.ird.observe.dto.ObserveUtil;
|
|
| 26 |
+import fr.ird.observe.services.configuration.ObserveDataSourceConfiguration;
|
|
| 27 |
+import fr.ird.observe.services.configuration.ObserveDataSourceInformation;
|
|
| 28 |
+import fr.ird.observe.services.ds.ClientDataSource;
|
|
| 29 |
+import fr.ird.observe.services.test.DatabaseName;
|
|
| 30 |
+import fr.ird.observe.services.test.spi.DatabaseNameConfiguration;
|
|
| 31 |
+import fr.ird.observe.ui.ds.ClientDataSourcesManager;
|
|
| 32 |
+import fr.ird.observe.ui.ds.manager.StorageUIModel;
|
|
| 33 |
+import fr.ird.observe.ui.main.ObserveMainUIApplicationContext;
|
|
| 34 |
+import fr.ird.observe.ui.main.ObserveTestSupport;
|
|
| 35 |
+import org.apache.commons.logging.Log;
|
|
| 36 |
+import org.apache.commons.logging.LogFactory;
|
|
| 37 |
+import org.junit.Assert;
|
|
| 38 |
+import org.junit.Ignore;
|
|
| 39 |
+import org.junit.Test;
|
|
| 40 |
+ |
|
| 41 |
+import java.util.Locale;
|
|
| 42 |
+ |
|
| 43 |
+/**
|
|
| 44 |
+ * Created by tchemit on 28/01/2018.
|
|
| 45 |
+ *
|
|
| 46 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 47 |
+ */
|
|
| 48 |
+@DatabaseNameConfiguration(DatabaseName.dataForTestSeine)
|
|
| 49 |
+public class UiDataSourceTextTemplatesTest extends ObserveTestSupport {
|
|
| 50 |
+ private static final Log log = LogFactory.getLog(UiDataSourceTextTemplatesTest.class);
|
|
| 51 |
+ |
|
| 52 |
+ |
|
| 53 |
+ @Test
|
|
| 54 |
+ public void applyDataSourceInformationTemplate() {
|
|
| 55 |
+ ClientDataSource model = getMethodRule().getDataSource();
|
|
| 56 |
+ for (Locale locale : ObserveUtil.LOCALES) {
|
|
| 57 |
+ String content = UiDataSourceTextTemplates.applyDataSourceInformationTemplate(model, locale);
|
|
| 58 |
+ log.info(content);
|
|
| 59 |
+ Assert.assertNotNull(content);
|
|
| 60 |
+ }
|
|
| 61 |
+ }
|
|
| 62 |
+ |
|
| 63 |
+ @Test
|
|
| 64 |
+ @Ignore
|
|
| 65 |
+ public void applyInitStorageTemplate() {
|
|
| 66 |
+ ObserveMainUIApplicationContext applicationContext = getClassRule().getApplicationContext();
|
|
| 67 |
+ ClientDataSourcesManager.InitStorageModel model = null;
|
|
| 68 |
+ for (Locale locale : ObserveUtil.LOCALES) {
|
|
| 69 |
+ String content = UiDataSourceTextTemplates.applyInitStorageTemplate(model, locale);
|
|
| 70 |
+ log.info(content);
|
|
| 71 |
+ Assert.assertNotNull(content);
|
|
| 72 |
+ }
|
|
| 73 |
+ }
|
|
| 74 |
+ |
|
| 75 |
+ @Test
|
|
| 76 |
+ public void applyDataSourceConnexionReportTemplate() {
|
|
| 77 |
+ ObserveMainUIApplicationContext applicationContext = getClassRule().getApplicationContext();
|
|
| 78 |
+ StorageUIModel model = new StorageUIModel(applicationContext);
|
|
| 79 |
+ model.init(applicationContext, getMethodRule().getDataSource().getConfiguration());
|
|
| 80 |
+ for (Locale locale : ObserveUtil.LOCALES) {
|
|
| 81 |
+ String content = UiDataSourceTextTemplates.applyDataSourceConnexionReportTemplate(model, locale);
|
|
| 82 |
+ log.info(content);
|
|
| 83 |
+ Assert.assertNotNull(content);
|
|
| 84 |
+ }
|
|
| 85 |
+ }
|
|
| 86 |
+ |
|
| 87 |
+ @Test
|
|
| 88 |
+ public void applyDataSourcePolicyTemplate() {
|
|
| 89 |
+ ObserveDataSourceInformation model = getMethodRule().getDataSource().getInformation();
|
|
| 90 |
+ for (Locale locale : ObserveUtil.LOCALES) {
|
|
| 91 |
+ String content = UiDataSourceTextTemplates.applyDataSourcePolicyTemplate(model, locale);
|
|
| 92 |
+ log.info(content);
|
|
| 93 |
+ Assert.assertNotNull(content);
|
|
| 94 |
+ }
|
|
| 95 |
+ }
|
|
| 96 |
+ |
|
| 97 |
+ @Test
|
|
| 98 |
+ public void applyDataSourceLoadSummaryTemplate() {
|
|
| 99 |
+ ObserveMainUIApplicationContext applicationContext = getClassRule().getApplicationContext();
|
|
| 100 |
+ StorageUIModel model = new StorageUIModel(applicationContext);
|
|
| 101 |
+ model.init(applicationContext, getMethodRule().getDataSource().getConfiguration());
|
|
| 102 |
+ for (Locale locale : ObserveUtil.LOCALES) {
|
|
| 103 |
+ String content = UiDataSourceTextTemplates.applyDataSourceLoadSummaryTemplate(model, locale);
|
|
| 104 |
+ log.info(content);
|
|
| 105 |
+ Assert.assertNotNull(content);
|
|
| 106 |
+ }
|
|
| 107 |
+ }
|
|
| 108 |
+ |
|
| 109 |
+ @Test
|
|
| 110 |
+ public void applyDataSourceConfigurationTemplate() {
|
|
| 111 |
+ ObserveDataSourceConfiguration model = getMethodRule().getDataSource().getConfiguration();
|
|
| 112 |
+ for (Locale locale : ObserveUtil.LOCALES) {
|
|
| 113 |
+ String content = UiDataSourceTextTemplates.applyDataSourceConfigurationTemplate(model, locale);
|
|
| 114 |
+ log.info(content);
|
|
| 115 |
+ Assert.assertNotNull(content);
|
|
| 116 |
+ }
|
|
| 117 |
+ }
|
|
| 118 |
+ |
|
| 119 |
+ @Test
|
|
| 120 |
+ public void applyDataSourceConnexionResultTemplate() {
|
|
| 121 |
+ ObserveMainUIApplicationContext applicationContext = getClassRule().getApplicationContext();
|
|
| 122 |
+ StorageUIModel model = new StorageUIModel(applicationContext);
|
|
| 123 |
+ for (Locale locale : ObserveUtil.LOCALES) {
|
|
| 124 |
+ String content = UiDataSourceTextTemplates.applyDataSourceConnexionResultTemplate(model, locale);
|
|
| 125 |
+ log.info(content);
|
|
| 126 |
+ Assert.assertNotNull(content);
|
|
| 127 |
+ }
|
|
| 128 |
+ }
|
|
| 129 |
+}
|
| 1 |
+package fr.ird.observe.ui.text;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Client
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import fr.ird.observe.dto.ObserveUtil;
|
|
| 26 |
+import fr.ird.observe.services.test.DatabaseName;
|
|
| 27 |
+import fr.ird.observe.services.test.spi.DatabaseNameConfiguration;
|
|
| 28 |
+import fr.ird.observe.ui.main.ObserveMainUIApplicationContext;
|
|
| 29 |
+import fr.ird.observe.ui.main.ObserveTestSupport;
|
|
| 30 |
+import org.apache.commons.logging.Log;
|
|
| 31 |
+import org.apache.commons.logging.LogFactory;
|
|
| 32 |
+import org.junit.Assert;
|
|
| 33 |
+import org.junit.Test;
|
|
| 34 |
+ |
|
| 35 |
+import java.util.Locale;
|
|
| 36 |
+ |
|
| 37 |
+/**
|
|
| 38 |
+ * Created by tchemit on 28/01/2018.
|
|
| 39 |
+ *
|
|
| 40 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 41 |
+ */
|
|
| 42 |
+@DatabaseNameConfiguration(DatabaseName.dataForTestSeine)
|
|
| 43 |
+public class UiMainTextTemplatesTest extends ObserveTestSupport {
|
|
| 44 |
+ |
|
| 45 |
+ private static final Log log = LogFactory.getLog(UiMainTextTemplatesTest.class);
|
|
| 46 |
+ |
|
| 47 |
+ @Test
|
|
| 48 |
+ public void applyAboutTemplate() {
|
|
| 49 |
+ ObserveMainUIApplicationContext applicationContext = getClassRule().getApplicationContext();
|
|
| 50 |
+ for (Locale locale : ObserveUtil.LOCALES) {
|
|
| 51 |
+ String content = UiMainTextTemplates.applyAboutTemplate(applicationContext.getConfig(), locale);
|
|
| 52 |
+ log.info(content);
|
|
| 53 |
+ Assert.assertNotNull(content);
|
|
| 54 |
+ }
|
|
| 55 |
+ }
|
|
| 56 |
+ |
|
| 57 |
+}
|