Search in sources :

Example 21 with NullProgressMonitor

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

the class EmptyFileCheckingTest 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("projects/emptyfiles/"), new NullProgressMonitor());
    assertEquals(0, 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 22 with NullProgressMonitor

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

the class AUIButtonItemTagsTest 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/aui-button/"), new NullProgressMonitor());
    assertEquals(2, problems.size());
    boolean found = false;
    for (Problem problem : problems) {
        if (problem.file.getName().endsWith("AUIButtonItemTagTest.jsp")) {
            if (problem.lineNumber == 3 && problem.startOffset >= 94 && problem.endOffset >= 129) {
                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 23 with NullProgressMonitor

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

the class AUIColumnTagsTest 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/aui-column/"), new NullProgressMonitor());
    assertEquals(2, problems.size());
    boolean found = false;
    for (Problem problem : problems) {
        if (problem.file.getName().endsWith("AUIColumnTagTest.jsp")) {
            if (problem.lineNumber == 2 && problem.startOffset >= 58 && problem.endOffset >= 461) {
                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 24 with NullProgressMonitor

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

the class AUILayoutTagsTest 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/aui-layout/"), new NullProgressMonitor());
    assertEquals(1, problems.size());
    boolean found = false;
    for (Problem problem : problems) {
        if (problem.file.getName().endsWith("AUILayoutTagTest.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 25 with NullProgressMonitor

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

the class AUILiferayTagsTest 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/aui-liferay/"), new NullProgressMonitor());
    assertEquals(1, problems.size());
    boolean found = false;
    for (Problem problem : problems) {
        if (problem.file.getName().endsWith("AUILiferayTagTest.jsp")) {
            if (problem.lineNumber == 1 && problem.startOffset == 16 && problem.endOffset == 48) {
                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)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