Skip to content

Commit

Permalink
chore: Remove deprecated code
Browse files Browse the repository at this point in the history
- Remove deprecated CitrusXmlTest annotation in favor of using CitrusTestSource annotation
- Remove SleepAction time expression setter
- Remove HtmlReporter setOutputDirectory() in favor of using setReportDirectory()
- Remove Selenium browserType setting
- Remove MessageConstructionInterceptor in favor of using org.citrusframework.message.MessageTransformer
  • Loading branch information
christophd committed Oct 24, 2023
1 parent 723b6b8 commit edb0176
Show file tree
Hide file tree
Showing 207 changed files with 615 additions and 841 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

package org.citrusframework.docker.integration;

import org.citrusframework.annotations.CitrusXmlTest;
import org.citrusframework.annotations.CitrusTestSource;
import org.citrusframework.common.TestLoader;
import org.testng.annotations.Test;

/**
Expand All @@ -28,6 +29,6 @@
@Test
public class DockerExecuteIT extends AbstractDockerIT {

@CitrusXmlTest(name = "DockerExecuteIT")
@CitrusTestSource(type = TestLoader.SPRING, name = "DockerExecuteIT")
public void dockerInfoTest() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

package org.citrusframework.kubernetes.integration;

import org.citrusframework.annotations.CitrusXmlTest;
import org.citrusframework.annotations.CitrusTestSource;
import org.citrusframework.common.TestLoader;
import org.testng.annotations.Test;

/**
Expand All @@ -28,7 +29,7 @@
@Test
public class KubernetesCreateIT extends AbstractKubernetesIT {

@CitrusXmlTest(name = "KubernetesCreateIT")
@CitrusTestSource(type = TestLoader.SPRING, name = "KubernetesCreateIT")
public void kubernetesCreateIT() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

package org.citrusframework.kubernetes.integration;

import org.citrusframework.annotations.CitrusXmlTest;
import org.citrusframework.annotations.CitrusTestSource;
import org.citrusframework.common.TestLoader;
import org.testng.annotations.Test;

/**
Expand All @@ -28,7 +29,7 @@
@Test
public class KubernetesExecuteIT extends AbstractKubernetesIT {

@CitrusXmlTest(name = "KubernetesExecuteIT")
@CitrusTestSource(type = TestLoader.SPRING, name = "KubernetesExecuteIT")
public void kubernetesExecuteIT() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

package org.citrusframework.kubernetes.integration;

import org.citrusframework.annotations.CitrusXmlTest;
import org.citrusframework.annotations.CitrusTestSource;
import org.citrusframework.common.TestLoader;
import org.testng.annotations.Test;

/**
Expand All @@ -28,7 +29,7 @@
@Test
public class KubernetesSendReceiveIT extends AbstractKubernetesIT {

@CitrusXmlTest(name = "KubernetesSendReceiveIT")
@CitrusTestSource(type = TestLoader.SPRING, name = "KubernetesSendReceiveIT")
public void kubernetesSendReceiveIT() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@
*/
String webDriver() default "";

/**
* Browser type
* @return
* @deprecated in favor of {@link #type()}
*/
@Deprecated
String browserType() default "";

