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:
Paul Brodner
2019-03-28 12:53:13 +00:00
2 changed files with 62 additions and 1 deletions

View File

@@ -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);
}
}

View File

@@ -31,4 +31,11 @@ jmx.useJolokiaAgent=false
# The location of the reports path
reports.path=./target/reports
serverHealth.showTenants=false
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}