Search in sources :

Example 41 with Expectations

use of org.jmock.Expectations in project gradle by gradle.

the class StringJavadocOptionFileOptionTest method testWriteNoneNullValue.

@Test
public void testWriteNoneNullValue() throws IOException {
    final String testValue = "testValue";
    stringOption.setValue(testValue);
    context.checking(new Expectations() {

        {
            oneOf(writerContextMock).writeValueOption(optionName, testValue);
        }
    });
    stringOption.write(writerContextMock);
}
Also used : Expectations(org.jmock.Expectations) Test(org.junit.Test)

Example 42 with Expectations

use of org.jmock.Expectations in project gradle by gradle.

the class StandardJavadocDocletOptionsTest method testConstructor.

@Test
public void testConstructor() {
    final JavadocOptionFile optionFileMock = context.mock(JavadocOptionFile.class);
    context.checking(new Expectations() {

        {
            // core options
            oneOf(optionFileMock).addStringOption("overview");
            oneOf(optionFileMock).addEnumOption("memberLevel");
            oneOf(optionFileMock).addStringOption("doclet");
            oneOf(optionFileMock).addPathOption("docletclasspath");
            oneOf(optionFileMock).addStringOption("source");
            oneOf(optionFileMock).addPathOption("sourcepath");
            oneOf(optionFileMock).addPathOption("classpath");
            oneOf(optionFileMock).addStringsOption("subpackages", ";");
            oneOf(optionFileMock).addStringsOption("exclude", ":");
            oneOf(optionFileMock).addPathOption("bootclasspath");
            oneOf(optionFileMock).addPathOption("extdirs");
            oneOf(optionFileMock).addEnumOption("outputLevel", JavadocOutputLevel.QUIET);
            oneOf(optionFileMock).addBooleanOption("breakiterator");
            oneOf(optionFileMock).addStringOption("locale");
            oneOf(optionFileMock).addStringOption("encoding");
            // standard doclet options
            oneOf(optionFileMock).addFileOption("d");
            oneOf(optionFileMock).addBooleanOption("use");
            oneOf(optionFileMock).addBooleanOption("version");
            oneOf(optionFileMock).addBooleanOption("author");
            oneOf(optionFileMock).addBooleanOption("splitindex");
            oneOf(optionFileMock).addStringOption("windowtitle");
            oneOf(optionFileMock).addStringOption("doctitle");
            oneOf(optionFileMock).addStringOption("footer");
            oneOf(optionFileMock).addStringOption("bottom");
            oneOf(optionFileMock).addStringOption("link");
            allowing(optionFileMock).addOption(new LinksOfflineJavadocOptionFileOption("linkoffline", Lists.<JavadocOfflineLink>newArrayList()));
            oneOf(optionFileMock).addBooleanOption("linksource");
            oneOf(optionFileMock).addOption(new GroupsJavadocOptionFileOption("group", Maps.<String, List<String>>newLinkedHashMap()));
            oneOf(optionFileMock).addBooleanOption("nodeprecated");
            oneOf(optionFileMock).addBooleanOption("nodeprecatedlist");
            oneOf(optionFileMock).addBooleanOption("nosince");
            oneOf(optionFileMock).addBooleanOption("notree");
            oneOf(optionFileMock).addBooleanOption("noindex");
            oneOf(optionFileMock).addBooleanOption("nohelp");
            oneOf(optionFileMock).addBooleanOption("nonavbar");
            oneOf(optionFileMock).addFileOption("helpfile");
            oneOf(optionFileMock).addFileOption("stylesheetfile");
            oneOf(optionFileMock).addBooleanOption("serialwarn");
            oneOf(optionFileMock).addStringOption("charset");
            oneOf(optionFileMock).addStringOption("docencoding");
            oneOf(optionFileMock).addBooleanOption("keywords");
            oneOf(optionFileMock).addStringOption("tags");
            oneOf(optionFileMock).addStringOption("taglets");
            oneOf(optionFileMock).addPathOption("tagletpath");
            oneOf(optionFileMock).addBooleanOption("docfilessubdirs");
            oneOf(optionFileMock).addStringsOption("excludedocfilessubdir", ":");
            oneOf(optionFileMock).addStringsOption("noqualifier", ":");
            oneOf(optionFileMock).addBooleanOption("notimestamp");
            oneOf(optionFileMock).addBooleanOption("nocomment");
        }
    });
    options = new StandardJavadocDocletOptions();
}
Also used : Expectations(org.jmock.Expectations) LinksOfflineJavadocOptionFileOption(org.gradle.external.javadoc.internal.LinksOfflineJavadocOptionFileOption) JavadocOptionFile(org.gradle.external.javadoc.internal.JavadocOptionFile) GroupsJavadocOptionFileOption(org.gradle.external.javadoc.internal.GroupsJavadocOptionFileOption) Test(org.junit.Test)

