| @@ -57,7 +57,6 @@ | ||
|
|
||
| private static final XStream xstream = XStreamHelper.createXStreamInstance(); | ||
| static { | ||
| Class<?>[] types = new Class[] { | ||
| CourseConfig.class, Hashtable.class, HashMap.class | ||
| }; | ||
| @@ -81,7 +81,6 @@ | ||
|
|
||
| private static XStream configXstream = XStreamHelper.createXStreamInstance(); | ||
| static { | ||
| Class<?>[] types = new Class[] { | ||
| CPPackageConfig.class, DeliveryOptions.class | ||
| }; | ||
| @@ -60,6 +60,7 @@ | ||
|
|
||
| private static final XStream xstream = XStreamHelper.createXStreamInstance(); | ||
| static { | ||
| XStreamHelper.allowDefaultPackage(xstream); | ||
| xstream.alias("item", ItemImpl.class); | ||
| } | ||
|
|
||
| @@ -0,0 +1,137 @@ | ||
| /** | ||
| * <a href="http://www.openolat.org"> | ||
| * OpenOLAT - Online Learning and Training</a><br> | ||
| * <p> | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); <br> | ||
| * you may not use this file except in compliance with the License.<br> | ||
| * You may obtain a copy of the License at the | ||
| * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a> | ||
| * <p> | ||
| * Unless required by applicable law or agreed to in writing,<br> | ||
| * software distributed under the License is distributed on an "AS IS" BASIS, <br> | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> | ||
| * See the License for the specific language governing permissions and <br> | ||
| * limitations under the License. | ||
| * <p> | ||
| * Initial code contributed and copyrighted by<br> | ||
| * frentix GmbH, http://www.frentix.com | ||
| * <p> | ||
| */ | ||
| package org.olat.upgrade; | ||
|
|
||
| import java.nio.file.Files; | ||
| import java.nio.file.Path; | ||
| import java.nio.file.Paths; | ||
| import java.util.List; | ||
|
|
||
| import org.apache.logging.log4j.Logger; | ||
| import org.olat.core.commons.modules.bc.FolderConfig; | ||
| import org.olat.core.commons.persistence.DB; | ||
| import org.olat.core.commons.persistence.QueryBuilder; | ||
| import org.olat.core.logging.Tracing; | ||
| import org.olat.core.util.xml.XStreamHelper; | ||
| import org.olat.course.CourseXStreamAliases; | ||
| import org.olat.course.PersistingCourseImpl; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
|
|
||
| import com.thoughtworks.xstream.XStream; | ||
|
|
||
| /** | ||
| * | ||
| * Initial date: 18 juin 2021<br> | ||
| * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com | ||
| * | ||
| */ | ||
| public class OLATUpgrade_15_3_18 extends OLATUpgrade { | ||
|
|
||
| private static final Logger log = Tracing.createLoggerFor(OLATUpgrade_15_3_18.class); | ||
|
|
||
| private static final String VERSION = "OLAT_15.3.18"; | ||
| private static final String OPEN_COURSES = "OPEN COURSES"; | ||
|
|
||
| @Autowired | ||
| private DB dbInstance; | ||
|
|
||
| public OLATUpgrade_15_3_18() { | ||
| super(); | ||
| } | ||
|
|
||
| @Override | ||
| public String getVersion() { | ||
| return VERSION; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean doPostSystemInitUpgrade(UpgradeManager upgradeManager) { | ||
| UpgradeHistoryData uhd = upgradeManager.getUpgradesHistory(VERSION); | ||
| if (uhd == null) { | ||
| // has never been called, initialize | ||
| uhd = new UpgradeHistoryData(); | ||
| } else if (uhd.isInstallationComplete()) { | ||
| return false; | ||
| } | ||
|
|
||
| boolean allOk = true; | ||
| allOk &= openCourse(upgradeManager, uhd); | ||
|
|
||
| uhd.setInstallationComplete(allOk); | ||
| upgradeManager.setUpgradesHistory(uhd, VERSION); | ||
| if(allOk) { | ||
| log.info(Tracing.M_AUDIT, "Finished OLATUpgrade_15_3_18 successfully!"); | ||
| } else { | ||
| log.info(Tracing.M_AUDIT, "OLATUpgrade_15_3_18 not finished, try to restart OpenOlat!"); | ||
| } | ||
| return allOk; | ||
| } | ||
|
|
||
| private boolean openCourse(UpgradeManager upgradeManager, UpgradeHistoryData uhd) { | ||
| boolean allOk = true; | ||
| if (!uhd.getBooleanDataValue(OPEN_COURSES)) { | ||
| try { | ||
| Path coursesPath = Paths.get(FolderConfig.getCanonicalRoot(), PersistingCourseImpl.COURSE_ROOT_DIR_NAME); | ||
| List<Long> resourceIds = getCourseKeys(); | ||
| for(Long resourceId:resourceIds) { | ||
| checkCourse(coursesPath, resourceId); | ||
| } | ||
| } catch (Exception e) { | ||
| log.error("", e); | ||
| allOk = false; | ||
| } | ||
|
|
||
| uhd.setBooleanDataValue(OPEN_COURSES, allOk); | ||
| upgradeManager.setUpgradesHistory(uhd, VERSION); | ||
| } | ||
| return allOk; | ||
| } | ||
|
|
||
| private void checkCourse(Path coursesPath, Long resourceId) { | ||
| try { | ||
| Path coursePath = coursesPath.resolve(resourceId.toString()); | ||
| Path runStructure = coursePath.resolve(PersistingCourseImpl.RUNSTRUCTURE_XML); | ||
| Path editorTree = coursePath.resolve(PersistingCourseImpl.EDITORTREEMODEL_XML); | ||
|
|
||
| XStream xstream = CourseXStreamAliases.getReadCourseXStream(); | ||
| if(Files.exists(runStructure)) { | ||
| XStreamHelper.readObject(xstream, runStructure.toFile()); | ||
| } | ||
| if(Files.exists(editorTree)) { | ||
| XStreamHelper.readObject(xstream, editorTree.toFile()); | ||
| } | ||
| } catch (Exception e) { | ||
| log.error("Error with course: {}", resourceId, e); | ||
| } | ||
| } | ||
|
|
||
| private List<Long> getCourseKeys() { | ||
| QueryBuilder sb = new QueryBuilder(); | ||
| sb.append("select ores.resId from repositoryentry v") | ||
| .append(" inner join v.olatResource as ores") | ||
| .and().append(" ores.resName = 'CourseModule'"); | ||
|
|
||
| List<Long> courseKeys = dbInstance.getCurrentEntityManager() | ||
| .createQuery(sb.toString(), Long.class) | ||
| .getResultList(); | ||
| dbInstance.commitAndCloseSession(); | ||
| return courseKeys; | ||
| } | ||
| } |
| @@ -0,0 +1,94 @@ | ||
| /** | ||
| * <a href="http://www.openolat.org"> | ||
| * OpenOLAT - Online Learning and Training</a><br> | ||
| * <p> | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); <br> | ||
| * you may not use this file except in compliance with the License.<br> | ||
| * You may obtain a copy of the License at the | ||
| * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a> | ||
| * <p> | ||
| * Unless required by applicable law or agreed to in writing,<br> | ||
| * software distributed under the License is distributed on an "AS IS" BASIS, <br> | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> | ||
| * See the License for the specific language governing permissions and <br> | ||
| * limitations under the License. | ||
| * <p> | ||
| * Initial code contributed and copyrighted by<br> | ||
| * frentix GmbH, http://www.frentix.com | ||
| * <p> | ||
| */ | ||
| package org.olat.core.commons.modules.glossary; | ||
|
|
||
| import java.io.File; | ||
| import java.net.MalformedURLException; | ||
| import java.net.URI; | ||
| import java.net.URISyntaxException; | ||
| import java.net.URL; | ||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
| import java.util.UUID; | ||
|
|
||
| import org.apache.logging.log4j.Logger; | ||
| import org.junit.Assert; | ||
| import org.junit.Test; | ||
| import org.olat.core.logging.Tracing; | ||
| import org.olat.core.util.WebappHelper; | ||
| import org.olat.core.util.vfs.VFSLeaf; | ||
| import org.olat.test.OlatTestCase; | ||
| import org.olat.test.VFSJavaIOFile; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
|
|
||
| /** | ||
| * | ||
| * Initial date: 21 juin 2021<br> | ||
| * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com | ||
| * | ||
| */ | ||
| public class GlossaryItemManagerTest extends OlatTestCase { | ||
|
|
||
| private static final Logger log = Tracing.createLoggerFor(GlossaryItemManagerTest.class); | ||
|
|
||
| @Autowired | ||
| private GlossaryItemManager glossaryItemManager; | ||
|
|
||
| @Test | ||
| public void loadGlossaryItemListFromFile() throws URISyntaxException { | ||
| URL glossaryUrl = GlossaryItemManagerTest.class.getResource("glossary.xml"); | ||
| VFSLeaf glossaryLeaf = new VFSJavaIOFile(glossaryUrl.toURI()); | ||
| List<GlossaryItem> items = glossaryItemManager.loadGlossaryItemListFromFile(glossaryLeaf); | ||
| Assert.assertNotNull(items); | ||
| } | ||
|
|
||
| @Test | ||
| public void saveToFile() throws URISyntaxException, MalformedURLException{ | ||
| GlossaryItem item = new GlossaryItem("Definition", "This is a definition."); | ||
| List<String> flexions = new ArrayList<>(); | ||
| flexions.add("Add"); | ||
| flexions.add("Flex"); | ||
| item.setGlossFlexions(flexions); | ||
| List<URI> uris = new ArrayList<>(); | ||
| uris.add(new URL("https://www.frentix.com").toURI()); | ||
| item.setGlossLinks(uris); | ||
| List<String> synonyms = new ArrayList<>(); | ||
| synonyms.add("Synonym"); | ||
| item.setGlossSynonyms(synonyms); | ||
|
|
||
| List<GlossaryItem> items = new ArrayList<>(); | ||
| items.add(item); | ||
|
|
||
| File glossaryFile = new File(WebappHelper.getTmpDir(), "glossary" + UUID.randomUUID() + ".xml"); | ||
| glossaryFile.getParentFile().mkdirs(); | ||
| VFSLeaf glossaryLeaf = new VFSJavaIOFile(glossaryFile); | ||
| glossaryItemManager.saveToFile(glossaryLeaf, items); | ||
|
|
||
| // read the files | ||
| List<GlossaryItem> savedItems = glossaryItemManager.loadGlossaryItemListFromFile(glossaryLeaf); | ||
| Assert.assertNotNull(items); | ||
| Assert.assertEquals(1, savedItems.size()); | ||
| Assert.assertEquals("Definition", savedItems.get(0).getGlossTerm()); | ||
|
|
||
| if(!glossaryFile.delete()) { | ||
| log.error("Cannot delete: {}", glossaryFile); | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,86 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <list> | ||
| <glossentry> | ||
| <glossTerm>Forsythie</glossTerm> | ||
| <glossDef><![CDATA[<p>Die Forsythie, auch Garten-Forsythie, Goldflieder oder Goldglöckchen genannt, ist ein häufig gepflanzter Zierstrauch. Es handelt sich um eine Hybride zweier Arten aus der Gattung der Forsythien. Diese gehört zur Familie der Ölbaumgewächse.</p>]]></glossDef> | ||
| <glossSynonyms/> | ||
| <revHistory> | ||
| <revision> | ||
| <author> | ||
| <firstname>Jeremery</firstname> | ||
| <surname>Johns</surname> | ||
| <link>[Identity:66027520]</link> | ||
| </author> | ||
| <revisionflag>added</revisionflag> | ||
| <date>22 Mar 2021</date> | ||
| </revision> | ||
| <revision> | ||
| <author> | ||
| <firstname>Jeremery</firstname> | ||
| <surname>Johns</surname> | ||
| <link>[Identity:66027520]</link> | ||
| </author> | ||
| <revisionflag>added</revisionflag> | ||
| <date>22 Mar 2021</date> | ||
| </revision> | ||
| <revision> | ||
| <author> | ||
| <firstname>Jeremery</firstname> | ||
| <surname>Johns</surname> | ||
| <link>[Identity:66027520]</link> | ||
| </author> | ||
| <revisionflag>changed</revisionflag> | ||
| <date>22 Mar 2021</date> | ||
| </revision> | ||
| </revHistory> | ||
| </glossentry> | ||
| <glossentry> | ||
| <glossTerm>Kraut- und Braunfäule</glossTerm> | ||
| <glossDef><![CDATA[<p><img src="https://www.gesal.ch/.imaging/focus/dam/global/pests-diseases/Kraut-Braunfaeule_Tomate.jpg0/jcr:content.jpeg?x=53&y=41&lastModified=Mon+Dec+02+13%3A31%3A13+CET+2019&width=472&height=354" alt=" herb and brown rot - Kraut- und Braunfaeule" width="117" height="88" /></p> | ||
| <p>Kraut- und Braunfäule ist eine Pilzerkrankung, die vor allem im Sommer bei feuchten Witterungsbedingungen auftritt. Bei Tomatenpflanzen erscheinen auf den Blättern graugrüne später braune Flecken, die sich schnell ausbreiten. Die Früchte zeigen schmutzig braune Flecken. Das Fruchtfleisch ist unter den Flecken verhärtet und fault. Die Dauerformen dieses Schadpilzes überdauern im Boden und befallen bei geeigneten Bedingungen (feuchtwarm über 15°C) ab Ende Juni zunächst die bodennahen Blätter.</p>]]></glossDef> | ||
| <glossSynonyms/> | ||
| <revHistory> | ||
| <revision> | ||
| <author> | ||
| <firstname>Jeremery</firstname> | ||
| <surname>Johns</surname> | ||
| <link>[Identity:66027520]</link> | ||
| </author> | ||
| <revisionflag>added</revisionflag> | ||
| <date>23 Mar 2021</date> | ||
| </revision> | ||
| </revHistory> | ||
| </glossentry> | ||
| <glossentry> | ||
| <glossTerm>Test</glossTerm> | ||
| <glossDef></glossDef> | ||
| <glossSynonyms/> | ||
| <revHistory> | ||
| <revision> | ||
| <author> | ||
| <firstname>Jeremery</firstname> | ||
| <surname>Johns</surname> | ||
| <link>[Identity:66027520]</link> | ||
| </author> | ||
| <revisionflag>added</revisionflag> | ||
| <date>23 Mar 2021</date> | ||
| </revision> | ||
| </revHistory> | ||
| </glossentry> | ||
| <glossentry> | ||
| <glossTerm>Tomatenhaus</glossTerm> | ||
| <glossDef><![CDATA[<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>]]></glossDef> | ||
| <glossSynonyms/> | ||
| <revHistory> | ||
| <revision> | ||
| <author> | ||
| <firstname>Jeremery</firstname> | ||
| <surname>Johns</surname> | ||
| <link>[Identity:66027520]</link> | ||
| </author> | ||
| <revisionflag>added</revisionflag> | ||
| <date>24 Mar 2021</date> | ||
| </revision> | ||
| </revHistory> | ||
| </glossentry> | ||
| </list> |
| @@ -48,7 +48,7 @@ | ||
| @BeforeClass | ||
| public static void loadBouncyCastle() { | ||
| new PersistedProperties(event -> { | ||
| // do nothing | ||
| }); | ||
| } | ||
|
|
||
| @@ -0,0 +1,84 @@ | ||
| /** | ||
| * <a href="http://www.openolat.org"> | ||
| * OpenOLAT - Online Learning and Training</a><br> | ||
| * <p> | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); <br> | ||
| * you may not use this file except in compliance with the License.<br> | ||
| * You may obtain a copy of the License at the | ||
| * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a> | ||
| * <p> | ||
| * Unless required by applicable law or agreed to in writing,<br> | ||
| * software distributed under the License is distributed on an "AS IS" BASIS, <br> | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> | ||
| * See the License for the specific language governing permissions and <br> | ||
| * limitations under the License. | ||
| * <p> | ||
| * Initial code contributed and copyrighted by<br> | ||
| * frentix GmbH, http://www.frentix.com | ||
| * <p> | ||
| */ | ||
| package org.olat.core.util.xml; | ||
|
|
||
| import java.io.File; | ||
| import java.net.URISyntaxException; | ||
| import java.net.URL; | ||
|
|
||
| import org.junit.Assert; | ||
| import org.junit.Test; | ||
| import org.olat.core.logging.OLATRuntimeException; | ||
|
|
||
| import com.thoughtworks.xstream.converters.ConversionException; | ||
|
|
||
| /** | ||
| * | ||
| * Initial date: 18 juin 2021<br> | ||
| * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com | ||
| * | ||
| */ | ||
| public class XStreamHelperTest { | ||
|
|
||
| @Test | ||
| public void readXmlMapAllowed() throws URISyntaxException { | ||
| URL url = XStreamHelperTest.class.getResource("xstream_map_strings.xml"); | ||
| File file = new File(url.toURI()); | ||
| Object obj = XStreamHelper.createXStreamInstance().fromXML(file); | ||
| Assert.assertNotNull(obj); | ||
| } | ||
|
|
||
| @Test | ||
| public void readXmlMapDbObjectsAllowed() throws URISyntaxException { | ||
| URL url = XStreamHelperTest.class.getResource("xstream_map_strings.xml"); | ||
| File file = new File(url.toURI()); | ||
| Object obj = XStreamHelper.createXStreamInstanceForDBObjects().fromXML(file); | ||
| Assert.assertNotNull(obj); | ||
| } | ||
|
|
||
| @Test | ||
| public void readXmlMapUnconfiguredAllowed() throws URISyntaxException { | ||
| URL url = XStreamHelperTest.class.getResource("xstream_map_strings.xml"); | ||
| File file = new File(url.toURI()); | ||
| Object obj = XStreamHelper.readObject(file); | ||
| Assert.assertNotNull(obj); | ||
| } | ||
|
|
||
| @Test(expected = ConversionException.class) | ||
| public void readXmlMapNotAllowed() throws URISyntaxException { | ||
| URL url = XStreamHelperTest.class.getResource("xstream_map_alien.xml"); | ||
| File file = new File(url.toURI()); | ||
| XStreamHelper.createXStreamInstance().fromXML(file); | ||
| } | ||
|
|
||
| @Test(expected = ConversionException.class) | ||
| public void readXmlMapDbObjectsNotAllowed() throws URISyntaxException { | ||
| URL url = XStreamHelperTest.class.getResource("xstream_map_alien.xml"); | ||
| File file = new File(url.toURI()); | ||
| XStreamHelper.createXStreamInstanceForDBObjects().fromXML(file); | ||
| } | ||
|
|
||
| @Test(expected = OLATRuntimeException.class) | ||
| public void readXmlMapUnconfiguredNotAllowed() throws URISyntaxException { | ||
| URL url = XStreamHelperTest.class.getResource("xstream_map_alien.xml"); | ||
| File file = new File(url.toURI()); | ||
| XStreamHelper.readObject(file); | ||
| } | ||
| } |
| @@ -0,0 +1,8 @@ | ||
| <java.util.HashMap> | ||
| <entry> | ||
| <string>Hello</string> | ||
| <org.springframework.scheduling.quartz.JobDetailFactoryBean> | ||
| <name>World</name> | ||
| </org.springframework.scheduling.quartz.JobDetailFactoryBean> | ||
| </entry> | ||
| </java.util.HashMap> |
| @@ -0,0 +1,6 @@ | ||
| <java.util.HashMap> | ||
| <entry> | ||
| <string>Hello</string> | ||
| <string>World</string> | ||
| </entry> | ||
| </java.util.HashMap> |
| @@ -0,0 +1,76 @@ | ||
| /** | ||
| * <a href="http://www.openolat.org"> | ||
| * OpenOLAT - Online Learning and Training</a><br> | ||
| * <p> | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); <br> | ||
| * you may not use this file except in compliance with the License.<br> | ||
| * You may obtain a copy of the License at the | ||
| * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a> | ||
| * <p> | ||
| * Unless required by applicable law or agreed to in writing,<br> | ||
| * software distributed under the License is distributed on an "AS IS" BASIS, <br> | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> | ||
| * See the License for the specific language governing permissions and <br> | ||
| * limitations under the License. | ||
| * <p> | ||
| * Initial code contributed and copyrighted by<br> | ||
| * frentix GmbH, http://www.frentix.com | ||
| * <p> | ||
| */ | ||
| package org.olat.upgrade; | ||
|
|
||
| import java.io.File; | ||
| import java.net.URL; | ||
| import java.util.Map; | ||
| import java.util.UUID; | ||
|
|
||
| import org.apache.logging.log4j.Logger; | ||
| import org.junit.Assert; | ||
| import org.junit.Test; | ||
| import org.olat.core.logging.Tracing; | ||
| import org.olat.core.util.WebappHelper; | ||
| import org.olat.core.util.xml.XStreamHelper; | ||
|
|
||
| /** | ||
| * | ||
| * Initial date: 18 juin 2021<br> | ||
| * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com | ||
| * | ||
| */ | ||
| public class UpgradeManagerTest { | ||
|
|
||
| private static final Logger log = Tracing.createLoggerFor(UpgradeManagerTest.class); | ||
|
|
||
| @Test | ||
| public void readUpgradesXml() throws Exception { | ||
| URL upgradeUrl = UpgradeManagerTest.class.getResource("installed_upgrades.xml"); | ||
| File upgradeFile = new File(upgradeUrl.toURI()); | ||
| Map<String, UpgradeHistoryData> upgrades = UpgradeManager.read(upgradeFile); | ||
| Assert.assertNotNull(upgrades); | ||
| Assert.assertFalse(upgrades.isEmpty()); | ||
| } | ||
|
|
||
| @Test | ||
| public void readDatabaseUpgradesXml() throws Exception { | ||
| URL upgradeUrl = UpgradeManagerTest.class.getResource("installed_database_upgrades.xml"); | ||
| File upgradeFile = new File(upgradeUrl.toURI()); | ||
| Map<String, UpgradeHistoryData> upgrades = UpgradeManager.read(upgradeFile); | ||
| Assert.assertNotNull(upgrades); | ||
| Assert.assertFalse(upgrades.isEmpty()); | ||
| } | ||
|
|
||
| @Test | ||
| public void writeDatabaseUpgradesXml() throws Exception { | ||
| URL upgradeUrl = UpgradeManagerTest.class.getResource("installed_database_upgrades.xml"); | ||
| File upgradeFile = new File(upgradeUrl.toURI()); | ||
| Map<String, UpgradeHistoryData> upgrades = UpgradeManager.read(upgradeFile); | ||
| Assert.assertNotNull(upgrades); | ||
| Assert.assertFalse(upgrades.isEmpty()); | ||
|
|
||
| File savedFile = new File(WebappHelper.getTmpDir(), "upgradeDB-" + UUID.randomUUID() + ".xml"); | ||
| XStreamHelper.writeObject(UpgradeManager.upgradesXStream, savedFile, upgrades); | ||
| if(!savedFile.delete()) { | ||
| log.error("Cannot delete: {}", savedFile); | ||
| } | ||
| } | ||
| } |