| Chunk |
|---|
| Conflicting content |
|---|
@Test
public void run() {
<<<<<<< HEAD
GuiceAnnotationBuilder builder = new GuiceAnnotationBuilder(this.getClass());
embedder.useConfiguration(builder.buildConfiguration());
embedder.useCandidateSteps(builder.buildCandidateSteps());
=======
embedder.useConfiguration(new GuiceAnnotationBuilder(this.getClass()).buildConfiguration());
embedder.useCandidateSteps(new GuiceAnnotationBuilder(this.getClass()).buildCandidateSteps());
>>>>>>> 91dbf23a55644ca2d65c7569353610b0d7f0041d
embedder.embedderControls().doIgnoreFailureInStories(true).doIgnoreFailureInView(true);
embedder.runStoriesAsPaths(new StoryFinder().findPaths(codeLocationFromClass(this.getClass()).getFile(),
asList("**/stories/*.story"), asList(""))); |
| Solution content |
|---|
@Test
public void run() {
AnnotationBuilder builder = new GuiceAnnotationBuilder(this.getClass());
Embedder embedder = builder.buildEmbedder();
embedder.embedderControls().doIgnoreFailureInStories(true).doIgnoreFailureInView(true);
embedder.runStoriesAsPaths(new StoryFinder().findPaths(codeLocationFromClass(this.getClass()).getFile(),
asList("**/stories/*.story"), asList(""))); |
| File |
|---|
| AnnotatedEmbedderUsingGuice.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
this.finder = new AnnotationFinder(annotatedClass);
}
<<<<<<< HEAD
public Class> annotatedClass() {
return annotatedClass;
}
=======
public Class> annotatedClass(){
return annotatedClass;
}
>>>>>>> 91dbf23a55644ca2d65c7569353610b0d7f0041d
/**
* Builds Configuration instance based on annotation {@link Configure} found
* in the annotated object instance |
| Solution content |
|---|
this.finder = new AnnotationFinder(annotatedClass);
}
public Class> annotatedClass() {
return annotatedClass;
}
/**
* Builds Configuration instance based on annotation {@link Configure} found
* in the annotated object instance |
| File |
|---|
| AnnotationBuilder.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method declaration |
| Chunk |
|---|
| Conflicting content |
|---|
@SuppressWarnings("rawtypes")
public Configuration buildConfiguration() throws MissingAnnotationException {
<<<<<<< HEAD
AnnotationFinder finder = annotationFinder();
=======
AnnotationFinder finder = getFinder();
>>>>>>> 91dbf23a55644ca2d65c7569353610b0d7f0041d
if (finder.isAnnotationPresent(UsingGuice.class)) {
List |
| Solution content |
|---|
@SuppressWarnings("rawtypes")
public Configuration buildConfiguration() throws MissingAnnotationException {
AnnotationFinder finder = annotationFinder();
if (finder.isAnnotationPresent(UsingGuice.class)) {
List |
| File |
|---|
| GuiceAnnotationBuilder.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
try {
modules.add(moduleClass.newInstance());
} catch (Exception e) {
<<<<<<< HEAD
annotationMonitor().elementCreationFailed(moduleClass, e);
=======
getAnnotationMonitor().elementCreationFailed(moduleClass, e);
>>>>>>> 91dbf23a55644ca2d65c7569353610b0d7f0041d
}
}
// creating injector with any modules found |
| Solution content |
|---|
try {
modules.add(moduleClass.newInstance());
} catch (Exception e) {
annotationMonitor().elementCreationFailed(moduleClass, e);
}
}
// creating injector with any modules found |
| File |
|---|
| GuiceAnnotationBuilder.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
injector = Guice.createInjector(Modules.combine(modules));
}
} else {
<<<<<<< HEAD
annotationMonitor().annotationNotFound(UsingGuice.class, annotatedClass());
=======
getAnnotationMonitor().annotationNotFound(UsingGuice.class, getAnnotatedClass());
>>>>>>> 91dbf23a55644ca2d65c7569353610b0d7f0041d
}
return super.buildConfiguration();
} |
| Solution content |
|---|
injector = Guice.createInjector(Modules.combine(modules));
}
} else {
annotationMonitor().annotationNotFound(UsingGuice.class, annotatedClass());
}
return super.buildConfiguration();
} |
| File |
|---|
| GuiceAnnotationBuilder.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
// TODO **** REMOVE when javax.inject is supported by Guice 2.1
embedder.useConfiguration(configuration);
embedder.useCandidateSteps(candidateSteps);
<<<<<<< HEAD
// TODO ****
embedder.useEmbedderControls(buildEmbedderControls());
return injector.getInstance(annotatedClass());
}
=======
// TODO ****
AnnotationFinder finder = getFinder();
if (finder.isAnnotationPresent(UsingControls.class)) {
boolean batch = control(finder, "batch");
boolean skip = control(finder, "skip");
boolean generateViewAfterStories = control(finder, "generateViewAfterStories");
boolean ignoreFailureInStories = control(finder, "ignoreFailureInStories");
boolean ignoreFailureInView = control(finder, "ignoreFailureInView");
embedder.embedderControls().doBatch(batch).doSkip(skip)
.doGenerateViewAfterStories(generateViewAfterStories)
.doIgnoreFailureInStories(ignoreFailureInStories)
.doIgnoreFailureInView(ignoreFailureInView);
}
return injector.getInstance(annotatedClass());
}
private boolean control(AnnotationFinder finder, String name) {
return finder.getAnnotatedValue(UsingControls.class, Boolean.class, name);
}
>>>>>>> 91dbf23a55644ca2d65c7569353610b0d7f0041d
} |
| Solution content |
|---|
package org.jbehave.core.configuration.guice;
import java.util.ArrayList;
import java.util.List;
import org.jbehave.core.annotations.guice.UsingGuice;
import org.jbehave.core.configuration.AnnotationBuilder;
import org.jbehave.core.configuration.AnnotationFinder;
import org.jbehave.core.configuration.AnnotationMonitor;
import org.jbehave.core.configuration.Configuration;
import org.jbehave.core.configuration.MissingAnnotationException;
import org.jbehave.core.steps.CandidateSteps;
import org.jbehave.core.steps.InjectableStepsFactory;
import org.jbehave.core.steps.InstanceStepsFactory;
import org.jbehave.core.steps.ParameterConverters;
import org.jbehave.core.steps.ParameterConverters.ParameterConverter;
import org.jbehave.core.steps.guice.GuiceStepsFactory;
import com.google.inject.Binding;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Module;
import com.google.inject.TypeLiteral;
import com.google.inject.util.Modules;
public class GuiceAnnotationBuilder extends AnnotationBuilder {
public Injector injector;
public GuiceAnnotationBuilder(Class> annotatedClass) {
super(annotatedClass);
}
public GuiceAnnotationBuilder(Class> annotatedClass, AnnotationMonitor annotationMonitor) {
super(annotatedClass, annotationMonitor);
}
@SuppressWarnings("rawtypes")
public Configuration buildConfiguration() throws MissingAnnotationException {
AnnotationFinder finder = annotationFinder();
if (finder.isAnnotationPresent(UsingGuice.class)) {
List |
| File |
|---|
| GuiceAnnotationBuilder.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Comment |
| If statement |
| Method declaration |
| Method invocation |
| Return statement |
| Variable |