Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

228 deprecation #284

Merged
merged 12 commits into from
Sep 19, 2018
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*-
* #%L
* Bobcat
* %%
* Copyright (C) 2018 Cognifide Ltd.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
/**
* Deprecated since 1.6.0, will be replaced by new AEM API
*/
@Deprecated
package com.cognifide.qa.bb.aem;

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*-
* #%L
* Bobcat
* %%
* Copyright (C) 2018 Cognifide Ltd.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
/**
* Deprecated since 1.6.0, will be replaced by new AEM API
*/
@Deprecated
package com.cognifide.qa.bb.constants;
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*-
* #%L
* Bobcat
* %%
* Copyright (C) 2018 Cognifide Ltd.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
/**
* Deprecated since 1.6.0, will be replaced by new AEM API
*/
@Deprecated
package com.cognifide.qa.bb.jcr;
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*-
* #%L
* Bobcat
* %%
* Copyright (C) 2018 Cognifide Ltd.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
/**
* Deprecated since 1.6.0, will be replaced by new AEM API
*/
@Deprecated
package com.cognifide.qa.bb.provider.jcr;
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/**
* Add this annotation to any test method which you want to rerun after failure
*/
@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface Retry {
Expand Down
5 changes: 4 additions & 1 deletion bb-core/src/main/java/com/cognifide/qa/bb/RunWithJunit5.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* @deprecated since 1.6.0, will be removed together with Loadable functionality: JUnit5 tests won't require any additional annotations going forward
*/
@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Inherited
public @interface RunWithJunit5 {


}
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@
*/
public final class ConfigStrategyProvider {

public static final String YAML_SYS_PROP_VALUE = "yaml";
public static final String LEGACY_SYS_PROP_VALUE = "yaml";

private ConfigStrategyProvider() {
//empty
}

/**
* Returns a correct implementation of {@link ConfigStrategy}.
* Returns a correct implementation of {@link ConfigStrategy}, based on {@value ConfigKeys#CONFIG_STRATEGY} System property.
* At the moment two types can be provided:
* <ul>
* <li>{@link LegacyConfig} is served by default</li>
* <li>{@link YamlConfig} is served when {@code bobcat.config} system property is set to {@code yaml}</li>
* <li>{@link YamlConfig} is served by default</li>
* <li>{@link LegacyConfig} is served when {@code bobcat.config} system property is set to {@code legacy}</li>
* </ul>
*
* @return proper implementation of {@link ConfigStrategy}
*/
public static ConfigStrategy get() {
return YAML_SYS_PROP_VALUE.equals(System.getProperty(ConfigKeys.CONFIG_STRATEGY)) ?
new YamlConfig() :
new LegacyConfig();
return LEGACY_SYS_PROP_VALUE.equals(System.getProperty(ConfigKeys.CONFIG_STRATEGY)) ?
new LegacyConfig() :
new YamlConfig();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
/**
* This is the old, legacy way of loading properties in Bobcat based on sets of .properties files.
* This strategy is loaded by default at the moment, in 2.0 release, Bobcat will switch over to {@link YamlConfig}.
*
* @deprecated please use the new {@link YamlConfig}.
*/
@Deprecated
public class LegacyConfig implements ConfigStrategy {
private static final Logger LOG = LoggerFactory.getLogger(LegacyConfig.class);
public static final String DEFAULT_CONFIGURATION_PATH = "src/main/config";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ private PropertyBinder() {
*
* @param binder The Binder instance that will store the newly created property bindings.
*/
public static void bindProperties(Binder binder) {
ConfigStrategy strategy = ConfigStrategyProvider.get();
Properties properties = strategy.gatherProperties();
public static void bindProperties(Binder binder, ConfigStrategy configStrategy) {
Properties properties = configStrategy.gatherProperties();
Names.bindProperties(binder, properties);
binder.bind(Properties.class).toInstance(properties);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
*/
package com.cognifide.qa.bb.modules;

import com.cognifide.qa.bb.config.PropertyBinder;
import com.cognifide.qa.bb.SystemType;
import com.cognifide.qa.bb.config.ConfigStrategy;
import com.cognifide.qa.bb.config.ConfigStrategyProvider;
import com.cognifide.qa.bb.config.PropertyBinder;
import com.google.inject.AbstractModule;

/**
Expand All @@ -29,7 +31,8 @@
public class PropertyModule extends AbstractModule {
@Override
protected void configure() {
PropertyBinder.bindProperties(binder());
ConfigStrategy strategy = ConfigStrategyProvider.get();
PropertyBinder.bindProperties(binder(), strategy);
bind(SystemType.class).toInstance(SystemType.current());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
*/
package com.cognifide.qa.bb.reporter;

/**
* @deprecated since 1.6.0, we are moving towards using external reporting engine, Allure with JUnit5
*/
@Deprecated
public interface Reporter {

void generateReport();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ public class ConfigStrategyProviderTest {
public SystemPropertiesCleanupRule sysPropCleanup = new SystemPropertiesCleanupRule();

@Test
public void get_returnsLegacyConfig_byDefault() {
public void get_returnsYamlConfig_byDefault() {
assumeTrue(StringUtils.isBlank(System.getProperty(ConfigKeys.CONFIG_STRATEGY)));
ConfigStrategy configStrategy = ConfigStrategyProvider.get();
assertThat(configStrategy).isInstanceOf(LegacyConfig.class);
assertThat(configStrategy).isInstanceOf(YamlConfig.class);
}

@Test
public void get_returnsYamlConfig_whenBobcatConfigSysPropIsSetToYaml() {
System.setProperty(ConfigKeys.CONFIG_STRATEGY, ConfigStrategyProvider.YAML_SYS_PROP_VALUE);
public void get_returnsLegacyConfig_whenBobcatConfigSysPropIsSetToYaml() {
System.setProperty(ConfigKeys.CONFIG_STRATEGY, ConfigStrategyProvider.LEGACY_SYS_PROP_VALUE);
ConfigStrategy configStrategy = ConfigStrategyProvider.get();
assertThat(configStrategy).isInstanceOf(YamlConfig.class);
assertThat(configStrategy).isInstanceOf(LegacyConfig.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*-
* #%L
* Bobcat
* %%
* Copyright (C) 2018 Cognifide Ltd.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
/**
* Deprecated - we recommend using SoftAssertions from AssertJ
*/
@Deprecated
package com.cognifide.qa.bb.assertions.soft;

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*-
* #%L
* Bobcat
* %%
* Copyright (C) 2018 Cognifide Ltd.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
/**
* Deprecated since 1.6.0 - we're removing internal support for reruns
*
*/
@Deprecated
package com.cognifide.qa.bb.cumber.rerun;

Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public void additionalNestedContextsShouldBeLoadedWhenSelectedInConfig() {
}

private Injector getInjector() {
System.setProperty("bobcat.config", "yaml");
return Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
Expand Down
46 changes: 29 additions & 17 deletions bb-integration-tests/src/test/resources/config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
default:
contexts: [firefox, additional-context1, additional-context4]
properties:
bobcat.report.path: ./target/report
bobcat.report.reporters: html,json,simple,stdout
webdriver.type: firefox
webdriver.defaultTimeout: 10
webdriver.mobile: false
webdriver.maximize: false
webdriver.reusable: false

proxy.enabled: false
proxy.ip: 127.0.0.1
proxy.port: 9000

contexts:
firefox:
webdriver.type: firefox
grid:
webdriver.type: remote
webdriver.url: http://localhost:4444/wd/hub
grid-chrome:
webdriver.cap.browserName: chrome
local:
author.url: http://localhost:4502
author.ip: http://127.0.0.1:4502
author.login: admin
author.password: admin
login.token.name: login-token
firefox:
webdriver.type: firefox
grid:
webdriver.type: remote
webdriver.url: http://localhost:4444/wd/hub
grid-chrome:
webdriver.cap.browserName: chrome
local:
author.url: http://localhost:4502
author.ip: http://127.0.0.1:4502
author.login: admin
author.password: admin
login.token.name: login-token

publish.url: http://localhost:4503
publish.ip: http://127.0.0.1:4503
publish.login: admin
publish.password: admin
publish.url: http://localhost:4503
publish.ip: http://127.0.0.1:4503
publish.login: admin
publish.password: admin
24 changes: 24 additions & 0 deletions bb-junit/src/main/java/com/cognifide/qa/bb/junit/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*-
* #%L
* Bobcat
* %%
* Copyright (C) 2018 Cognifide Ltd.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
/**
* Deprecated, this module will be removed after 2.0.0. Use Junit5 and Allure going onwards.
*/
@Deprecated
package com.cognifide.qa.bb.junit;
Loading