Search in sources :

Example 16 with NullProgressMonitor

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

the class NavigationTagsTest 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/navigation-tags/"), new NullProgressMonitor());
    assertEquals(1, problems.size());
    boolean found = false;
    for (Problem problem : problems) {
        if (problem.file.getName().endsWith("NavigationTagsTest.jsp")) {
            if (problem.lineNumber == 3 && problem.startOffset >= 57 && problem.endOffset >= 374) {
                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 17 with NullProgressMonitor

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

the class RepositoryServiceUtilTest method repositoryServiceUtilTest.

@Test
public void repositoryServiceUtilTest() throws Exception {
    ServiceReference<Migration> sr = context.getServiceReference(Migration.class);
    Migration m = context.getService(sr);
    List<Problem> problems = m.findProblems(new File("jsptests/repository-service-util"), new NullProgressMonitor());
    assertEquals(1, problems.size());
    boolean found = false;
    for (Problem problem : problems) {
        if (problem.file.getName().endsWith("RepositoryServiceUtilTest.jsp")) {
            if (problem.lineNumber == 9 && problem.startOffset >= 104 && problem.endOffset >= 171) {
                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 18 with NullProgressMonitor

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

the class TrashEmptyTagsTest 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-ui-trash-empty/"), new NullProgressMonitor());
    assertEquals(3, 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 19 with NullProgressMonitor

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

the class AssetCategoriesNavigationTagsTest 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/asset-categories-navigation/"), new NullProgressMonitor());
    assertEquals(1, problems.size());
    boolean found = false;
    for (Problem problem : problems) {
        if (problem.file.getName().endsWith("AssetCategoriesNavigationTagsTest.jsp")) {
            if (problem.lineNumber == 48 && problem.startOffset >= 1530 && problem.endOffset >= 1616) {
                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 20 with NullProgressMonitor

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

the class AssetPreviewTagsTest 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/asset-preview/"), new NullProgressMonitor());
    assertEquals(1, problems.size());
    boolean found = false;
    for (Problem problem : problems) {
        if (problem.file.getName().endsWith("AssetPreviewTest.jsp") && problem.lineNumber == 7 && problem.startOffset >= 230 && problem.endOffset >= 310) {
            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