Search in sources :

Example 6 with NullProgressMonitor

use of com.liferay.blade.util.NullProgressMonitor 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 7 with NullProgressMonitor

use of com.liferay.blade.util.NullProgressMonitor 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 8 with NullProgressMonitor

use of com.liferay.blade.util.NullProgressMonitor 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)

Example 9 with NullProgressMonitor

use of com.liferay.blade.util.NullProgressMonitor in project liferay-ide by liferay.

the class PortletIconTagsTest 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/portlet-icon/"), new NullProgressMonitor());
    assertEquals(13, problems.size());
}
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 NullProgressMonitor

use of com.liferay.blade.util.NullProgressMonitor in project liferay-ide by liferay.

the class AllJSPTagProblemsTest method allProblems.

@Ignore
@Test
public void allProblems() throws Exception {
    ServiceReference<Migration> sr = context.getServiceReference(Migration.class);
    Migration m = context.getService(sr);
    List<Problem> problems = m.findProblems(new File("jsptests/"), new NullProgressMonitor());
    final int expectedSize = 59;
    final int size = problems.size();
    if (size != expectedSize) {
        System.err.println("All problems size is " + size + ", expected size is " + expectedSize);
    }
    assertEquals(expectedSize, size);
}
Also used : NullProgressMonitor(com.liferay.blade.util.NullProgressMonitor) Migration(com.liferay.blade.api.Migration) Problem(com.liferay.blade.api.Problem) File(java.io.File) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

Migration (com.liferay.blade.api.Migration)26 Problem (com.liferay.blade.api.Problem)26 NullProgressMonitor (com.liferay.blade.util.NullProgressMonitor)26 File (java.io.File)26 Test (org.junit.Test)26 Ignore (org.junit.Ignore)2 AutoMigrator (com.liferay.blade.api.AutoMigrator)1 HashSet (java.util.HashSet)1 ServiceReference (org.osgi.framework.ServiceReference)1