-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 13192 edit mode cleanup (#13193)
* #13164 untested work * #13164 removes multitreefactory from hibernate, includes treefactory * #13164 removes tree from inode and category hibernate * #13164 removing old code * core#13192 edit mode parsing * #13192 edit mode parsing * #13192 contenttool * #13194 some untested fixes * #13194 use map.getOrDefault methods * #13194 loadObjectResults * #13194 jenkins feedback fixes * #13194 fixes the red * #13192 Container+Content Resource * #13192 adding widget support * #13192 adding widget support * #13192 container pulling * Add lang variables and update edit contentlet save and cancel functions to report back to ng * #13192 multitree updates * #13192 removing templatecontainers import * #13192 removing templatecontainers from hibernate * #13192 allow multitree to be imported * #13192 fixes import * #13192 copying velocity work to new folder * Update ContentSelector dojo widget to make it work with ng * #13192 kinda running * #13192 look ma, no red * Fix ContentSelector select event * Fix edit contentlet requires fields * #13192 live mode working * #13192 slow and steady * #13192 live mode * #13192 live mode working * #13192 preview mode working exclaimation point * #13192 readding the integration tests * #13192 ContainerResourceWorking * Merge remote-tracking branch 'remotes/origin/master' into issue-13192-edit-mode-cleanup # Conflicts: # dotCMS/src/main/java/com/dotmarketing/util/TaskLocatorUtil.java * #13192 CloseDB aspect fixed * #13192 unable to save pages * #13192 white space cleanup
- Loading branch information
1 parent
3a8b649
commit 76d9671
Showing
259 changed files
with
10,002 additions
and
9,951 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...com/dotcms/velocity/VelocityUtilTest.java → .../rendering/velocity/VelocityUtilTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...otmarketing/viewtools/BrowserAPITest.java → ...ng/velocity/viewtools/BrowserAPITest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rketing/viewtools/LanguageWebAPITest.java → ...elocity/viewtools/LanguageWebAPITest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ng/viewtools/content/ContentToolTest.java → ...ty/viewtools/content/ContentToolTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
161 changes: 161 additions & 0 deletions
161
dotCMS/src/integration-test/java/com/dotmarketing/factories/MultiTreeFactoryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
package com.dotmarketing.factories; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
import com.dotcms.IntegrationTestBase; | ||
import com.dotcms.util.IntegrationTestInitService; | ||
|
||
import com.dotmarketing.beans.MultiTree; | ||
import com.dotmarketing.startup.runonce.Task04315UpdateMultiTreePK; | ||
import com.dotmarketing.util.Logger; | ||
|
||
import java.util.List; | ||
|
||
import org.junit.AfterClass; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
|
||
public class MultiTreeFactoryTest extends IntegrationTestBase { | ||
|
||
|
||
private static final String CONTAINER = "CONTAINER"; | ||
private static final String PAGE = "PAGE"; | ||
private static final String CONTENTLET = "CONTENTLET"; | ||
private static final String RELATION_TYPE = "RELATION_TYPE"; | ||
|
||
final static int runs =2; | ||
final static int contentlets =5; | ||
@BeforeClass | ||
public static void initData() throws Exception { | ||
IntegrationTestInitService.getInstance().init(); | ||
// testUpgradeTask(); | ||
buildInitalData(); | ||
} | ||
|
||
public static void testUpgradeTask() throws Exception { | ||
Task04315UpdateMultiTreePK task = Task04315UpdateMultiTreePK.class.newInstance(); | ||
task.executeUpgrade(); | ||
} | ||
|
||
|
||
public static void buildInitalData() throws Exception { | ||
for(int i=0;i<runs;i++) { | ||
for(int j=0;j<contentlets;j++) { | ||
MultiTree mt = new MultiTree() | ||
.setContainer(CONTAINER +i) | ||
.setHtmlPage(PAGE) | ||
.setContentlet(CONTENTLET + j) | ||
.setTreeOrder(j) | ||
.setRelationType(RELATION_TYPE + i); | ||
|
||
MultiTreeFactory.saveMultiTree(mt); | ||
} | ||
} | ||
|
||
} | ||
|
||
@Test | ||
public void testDeletes() throws Exception { | ||
deleteInitialData(); | ||
buildInitalData() ; | ||
List<MultiTree> all = MultiTreeFactory.getAllMultiTrees(); | ||
|
||
List<MultiTree> list = MultiTreeFactory.getMultiTrees(PAGE); | ||
|
||
deleteInitialData(); | ||
assertTrue("multiTree deletes", MultiTreeFactory.getAllMultiTrees().size() < all.size() ); | ||
assertTrue("multiTree deletes", MultiTreeFactory.getAllMultiTrees().size() == all.size() - list.size() ); | ||
} | ||
|
||
|
||
@Test | ||
public void testReorder() throws Exception { | ||
deleteInitialData(); | ||
buildInitalData() ; | ||
MultiTree tree = MultiTreeFactory.getMultiTree(PAGE, CONTAINER+0, CONTENTLET +0, RELATION_TYPE+0); | ||
assertTrue("multiTree reorders", tree.getTreeOrder()==0 ); | ||
MultiTreeFactory.saveMultiTree(tree.setTreeOrder(7)); | ||
tree = MultiTreeFactory.getMultiTree(PAGE, CONTAINER+ 0, CONTENTLET + 0, RELATION_TYPE+0); | ||
assertTrue("multiTree reorders", tree.getTreeOrder()==4 ); | ||
MultiTreeFactory.saveMultiTree(tree.setTreeOrder(2)); | ||
List<MultiTree> list = MultiTreeFactory.getMultiTrees(PAGE, CONTAINER+0, RELATION_TYPE+0); | ||
assertTrue("multiTree reorders", list.get(2).equals(tree)); | ||
|
||
} | ||
|
||
@Test | ||
public void findByChild() throws Exception { | ||
deleteInitialData(); | ||
buildInitalData() ; | ||
|
||
List<MultiTree> list = MultiTreeFactory.getMultiTreesByChild(CONTENTLET + "0"); | ||
|
||
assertTrue("getByChild returns all results", list.size() == runs ); | ||
|
||
|
||
|
||
} | ||
|
||
|
||
|
||
@AfterClass | ||
public static void deleteInitialData() throws Exception { | ||
|
||
List<MultiTree> list = MultiTreeFactory.getMultiTrees(PAGE); | ||
|
||
for(MultiTree tree : list) { | ||
MultiTreeFactory.deleteMultiTree(tree); | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
@Test | ||
public void testSaveMultiTree() throws Exception { | ||
MultiTree mt = new MultiTree() | ||
.setContainer(CONTAINER) | ||
.setHtmlPage(PAGE) | ||
.setContentlet("NEW_ONE") | ||
.setTreeOrder(0) | ||
.setRelationType(RELATION_TYPE + 0); | ||
|
||
MultiTreeFactory.saveMultiTree(mt); | ||
|
||
MultiTree mt2 = MultiTreeFactory.getMultiTree(mt.getHtmlPage(), mt.getContainer(), mt.getContentlet(), mt.getRelationType()); | ||
assertTrue("multiTree save and get equals", mt.equals(mt2)); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
@Test | ||
public void testGetMultiTreeIdentifierIdentifierIdentifierString() throws Exception { | ||
|
||
|
||
|
||
|
||
} | ||
|
||
@Test | ||
public void testGetMultiTreeInode() throws Exception { | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.