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

Commit

Permalink
#153 fix for listener
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaihuludus committed Aug 1, 2018
1 parent 0ec9867 commit 03cc86b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
34 changes: 34 additions & 0 deletions bb-core/src/main/java/com/cognifide/qa/bb/RunWithJunit5.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*-
* #%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%
*/
package com.cognifide.qa.bb;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Inherited
public @interface RunWithJunit5 {


}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
package com.cognifide.qa.bb.loadable.mapper;

import com.cognifide.qa.bb.RunWithJunit5;
import com.google.inject.TypeLiteral;
import com.google.inject.spi.TypeEncounter;
import com.google.inject.spi.TypeListener;
Expand Down Expand Up @@ -40,7 +41,7 @@ public <I> void hear(TypeLiteral<I> type, TypeEncounter<I> encounter) {

private <I> boolean isApplicable(Class<? super I> rawType) {
boolean result;
if (rawType.isAnnotationPresent(RunWith.class)
if ( (rawType.isAnnotationPresent(RunWith.class) || rawType.isAnnotationPresent(RunWithJunit5.class))
&& !rawType.isAnnotationPresent(CucumberOptions.class)) {
result = true;
} else {
Expand Down

0 comments on commit 03cc86b

Please sign in to comment.