/**
* Browser type
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ public SeleniumBrowser parse(SeleniumBrowserConfig annotation, ReferenceResolver
builder.type(annotation.type());
}

if (StringUtils.hasText(annotation.browserType())) {
builder.browserType(annotation.browserType());
}

if (StringUtils.hasText(annotation.webDriver())) {
builder.webDriver(referenceResolver.resolve(annotation.webDriver(), WebDriver.class));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

/**
* Bean definition parser for selenium browser instance.
*
*
* @author Tamer Erdogan, Christoph Deppisch
* @since 2.7
*/
Expand All @@ -38,7 +38,6 @@ public class SeleniumBrowserParser extends AbstractEndpointParser {
protected void parseEndpointConfiguration(BeanDefinitionBuilder endpointConfiguration, Element element, ParserContext parserContext) {
super.parseEndpointConfiguration(endpointConfiguration, element, parserContext);

BeanDefinitionParserUtils.setPropertyValue(endpointConfiguration, element.getAttribute("browser-type"), "browserType");
BeanDefinitionParserUtils.setPropertyValue(endpointConfiguration, element.getAttribute("type"), "browserType");
BeanDefinitionParserUtils.setPropertyValue(endpointConfiguration, element.getAttribute("version"), "version");
BeanDefinitionParserUtils.setPropertyValue(endpointConfiguration, element.getAttribute("start-page"), "startPageUrl");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,6 @@ protected SeleniumBrowser getEndpoint() {
return endpoint;
}

/**
* Sets the browser type.
* @param type
* @return
* @deprecated in favor of {@link #type(String)}
*/
@Deprecated
public SeleniumBrowserBuilder browserType(String type) {
return this.type(type);
}

/**
* Sets the browser type.
* @param type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
</xs:annotation>
<xs:complexType>
<xs:attribute name="id" type="xs:ID" use="required"/>
<xs:attribute name="browser-type" type="xs:string"/>
<xs:attribute name="type">
<xs:simpleType>
<xs:restriction base="xs:string">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
</xs:annotation>
<xs:complexType>
<xs:attribute name="id" type="xs:ID" use="required"/>
<xs:attribute name="browser-type" type="xs:string"/>
<xs:attribute name="type">
<xs:simpleType>
<xs:restriction base="xs:string">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public class SeleniumBrowserConfigParserTest extends AbstractTestNGUnitTest {
private SeleniumBrowser browser3;

@CitrusEndpoint
@SeleniumBrowserConfig(browserType="htmlunit")
private SeleniumBrowser browserWithDeprecatedConfig;
@SeleniumBrowserConfig(type="htmlunit")
private SeleniumBrowser browser4;

@Mock
private ReferenceResolver referenceResolver;
Expand Down Expand Up @@ -137,11 +137,11 @@ public void parseBrowserConfig_remoteBrowserConfig_shouldParseConfigurationSucce
}

@Test
public void parseBrowserConfig_browserUsingDeprecatedConfig_shouldParseConfigurationSuccessfully() {
public void parseBrowserConfig_htmlUnitBrowserConfig_shouldParseConfigurationSuccessfully() {
CitrusAnnotations.injectEndpoints(this, context);

Assert.assertNotNull(browserWithDeprecatedConfig);
Assert.assertEquals(browserWithDeprecatedConfig.getEndpointConfiguration().getBrowserType(), Browser.HTMLUNIT.browserName());
Assert.assertNotNull(browser4);
Assert.assertEquals(browser4.getEndpointConfiguration().getBrowserType(), Browser.HTMLUNIT.browserName());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void parseBrowserConfig_multipleBrowsersConfigured_shouldDetectAllBrowser
public void parseBrowserConfig_htmlUnitBrowserConfigured_shouldParseConfigurationSuccessfully() {
Map<String, SeleniumBrowser> browsers = beanDefinitionContext.getBeansOfType(SeleniumBrowser.class);

SeleniumBrowser browser = browsers.get("htmlUnitBrowser");
SeleniumBrowser browser = browsers.get("defaultBrowser");
Assert.assertEquals(browser.getEndpointConfiguration().getBrowserType(), Browser.HTMLUNIT.browserName());
Assert.assertNull(browser.getEndpointConfiguration().getStartPageUrl());
Assert.assertTrue(browser.getEndpointConfiguration().getEventListeners().isEmpty());
Expand Down Expand Up @@ -81,7 +81,7 @@ public void parseBrowserConfig_remoteBrowserConfigured_shouldParseConfigurationS
public void parseBrowserConfig_browserUsingDeprecatedConfig_shouldParseConfigurationSuccessfully() {
Map<String, SeleniumBrowser> browsers = beanDefinitionContext.getBeansOfType(SeleniumBrowser.class);

SeleniumBrowser browser = browsers.get("browserUsingDeprecatedConfiguration");
SeleniumBrowser browser = browsers.get("htmlUnitBrowser");
Assert.assertEquals(browser.getEndpointConfiguration().getBrowserType(), Browser.HTMLUNIT.browserName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

package org.citrusframework.selenium.integration;

import org.citrusframework.annotations.CitrusXmlTest;
import org.citrusframework.annotations.CitrusTestSource;
import org.citrusframework.common.TestLoader;
import org.citrusframework.testng.spring.TestNGCitrusSpringSupport;
import org.testng.annotations.Test;

Expand All @@ -27,7 +28,7 @@
public class SeleniumIT extends TestNGCitrusSpringSupport {

@Test
@CitrusXmlTest
@CitrusTestSource(type = TestLoader.SPRING)
public void SeleniumIT() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.citrusframework.org/schema/selenium/config http://www.citrusframework.org/schema/selenium/config/citrus-selenium-config.xsd">

<citrus-selenium:browser id="htmlUnitBrowser"/>
<citrus-selenium:browser id="defaultBrowser"/>

<citrus-selenium:browser id="firefoxBrowser"
type="firefox"
Expand All @@ -23,8 +23,8 @@
type="internet explorer"
remote-server="http://localhost:9090/selenium"/>

<citrus-selenium:browser id="browserUsingDeprecatedConfiguration"
browser-type="htmlunit"/>
<citrus-selenium:browser id="htmlUnitBrowser"
type="htmlunit"/>

<util:list id="eventListeners">
<ref bean="eventListener"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

package org.citrusframework.integration.actions;

import org.citrusframework.annotations.CitrusXmlTest;
import org.citrusframework.annotations.CitrusTestSource;
import org.citrusframework.common.TestLoader;
import org.citrusframework.testng.spring.TestNGCitrusSpringSupport;
import org.testng.annotations.Test;

Expand All @@ -26,6 +27,6 @@
*/
public class ExecutePLSQLIT extends TestNGCitrusSpringSupport {
@Test
@CitrusXmlTest
@CitrusTestSource(type = TestLoader.SPRING)
public void ExecutePLSQLIT() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

package org.citrusframework.integration.actions;

import org.citrusframework.annotations.CitrusXmlTest;
import org.citrusframework.annotations.CitrusTestSource;
import org.citrusframework.common.TestLoader;
import org.citrusframework.testng.spring.TestNGCitrusSpringSupport;
import org.testng.annotations.Test;

Expand All @@ -26,6 +27,6 @@
*/
public class ExecuteSQLIT extends TestNGCitrusSpringSupport {
@Test
@CitrusXmlTest
@CitrusTestSource(type = TestLoader.SPRING)
public void ExecuteSQLIT() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

package org.citrusframework.integration.actions;

import org.citrusframework.annotations.CitrusXmlTest;
import org.citrusframework.annotations.CitrusTestSource;
import org.citrusframework.common.TestLoader;
import org.citrusframework.testng.spring.TestNGCitrusSpringSupport;
import org.testng.annotations.Test;

Expand All @@ -26,6 +27,6 @@
*/
public class ExecuteSQLTransactionIT extends TestNGCitrusSpringSupport {
@Test
@CitrusXmlTest
@CitrusTestSource(type = TestLoader.SPRING)
public void ExecuteSQLTransactionIT() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

package org.citrusframework.integration.actions;

import org.citrusframework.annotations.CitrusXmlTest;
import org.citrusframework.annotations.CitrusTestSource;
import org.citrusframework.common.TestLoader;
import org.citrusframework.testng.spring.TestNGCitrusSpringSupport;
import org.testng.annotations.Test;

Expand All @@ -26,6 +27,6 @@
*/
public class FinallyBlockIT extends TestNGCitrusSpringSupport {
@Test
@CitrusXmlTest
@CitrusTestSource(type = TestLoader.SPRING)
public void FinallyBlockIT() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

package org.citrusframework.integration.actions;

import org.citrusframework.annotations.CitrusXmlTest;
import org.citrusframework.annotations.CitrusTestSource;
import org.citrusframework.common.TestLoader;
import org.citrusframework.testng.spring.TestNGCitrusSpringSupport;
import org.testng.annotations.Test;

Expand All @@ -26,6 +27,6 @@
*/
public class QueryDatabaseRetriesIT extends TestNGCitrusSpringSupport {
@Test
@CitrusXmlTest
@CitrusTestSource(type = TestLoader.SPRING)
public void QueryDatabaseRetriesIT() {}
}

This file was deleted.

Loading

0 comments on commit edb0176

Please sign in to comment.