Skip to content

Commit

Permalink
test suite (#7072)
Browse files Browse the repository at this point in the history
  • Loading branch information
pethers authored Jan 22, 2025
1 parent 3e4c660 commit 94a23a2
Show file tree
Hide file tree
Showing 6 changed files with 878 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,11 @@
*/
package com.hack23.cia.systemintegrationtest;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;

import com.hack23.cia.testfoundation.AbstractSystemIntegrationTest;

import io.github.bonigarcia.wdm.WebDriverManager;
import io.github.bonigarcia.wdm.config.DriverManagerType;

/**
* The Class AbstractRoleSystemITest.
*/
Expand All @@ -36,53 +31,5 @@ public abstract class AbstractRoleSystemITest extends AbstractSystemIntegrationT


/** The Constant usingExternalServer. */
protected static final boolean usingExternalServer;

/** The webdriver setup. */
private static boolean webdriverSetup = false;

/** The Constant webDriverMap. */
static {
final String systemTestTargetUrlProperty = System.getProperty("system.test.target.url");
if (systemTestTargetUrlProperty != null && systemTestTargetUrlProperty.isEmpty()) {
usingExternalServer = true;
} else {
usingExternalServer = false;
}



CitizenIntelligenceAgencyServer.setEnv("CIA_APP_ENCRYPTION_PASSWORD", "allhaildiscordia");
}

/**
* Start server.
*
* @throws Exception
* the exception
*/
@BeforeClass
public static final synchronized void startServer() throws Exception {
if (!usingExternalServer) {
CitizenIntelligenceAgencyServer.startTestServer();
}
if(!webdriverSetup) {
WebDriverManager.getInstance(DriverManagerType.CHROME).setup();
webdriverSetup=true;
}
}

/**
* Stop server.
*
* @throws Exception
* the exception
*/
@AfterClass
public static final synchronized void stopServer() throws Exception {
if (!usingExternalServer) {
CitizenIntelligenceAgencyServer.stopTestServer();
}
}

}
Original file line number Diff line number Diff line change
@@ -1,24 +1,82 @@
package com.hack23.cia.systemintegrationtest.suites;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;

import com.hack23.cia.systemintegrationtest.CitizenIntelligenceAgencyServer;
import com.hack23.cia.systemintegrationtest.admin.configuration.AdminConfigurationTest;
import com.hack23.cia.systemintegrationtest.admin.data.AdminDataTest;
import com.hack23.cia.systemintegrationtest.admin.operations.AdminOperationsTest;
import com.hack23.cia.systemintegrationtest.admin.security.AdminSecurityTest;
import com.hack23.cia.systemintegrationtest.user.home.UserHomeTest;

import io.github.bonigarcia.wdm.WebDriverManager;
import io.github.bonigarcia.wdm.config.DriverManagerType;

/**
* The Class IntegrationTestSuite.
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
// Admin Tests only - remove other test references that don't exist
AdminConfigurationTest.class,
AdminDataTest.class,
AdminOperationsTest.class,
AdminSecurityTest.class
AdminSecurityTest.class,
UserHomeTest.class
})
public class IntegrationTestSuite {
// Empty test suite

protected static final boolean usingExternalServer;

/** The webdriver setup. */
private static boolean webdriverSetup = false;

/** The Constant webDriverMap. */
static {
final String systemTestTargetUrlProperty = System.getProperty("system.test.target.url");
if (systemTestTargetUrlProperty != null && systemTestTargetUrlProperty.isEmpty()) {
usingExternalServer = true;
} else {
usingExternalServer = false;
}



CitizenIntelligenceAgencyServer.setEnv("CIA_APP_ENCRYPTION_PASSWORD", "allhaildiscordia");
}

/**
* Start server.
*
* @throws Exception
* the exception
*/
@BeforeClass
public static final synchronized void startServer() throws Exception {
if (!usingExternalServer) {
CitizenIntelligenceAgencyServer.startTestServer();
}
if(!webdriverSetup) {
WebDriverManager.getInstance(DriverManagerType.CHROME).setup();
webdriverSetup=true;
}
}

/**
* Stop server.
*
* @throws Exception
* the exception
*/
@AfterClass
public static final synchronized void stopServer() throws Exception {
if (!usingExternalServer) {
CitizenIntelligenceAgencyServer.stopTestServer();
}
}



}
12 changes: 6 additions & 6 deletions citizen-intelligence-agency/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@
<logger name="atomikos" level="error" />
<logger name="com.atomikos" level="error" />

<logger name="org.eclipse" level="error" />
<logger name="org.eclipse" level="warn" />

<logger name="org.springframework" level="error" />
<logger name="org.springframework.web" level="error" />
<logger name="org.springframework" level="info" />
<logger name="org.springframework.web" level="info" />
<logger name="org.springframework.oxm.jaxb" level="error" />

<logger name="org.springframework.security" level="error" />
<logger name="org.springframework.security" level="warn" />

<logger name="org.apache.activemq.artemis" level="error" />
<logger name="org.apache.activemq.artemis" level="warn" />

<logger name="ch.qos.logback.core" level="warn" />


<logger name="com.hack23.cia" level="error" />
<logger name="com.hack23.cia" level="info" />
<logger name="com.hack23.cia.systemintegrationtest" level="info" />


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;

Expand All @@ -59,10 +61,11 @@
/**
* The Class DocumentContainerElement.
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "dokumentlista")
@XmlType(name = "DocumentContainerElement", propOrder = {
"dokument"
})
@XmlAccessorType(XmlAccessType.FIELD)
@Entity(name = "DocumentContainerElement")
@Table(name = "DOCUMENT_CONTAINER_ELEMENT")
@Inheritance(strategy = InheritanceType.JOINED)
Expand All @@ -76,8 +79,8 @@ public class DocumentContainerElement
private static final long serialVersionUID = 1L;

/** The dokument. */
@XmlElement(required = true)
protected List<DocumentElement> dokument = new ArrayList<>();
@XmlElement(name = "dokument", required = true)
protected List<DocumentElement> dokument = new ArrayList<DocumentElement>();

/** The datum. */
@XmlAttribute(name = "datum", required = true)
Expand Down Expand Up @@ -121,7 +124,7 @@ public class DocumentContainerElement
protected String documentVersion;

/** The warning. */
@XmlAttribute(name = "warning", required = true)
@XmlAttribute(name = "varning", required = true)
protected String warning;

/** The hjid. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ public void setNoteTitle(final String value) {
* @return the note
*/
@Basic
@Column(name = "NOTE")
@Column(name = "NOTE", length = 10485760)
public String getNote() {
return note;
}
Expand All @@ -407,7 +407,7 @@ public void setNote(final String value) {
* @return the summary
*/
@Basic
@Column(name = "SUMMARY")
@Column(name = "SUMMARY",length = 10485760)
public String getSummary() {
return summary;
}
Expand Down
Loading

0 comments on commit 94a23a2

Please sign in to comment.