Android Open Source - CucumberAndroidGradle Android Formatter






From Project

Back to project page CucumberAndroidGradle.

License

The source code is released under:

Apache License

If you think the Android project CucumberAndroidGradle listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package cucumber.runtime.android;
//w  w  w  . ja v a  2s .  c  o m
import android.util.Log;
import gherkin.formatter.Formatter;
import gherkin.formatter.model.*;

import java.util.List;

public class AndroidFormatter implements Formatter {
    private final String mLogtag;
    private String mUri;

    public AndroidFormatter(String logtag) {
        mLogtag = logtag;
    }

    @Override
    public void uri(String uri) {
        mUri = uri;
    }

    @Override
    public void feature(Feature feature) {
        Log.d(mLogtag, String.format("%s: %s (%s)%n%s", feature.getKeyword(), feature.getName(), mUri, feature.getDescription()));
    }

    @Override
    public void background(Background background) {
        Log.d(mLogtag, background.getName());
    }

    @Override
    public void scenario(Scenario scenario) {
        Log.d(mLogtag, String.format("%s: %s", scenario.getKeyword(), scenario.getName()));
    }

    @Override
    public void scenarioOutline(ScenarioOutline scenarioOutline) {
        Log.d(mLogtag, String.format("%s: %s", scenarioOutline.getKeyword(), scenarioOutline.getName()));
    }

    @Override
    public void examples(Examples examples) {
        Log.d(mLogtag, String.format("%s: %s", examples.getKeyword(), examples.getName()));
    }

    @Override
    public void step(Step step) {
        Log.d(mLogtag, String.format("%s%s", step.getKeyword(), step.getName()));
    }

    @Override
    public void syntaxError(String state, String event, List<String> legalEvents, String uri, Integer line) {
        Log.e(mLogtag, String.format("syntax error '%s' %s:%d", event, uri, line));
    }

    @Override
    public void eof() {
    }

    @Override
    public void done() {
    }

    @Override
    public void close() {
    }
}




Java Source Code List

com.example.cucumberandroid.MainActivity.java
cucumber.api.android.CucumberInstrumentationTestRunner.java
cucumber.api.android.CucumberInstrumentation.java
cucumber.api.android.RunWithCucumber.java
cucumber.runtime.android.AndroidBackend.java
cucumber.runtime.android.AndroidClasspathMethodScanner.java
cucumber.runtime.android.AndroidFormatter.java
cucumber.runtime.android.AndroidJavaStepDefinition.java
cucumber.runtime.android.AndroidMethodFormat.java
cucumber.runtime.android.AndroidObjectFactory.java
cucumber.runtime.android.AndroidResourceLoader.java
cucumber.runtime.android.AndroidResource.java
cucumber.runtime.android.JavaHookDefinition.java
cucumber.runtime.android.JavaSnippet.java
ext.com.android.internal.os.LoggingPrintStream.java
ext.com.google.android.collect.Maps.java
ext.com.google.android.collect.Sets.java