Example 43 with Expectations

use of org.jmock.Expectations in project gradle by gradle.

the class BooleanJavadocOptionFileOptionTest method testWriteTrueValue.

@Test
public void testWriteTrueValue() throws IOException {
    booleanOption.setValue(true);
    context.checking(new Expectations() {

        {
            oneOf(writerContextMock).writeOption(optionName);
        }
    });
    booleanOption.write(writerContextMock);
}
Also used : Expectations(org.jmock.Expectations) Test(org.junit.Test)

Example 44 with Expectations

use of org.jmock.Expectations in project gradle by gradle.

the class EnumJavadocOptionFileOptionTest method testWriteNoneNullValue.

@Test
public void testWriteNoneNullValue() throws IOException {
    enumOption.setValue(JavadocMemberLevel.PUBLIC);
    context.checking(new Expectations() {

        {
            oneOf(writerContextMock).writeOption("public");
        }
    });
    enumOption.write(writerContextMock);
}
Also used : Expectations(org.jmock.Expectations) Test(org.junit.Test)

Example 45 with Expectations

use of org.jmock.Expectations in project gradle by gradle.

the class MultilineStringsJavadocOptionFileOptionTest method writeNonNullValue.

@Test
public void writeNonNullValue() throws IOException {
    final String extDocUrl = "extDocUrl";
    linksOption.getValue().add(extDocUrl);
    context.checking(new Expectations() {

        {
            final List<String> tempList = new ArrayList<String>();
            tempList.add(extDocUrl);
            oneOf(writerContextMock).writeMultilineValuesOption(optionName, tempList);
        }
    });
    linksOption.writeCollectionValue(writerContextMock);
}
Also used : Expectations(org.jmock.Expectations) List(java.util.List) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

Expectations (org.jmock.Expectations)651 Test (org.junit.Test)443 UnitTest (org.apache.geode.test.junit.categories.UnitTest)109 File (java.io.File)41 ConfigurationServiceImpl (org.nhindirect.config.service.impl.ConfigurationServiceImpl)41 InternalCache (org.apache.geode.internal.cache.InternalCache)35 SlingHttpServletRequest (org.apache.sling.api.SlingHttpServletRequest)33 SlingHttpServletResponse (org.apache.sling.api.SlingHttpServletResponse)32 Resource (org.apache.sling.api.resource.Resource)31 RewriterResponse (org.apache.sling.security.impl.ContentDispositionFilter.RewriterResponse)31 ArrayList (java.util.ArrayList)27 DiskStore (org.apache.geode.cache.DiskStore)23 ValueMap (org.apache.sling.api.resource.ValueMap)21 Before (org.junit.Before)20 CertificateGetOptions (org.nhindirect.config.service.impl.CertificateGetOptions)20 Sequence (org.jmock.Sequence)19 Cache (org.apache.geode.cache.Cache)18 Region (org.apache.geode.cache.Region)18 DistributedMember (org.apache.geode.distributed.DistributedMember)18 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)17