mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
replace junit with testng
This commit is contained in:
+15
-11
@@ -6,6 +6,9 @@
|
||||
*/
|
||||
package org.alfresco.service.search.e2e.searchservices.tracker;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.service.search.AbstractSearchServiceE2E;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
import org.alfresco.utility.data.DataContent;
|
||||
@@ -19,16 +22,11 @@ import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.apache.chemistry.opencmis.commons.PropertyIds;
|
||||
import org.apache.chemistry.opencmis.commons.enums.VersioningState;
|
||||
import org.junit.Assert;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.hamcrest.core.Is.is;
|
||||
|
||||
public class CascadingTrackerIntegrationTest extends AbstractSearchServiceE2E
|
||||
{
|
||||
@Autowired
|
||||
@@ -81,9 +79,12 @@ public class CascadingTrackerIntegrationTest extends AbstractSearchServiceE2E
|
||||
String parentQueryAfterRename = "NPATH:\"4/Company Home/Sites/" + testSite.getTitle() + "/documentLibrary/" + parentNewName + "\"";
|
||||
int descendantCountOfDismissedName = query(parentQuery).getPagination().getCount();
|
||||
int descendantCountOfNewName = query(parentQueryAfterRename).getPagination().getCount();
|
||||
|
||||
Assert.assertThat("New renamed path has not the same descendants as before renaming: " + parentQueryAfterRename,descendantCountOfNewName,is(initialDescendantCount));
|
||||
Assert.assertThat("Old path still has descendants: " + parentQuery,descendantCountOfDismissedName,is(0));
|
||||
|
||||
Assert.assertEquals(initialDescendantCount, descendantCountOfNewName);
|
||||
//Assert.assertThat("New renamed path has not the same descendants as before renaming: " + parentQueryAfterRename,descendantCountOfNewName,is(initialDescendantCount));
|
||||
|
||||
Assert.assertEquals(descendantCountOfDismissedName, 0);
|
||||
//Assert.assertThat("Old path still has descendants: " + parentQuery,descendantCountOfDismissedName,is(0));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.ASS_13 })
|
||||
@@ -117,8 +118,11 @@ public class CascadingTrackerIntegrationTest extends AbstractSearchServiceE2E
|
||||
int descendantCountOfDismissedName = query(parentQuery).getPagination().getCount();
|
||||
int descendantCountOfNewName = query(parentQueryAfterRename).getPagination().getCount();
|
||||
|
||||
Assert.assertThat("New renamed path has not the same descendants as before renaming: " + parentQueryAfterRename,descendantCountOfNewName,is(initialDescendantCount));
|
||||
Assert.assertThat("Old path still has descendants: " + parentQuery,descendantCountOfDismissedName,is(0));
|
||||
Assert.assertEquals(descendantCountOfNewName, initialDescendantCount);
|
||||
//Assert.assertThat("New renamed path has not the same descendants as before renaming: " + parentQueryAfterRename,descendantCountOfNewName,is(initialDescendantCount));
|
||||
|
||||
Assert.assertEquals(descendantCountOfDismissedName, 0);
|
||||
//Assert.assertThat("Old path still has descendants: " + parentQuery,descendantCountOfDismissedName,is(0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,9 +28,9 @@ import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.apache.chemistry.opencmis.commons.PropertyIds;
|
||||
import org.apache.chemistry.opencmis.commons.enums.VersioningState;
|
||||
import org.junit.Assert;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@@ -116,7 +116,7 @@ public class SetupTest extends AbstractSearchServiceE2E
|
||||
.createFile(customFile, properties, VersioningState.MAJOR)
|
||||
.assertThat().existsInRepo();
|
||||
|
||||
Assert.assertTrue("New content could not be found", waitForIndexing("cm:name:" + customFile.getName(), true));
|
||||
Assert.assertTrue(waitForIndexing("cm:name:" + customFile.getName(),true),"New content could not be found");
|
||||
}
|
||||
|
||||
// Test sql API can be used
|
||||
@@ -131,7 +131,7 @@ public class SetupTest extends AbstractSearchServiceE2E
|
||||
RestResponse response = restClient.authenticateUser(testUser).withSearchSqlAPI().searchSql(sqlRequest);
|
||||
|
||||
Assert.assertNotNull(response);
|
||||
Assert.assertTrue("Check ACS Version is 6.0 or above and if Insight Engine is running. Response received is: " + response.getStatusCode(), HttpStatus.OK.toString().matches(response.getStatusCode()));
|
||||
Assert.assertTrue(HttpStatus.OK.toString().matches(response.getStatusCode()), "Check ACS Version is 6.0 or above and if Insight Engine is running. Response received is: " + response.getStatusCode());
|
||||
}
|
||||
|
||||
// Test sql can be executed via jdbc
|
||||
|
||||
Reference in New Issue
Block a user