Search in sources :

Example 16 with Converter

use of org.wso2.ballerinalang.compiler.packaging.converters.Converter in project ballerina by ballerina-lang.

the class PattenTest method testLazy.

/**
 * Disabled because it fails in JVM 8
 * See: https://bugs.openjdk.java.net/browse/JDK-8075939
 */
@Test(enabled = false)
public void testLazy() {
    Converter<String> mock = mockResolver("root-dir", null, s -> Stream.concat(Stream.of("", ""), Stream.generate(() -> {
        Assert.fail("method called. Hence not lazy.");
        return "";
    })), null);
    Patten subject = new Patten(Patten.WILDCARD_DIR);
    List<String> strings = subject.convert(mock).limit(1).collect(Collectors.toList());
    Assert.assertTrue(strings.isEmpty());
}
Also used : Patten(org.wso2.ballerinalang.compiler.packaging.Patten) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)9 Patten (org.wso2.ballerinalang.compiler.packaging.Patten)8 RemoteRepo (org.wso2.ballerinalang.compiler.packaging.repo.RemoteRepo)3 Repo (org.wso2.ballerinalang.compiler.packaging.repo.Repo)3 Event (org.wso2.siddhi.core.event.Event)3 MetaStateEvent (org.wso2.siddhi.core.event.state.MetaStateEvent)3 MetaStreamEvent (org.wso2.siddhi.core.event.stream.MetaStreamEvent)3 StreamEvent (org.wso2.siddhi.core.event.stream.StreamEvent)3 StreamEventPool (org.wso2.siddhi.core.event.stream.StreamEventPool)3 SelectiveStreamEventConverter (org.wso2.siddhi.core.event.stream.converter.SelectiveStreamEventConverter)3 SimpleStreamEventConverter (org.wso2.siddhi.core.event.stream.converter.SimpleStreamEventConverter)3 StreamEventConverter (org.wso2.siddhi.core.event.stream.converter.StreamEventConverter)3 ZeroStreamEventConverter (org.wso2.siddhi.core.event.stream.converter.ZeroStreamEventConverter)3 Attribute (org.wso2.siddhi.query.api.definition.Attribute)3 StreamDefinition (org.wso2.siddhi.query.api.definition.StreamDefinition)3 URI (java.net.URI)2 Path (java.nio.file.Path)2 BLangCompilerException (org.ballerinalang.compiler.BLangCompilerException)2 PackageSourceEntry (org.ballerinalang.repository.PackageSourceEntry)2 Converter (org.wso2.ballerinalang.compiler.packaging.converters.Converter)2