Search in sources :

Example 6 with Migration

use of com.liferay.blade.api.Migration in project liferay-ide by liferay.

the class DdmTemplateSelectorTagsTest method findProblems.

@Test
public void findProblems() throws Exception {
    ServiceReference<Migration> sr = context.getServiceReference(Migration.class);
    Migration m = context.getService(sr);
    List<Problem> problems = m.findProblems(new File("jsptests/ddm-template-selector/"), new NullProgressMonitor());
    assertEquals(1, problems.size());
    boolean found = false;
    for (Problem problem : problems) {
        if (problem.file.getName().endsWith("DdmTemplateSelectorTagsTest.jsp")) {
            if (problem.lineNumber == 70 && problem.startOffset >= 2538 && problem.endOffset >= 2549) {
                found = true;
            }
        }
    }
    if (!found) {
        fail();
    }
}
Also used : NullProgressMonitor(com.liferay.blade.util.NullProgressMonitor) Migration(com.liferay.blade.api.Migration) Problem(com.liferay.blade.api.Problem) File(java.io.File) Test(org.junit.Test)

Example 7 with Migration

use of com.liferay.blade.api.Migration in project liferay-ide by liferay.

the class DeprecatedLiferayPortletIconBackTagsTest method findProblems.

@Test
public void findProblems() throws Exception {
    ServiceReference<Migration> sr = context.getServiceReference(Migration.class);
    Migration m = context.getService(sr);
    List<Problem> problems = m.findProblems(new File("jsptests/liferay-portlet-icon-back/"), new NullProgressMonitor());
    assertEquals(1, problems.size());
    boolean found = false;
    for (Problem problem : problems) {
        if (problem.file.getName().endsWith("LiferayPortletIconBack.jsp")) {
            if (problem.lineNumber == 1) {
                found = true;
            }
        }
    }
    if (!found) {
        fail();
    }
}
Also used : NullProgressMonitor(com.liferay.blade.util.NullProgressMonitor) Migration(com.liferay.blade.api.Migration) Problem(com.liferay.blade.api.Problem) File(java.io.File) Test(org.junit.Test)

Example 8 with Migration

use of com.liferay.blade.api.Migration in project liferay-ide by liferay.

the class DeprecatedLiferaySecurityEncryptTagsTest method findProblems.

@Test
public void findProblems() throws Exception {
    ServiceReference<Migration> sr = context.getServiceReference(Migration.class);
    Migration m = context.getService(sr);
    List<Problem> problems = m.findProblems(new File("jsptests/liferay-security-encrypt/"), new NullProgressMonitor());
    assertEquals(1, problems.size());
    boolean found = false;
    for (Problem problem : problems) {
        if (problem.file.getName().endsWith("LiferaySecurityEncrypt.jsp")) {
            if (problem.lineNumber == 1) {
                found = true;
            }
        }
    }
    if (!found) {
        fail();
    }
}
Also used : NullProgressMonitor(com.liferay.blade.util.NullProgressMonitor) Migration(com.liferay.blade.api.Migration) Problem(com.liferay.blade.api.Problem) File(java.io.File) Test(org.junit.Test)

Example 9 with Migration

use of com.liferay.blade.api.Migration in project liferay-ide by liferay.

the class JournalArticleTagsTest method findProblems.

@Test
public void findProblems() throws Exception {
    ServiceReference<Migration> sr = context.getServiceReference(Migration.class);
    Migration m = context.getService(sr);
    List<Problem> problems = m.findProblems(new File("jsptests/journal-article-tags/"), new NullProgressMonitor());
    assertEquals(1, problems.size());
    Problem problem = problems.get(0);
    assertTrue(problem.file.getName().endsWith("JournalArticleTagsTest.jsp"));
    assertEquals(4, problem.lineNumber);
    assertEquals("LPS-69321", problem.ticket);
}
Also used : NullProgressMonitor(com.liferay.blade.util.NullProgressMonitor) Migration(com.liferay.blade.api.Migration) Problem(com.liferay.blade.api.Problem) File(java.io.File) Test(org.junit.Test)

Example 10 with Migration

use of com.liferay.blade.api.Migration in project liferay-ide by liferay.

the class LogoSelectorTagsTest method findProblems.

@Test
public void findProblems() throws Exception {
    ServiceReference<Migration> sr = context.getServiceReference(Migration.class);
    Migration m = context.getService(sr);
    List<Problem> problems = m.findProblems(new File("jsptests/logo-selector/"), new NullProgressMonitor());
    assertEquals(1, problems.size());
    boolean found = false;
    for (Problem problem : problems) {
        if (problem.file.getName().endsWith("LogoSelectorTagsTest.jsp") && problem.lineNumber == 11 && problem.startOffset >= 595 && problem.endOffset >= 606) {
            found = true;
        }
    }
    if (!found) {
        fail();
    }
}
Also used : NullProgressMonitor(com.liferay.blade.util.NullProgressMonitor) Migration(com.liferay.blade.api.Migration) Problem(com.liferay.blade.api.Problem) File(java.io.File) Test(org.junit.Test)

Aggregations

Migration (com.liferay.blade.api.Migration)28 Problem (com.liferay.blade.api.Problem)28 File (java.io.File)28 Test (org.junit.Test)27 NullProgressMonitor (com.liferay.blade.util.NullProgressMonitor)26 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 Ignore (org.junit.Ignore)2 AutoMigrator (com.liferay.blade.api.AutoMigrator)1 ProgressMonitor (com.liferay.blade.api.ProgressMonitor)1 FileProblems (com.liferay.ide.project.core.upgrade.FileProblems)1 MigrationProblems (com.liferay.ide.project.core.upgrade.MigrationProblems)1 MigrationProblemsContainer (com.liferay.ide.project.core.upgrade.MigrationProblemsContainer)1 UpgradeProblems (com.liferay.ide.project.core.upgrade.UpgradeProblems)1 ExecutionException (org.eclipse.core.commands.ExecutionException)1 IFile (org.eclipse.core.resources.IFile)1 WorkspaceJob (org.eclipse.core.resources.WorkspaceJob)1 CoreException (org.eclipse.core.runtime.CoreException)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IStatus (org.eclipse.core.runtime.IStatus)1