mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-10-08 14:51:20 +00:00
Merge branch 'feature/search-1128' into 'master'
search-1128: starting InsighEngine with SSL enabled See merge request search_discovery/SearchAnalyticsE2ETest!32
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
package org.alfresco.service.search.e2e.insightEngine.jdbc;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.utility.network.ServerHealth;
|
||||
import org.alfresco.utility.network.db.DatabaseOperationImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
|
||||
import static org.testng.Assert.*;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* This class is connecting via JDBC Driver (see default.properties)
|
||||
*
|
||||
* example:
|
||||
* db.url= jdbc:alfresco://${alfresco.server}:${alfresco.port}?collection=alfresco
|
||||
*
|
||||
* I am using the TAS DatabaseOperationImpl service to connect
|
||||
*
|
||||
* @author Paul Brodner
|
||||
*
|
||||
*/
|
||||
@ContextConfiguration("classpath:alfresco-search-e2e-context.xml")
|
||||
public class JDBCDriverTest extends AbstractTestNGSpringContextTests {
|
||||
|
||||
@Autowired
|
||||
protected ServerHealth serverHealth;
|
||||
|
||||
@Autowired
|
||||
DatabaseOperationImpl jdbcOperation;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void checkServerHealth() throws Exception {
|
||||
serverHealth.assertServerIsOnline();
|
||||
}
|
||||
|
||||
/**
|
||||
* In order to work start ACS + InsightEngine service
|
||||
* @throws SQLException
|
||||
*/
|
||||
@Test
|
||||
public void iCanConnectWithJDBCDriver() throws SQLException {
|
||||
assertTrue(jdbcOperation.connect(), "I can connect via JDBC Driver");
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods="iCanConnectWithJDBCDriver")
|
||||
public void iCanQueryTheTotalNumberOfDocumentsFromAlfresco() {
|
||||
List<Object> results = jdbcOperation.executeQuery("select cm_name from alfresco where cm_Name = 'presentation*'");
|
||||
assertEquals(results.size(), 3);
|
||||
}
|
||||
}
|
@@ -32,3 +32,10 @@ jmx.useJolokiaAgent=false
|
||||
reports.path=./target/reports
|
||||
|
||||
serverHealth.showTenants=false
|
||||
|
||||
# JDBC Connection Strings
|
||||
# for SSL use alfresco.port.jdbc=7070 (see docker-compose.ssl.yml)
|
||||
alfresco.port.jdbc=${alfresco.port}
|
||||
db.url = jdbc:alfresco://${alfresco.server}:${alfresco.port.jdbc}?collection=alfresco
|
||||
db.username = ${admin.user}
|
||||
db.password = ${admin.password}
|
Reference in New Issue
Block a user