-
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.
test(ut): new test for the UT, encapsulate checkIndex method. ref: #2…
- Loading branch information
1 parent
4b925bb
commit 3dd6090
Showing
3 changed files
with
69 additions
and
22 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
41 changes: 40 additions & 1 deletion
41
...ava/com/dotmarketing/startup/runonce/Task241014AddTemplateValueOnContentletIndexTest.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 |
---|---|---|
@@ -1,2 +1,41 @@ | ||
package com.dotmarketing.startup.runonce;public class Task241014AddTemplateValueOnContentletIndexTest { | ||
package com.dotmarketing.startup.runonce; | ||
|
||
import com.dotcms.util.IntegrationTestInitService; | ||
import com.dotmarketing.common.db.DotDatabaseMetaData; | ||
import com.dotmarketing.exception.DotDataException; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
/** | ||
* Verifies that the {@link Task241014AddTemplateValueOnContentletIndex} Upgrade Task is working as | ||
* expected. | ||
* | ||
* @since Oct 24, 2014 | ||
*/ | ||
public class Task241014AddTemplateValueOnContentletIndexTest { | ||
|
||
@BeforeClass | ||
public static void prepare() throws Exception { | ||
IntegrationTestInitService.getInstance().init(); | ||
} | ||
|
||
/** | ||
* <ul> | ||
* <li><b>Method to test: </b>{@link Task241014AddTemplateValueOnContentletIndex#executeUpgrade()}</li> | ||
* <li><b>Given Scenario: </b>Verifies that new index is included in the contentlet table.</li> | ||
* <li><b>Expected Result: </b>Index must be present.</li> | ||
* </ul> | ||
*/ | ||
@Test | ||
public void executeTaskUpgrade() throws DotDataException { | ||
final Task241014AddTemplateValueOnContentletIndex task = new Task241014AddTemplateValueOnContentletIndex(); | ||
task.executeUpgrade(); | ||
|
||
final DotDatabaseMetaData dmd = new DotDatabaseMetaData(); | ||
|
||
assertTrue("idx_contentlet_template_value should exist in the contentlet table", | ||
dmd.checkIndex("contentlet", "idx_contentlet_template_value")); | ||
} | ||
} |