Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Oct 5, 2023
2 parents 39f8dbc + a6d4c80 commit 582d946
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 6 deletions.
1 change: 1 addition & 0 deletions gui/admin-gui/src/frontend/scss/wicket.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ div.wicket-aa-container {
padding: $input-padding-y $input-padding-x;
margin: 1px;
text-align: left;
display: inline-block;

ul {
list-style: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ public class ImportRepositoryTest extends NinjaSpringTest {

private static final String PATH_MONKEY_ISLAND_SIMPLE_ZIP = "./target/org-monkey-island-simple.zip";

@BeforeClass
@BeforeClass(
dependsOnMethods = {"springTestContextPrepareTestInstance"}
)
@Override
public void beforeClass() throws Exception {
RepositoryDiag diag = repository.getRepositoryDiag();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright (C) 2010-2023 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/

package com.evolveum.midpoint.ninja;

import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;

import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;

@ContextConfiguration(locations = "classpath:ctx-ninja-test.xml")
@DirtiesContext
@Listeners({ com.evolveum.midpoint.tools.testng.AlphabeticalMethodInterceptor.class })
public class JenkinsTest extends NinjaSpringTest {

private static final Trace LOGGER = TraceManager.getTrace(JenkinsTest.class);

@BeforeClass(alwaysRun = true, dependsOnMethods = "springTestContextBeforeTestClass")
protected void springTestContextPrepareTestInstance() throws Exception {
LOGGER.info("springTestContextPrepareTestInstance started");
super.springTestContextPrepareTestInstance();
LOGGER.info("springTestContextPrepareTestInstance finished");
}

@BeforeClass
@Override
public void beforeClass() throws Exception {
LOGGER.info("beforeClass started");
super.beforeClass();
LOGGER.info("beforeClass finished");
}

@BeforeClass

@Test
public void emptyTest() throws Exception {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

import javax.sql.DataSource;

import com.evolveum.midpoint.prism.PrismContext;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.testng.annotations.BeforeClass;

import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.util.PrismTestUtil;
import com.evolveum.midpoint.repo.api.RepositoryService;
import com.evolveum.midpoint.schema.MidPointPrismContextFactory;
Expand All @@ -33,9 +32,15 @@ public abstract class NinjaSpringTest extends AbstractSpringTest implements Infr
@Autowired
protected PrismContext prismContext;

@BeforeClass
@BeforeClass(alwaysRun = true)
public void beforeClass() throws Exception {
setupMidpointHome();
}

@BeforeClass(alwaysRun = true, dependsOnMethods = { "springTestContextBeforeTestClass" })
@Override
protected void springTestContextPrepareTestInstance() throws Exception {
super.springTestContextPrepareTestInstance();

clearMidpointTestDatabase(applicationContext);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import com.evolveum.midpoint.util.ClassPathUtil;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.assertj.core.api.Assertions;
Expand Down Expand Up @@ -65,7 +66,7 @@ interface StreamValidator {
* This is not enough to support tests on other DB (it doesn't run dbtest profile properly)
* or for Native repository, but {@link #clearMidpointTestDatabase(ApplicationContext)} can be used in the preExecute block.
*/
default void setupMidpointHome() {
default void setupMidpointHome() throws IOException {
// This tells Ninja to use the right config XML for Native repo.
// Ninja tests don't support test.config.file property as other midPoint tests.
String testConfigFile = System.getProperty("test.config.file");
Expand All @@ -75,6 +76,7 @@ default void setupMidpointHome() {
String mpHome = System.getProperty(MidpointConfiguration.MIDPOINT_HOME_PROPERTY);
File config = new File(mpHome, testConfigFile);
if (!config.exists()) {
FileUtils.forceMkdirParent(config);
ClassPathUtil.extractFileFromClassPath(testConfigFile, config.getPath());
}
}
Expand Down
2 changes: 1 addition & 1 deletion tools/ninja/testng-unit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<classes>
<class name="com.evolveum.midpoint.ninja.HelpVersionTest"/>
<class name="com.evolveum.midpoint.ninja.ListKeysTest"/>
<class name="com.evolveum.midpoint.ninja.ImportRepositoryTest"/>
<class name="com.evolveum.midpoint.ninja.JenkinsTest"/>
<!--<class name="com.evolveum.midpoint.ninja.VerifyUpgradeTest"/>-->
<!--<class name="com.evolveum.midpoint.ninja.PreUpgradeCheckTest"/>-->
</classes>
Expand Down

0 comments on commit 582d946

Please sign in to comment.