package be.iminds.ilabt.jfed.lowlevel.stitching;

import be.iminds.ilabt.jfed.lowlevel.AbstractApi;
import be.iminds.ilabt.jfed.lowlevel.GeniAMResponseCode;
import be.iminds.ilabt.jfed.lowlevel.JFedException;
import be.iminds.ilabt.jfed.lowlevel.api.AbstractGeniAggregateManager;
import be.iminds.ilabt.jfed.lowlevel.api.AggregateManager2;
import be.iminds.ilabt.jfed.lowlevel.api.AggregateManager3;
import be.iminds.ilabt.jfed.util.JSonHelper;
import org.apache.http.ProtocolVersion;
import org.apache.http.StatusLine;
import org.testng.Assert;
import org.testng.annotations.Test;

import java.util.Date;
import java.util.Map;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class StitchingDirectorTest {

    @Test
    public void testIsUnavailableVlan() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("Exception: requested VLAN unavailable: sdn-sw.newy32aoa.net.internet2.edu,eth7/2 VLAN=1717");
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_VLAN_UNAVAILABLE);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(true));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(not(Boolean.TRUE)));
        assertThat(StitchingDirector.getUnavailableVlan(reply), is(1717));
    }
    @Test
    public void testIsUnavailableVlanExo() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("Embedding workflow ERROR: 1:Error in building the dependency tree, probably not available vlan path OR trying to reuse a stitching tag:http://geni-orca.renci.org/owl/8d80a006-3e59-476c-abe2-c040454e7ded#/08c8ec53-b708-4f68-964f-09d4d179c6bb.\n" +
                " Please see https://geni-orca.renci.org/trac/wiki/orca-errors for possible solutions.");
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_ERROR);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(true));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(not(Boolean.TRUE)));
        assertThat(StitchingDirector.getUnavailableVlan(reply), is(nullValue()));
    }
    @Test
    public void testIsUnavailableVlan2() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("vlan tag 304 for authority.example.com not available");
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_ERROR);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(true));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(not(Boolean.TRUE)));
        assertThat(StitchingDirector.getUnavailableVlan(reply), is(304));
    }

    @Test
    public void testGetUnavailableVlan() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("Exception: requested VLAN unavailable: sdn-sw.newy32aoa.net.internet2.edu,eth7/2 VLAN=1717");
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_VLAN_UNAVAILABLE);
        assertThat(StitchingDirector.getUnavailableVlan(reply), is(1717));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(not(Boolean.TRUE)));
    }

    @Test
    public void testGetUnavailableVlan2() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("vlan tag 304 for authority.example.com not available");
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_ERROR);
        assertThat(StitchingDirector.getUnavailableVlan(reply), is(304));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(not(Boolean.TRUE)));
    }

    @Test
    public void testIsAnyNotSupported() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("ERROR: vlan range any is invalid");
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_ERROR);
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(true));
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(not(Boolean.TRUE)));
    }

    @Test
    public void testIsAnyNotSupported2() throws Exception {
        String blabla = "blabla ";
        for (int i = 0; i < 50; i++)
            blabla += "blabla ";
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn(blabla+" blabla any blabla "+blabla);
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_ERROR);
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(not(Boolean.TRUE)));
    }

    @Test
    public void testReplyType1() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getValue()).thenReturn("Could not map to resources: Not enough bandwidth to connect some nodes");
        when(reply.getOutput()).thenReturn("Nodes:\\nnode0 interconnect-wall1\\nnode1 n096-06a\\nEnd Nodes\\nEdges:\\nlinksimple/link0/node0:0,node1:0 Mapping Failed\\nEnd Edges\\n");
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_ERROR);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(Boolean.TRUE));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
    }

    @Test
    public void testReplyType2() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getValue()).thenReturn("");
        when(reply.getOutput()).thenReturn("Nodes:\\nnode0 interconnect-wall1\\nnode1 n096-06a\\nEnd Nodes\\nEdges:\\nlinksimple/link0/node0:0,node1:0 Mapping Failed\\nEnd Edges\\n");
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_ERROR);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(Boolean.TRUE));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
    }

    @Test
    public void testReplyType3() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getValue()).thenReturn("Could not map to resources: Not enough bandwidth to connect some nodes");
        when(reply.getRawValue()).thenReturn("Could not map to resources: Not enough bandwidth to connect some nodes");
        when(reply.getOutput()).thenReturn("");
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_ERROR);
        assert reply.getValue() != null;
        assert reply.getValue() instanceof String;
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(Boolean.TRUE));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
    }
    @Test
    public void testReplyType3b() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getValue()).thenReturn("Could not map to resources: Not enough bandwidth to connect some nodes");
        when(reply.getOutput()).thenReturn(null);
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_ERROR);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(Boolean.TRUE));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
    }

    @Test
    public void testReplyType4() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("Could not map to resources: Not enough bandwidth to connect some nodes");
        when(reply.getValue()).thenReturn("");
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_ERROR);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(Boolean.TRUE));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
    }

    @Test
    public void testReplyType4b() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("Could not map to resources: Not enough bandwidth to connect some nodes");
        when(reply.getValue()).thenReturn(null);
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_ERROR);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(Boolean.TRUE));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
    }

    @Test
    public void testReplyType5() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("");
        Map ht = (Map) JSonHelper.jsonStringToXmlRpcLikeObject("{\n" +
                "                  \"geni_urn\": \"urn:publicid:IDN+example.com+slice+a\",\n" +
                "                  \"geni_resources\": [\n" +
                "                         {\n" +
                "                            \"geni_urn\": \"urn:publicid:IDN+example.com+slice+sliceinsteadofsliver\",\n" +
                "                            \"geni_error\": \"Bandwidth PCE(PCE_CREATE_FAILED): 'Unable to find path because the maximum bandwidth of ion.internet2.edu:rtr.hous:ge-1/2/4 has been exceeded. 150.0 Mbps is available and 800 Mbps was requested  on reservation ion.internet2.edu-91961 in Bandwidth PCE'\",\n" +
                "                            \"geni_status\": \"failed\"\n" +
                "                            }\n" +
                "                         ],\n" +
                "                  \"geni_expires\": \"2014-05-25T12:28:25.000Z\",\n" +
                "                  \"geni_status\": \"failed\"\n" +
                "                  }");
        AggregateManager2.SliverStatus sliverStatus = new AggregateManager2.SliverStatus(ht);
        when(reply.getValue()).thenReturn(sliverStatus);
        when(reply.getRawValue()).thenReturn(ht);
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_SUCCESS);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(Boolean.TRUE));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
    }

    @Test
    public void testReplyType6() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("");
        Map ht = (Map) JSonHelper.jsonStringToXmlRpcLikeObject("{\n" +
                "                  \"geni_urn\": \"urn:publicid:IDN+example.com+slice+a\",\n" +
                "                  \"geni_resources\": [\n" +
                "                         {\n" +
                "                            \"geni_urn\": \"urn:publicid:IDN+example.com+sliver+a1\",\n" +
                "                            \"geni_error\": \"vlan 15 is unavailable\",\n" +
                "                            \"geni_status\": \"failed\"\n" +
                "                            }\n" +
                "                         ],\n" +
                "                  \"geni_expires\": \"2014-05-25T12:28:25.000Z\",\n" +
                "                  \"geni_status\": \"failed\"\n" +
                "                  }");
        AggregateManager2.SliverStatus sliverStatus = new AggregateManager2.SliverStatus(ht);
        when(reply.getValue()).thenReturn(sliverStatus);
        when(reply.getRawValue()).thenReturn(ht);
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_SUCCESS);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(true));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(Boolean.FALSE));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
    }

    @Test
    public void testReplyType6b() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("");
        Map ht = (Map) JSonHelper.jsonStringToXmlRpcLikeObject("{\n" +
                "                  \"geni_urn\": \"urn:publicid:IDN+example.com+slice+a\",\n" +
                "                  \"geni_resources\": [\n" +
                "                         {\n" +
                "                            \"geni_urn\": \"urn:publicid:IDN+example.com+sliver+a1\",\n" +
                "                            \"geni_error\": \"vlan 300 is unavailable\",\n" +
                "                            \"geni_status\": \"fail\"\n" +
                "                            }\n" +
                "                         ],\n" +
                "                  \"geni_expires\": \"2014-05-25T12:28:25.000Z\",\n" +
                "                  \"geni_status\": \"fail\"\n" +
                "                  }");
        AggregateManager2.SliverStatus sliverStatus = new AggregateManager2.SliverStatus(ht);
        when(reply.getValue()).thenReturn(sliverStatus);
        when(reply.getRawValue()).thenReturn(ht);
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_SUCCESS);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(true));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(Boolean.FALSE));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
    }

    @Test
    public void testReplyType7() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("");
        Map ht = (Map) JSonHelper.jsonStringToXmlRpcLikeObject("{ " +
                "\"geni_slivers\": [ { \n" +
                "                        \"geni_client_id\": \"PC\", \n" +
                "                        \"geni_sliver_urn\": \"urn:publicid:IDN+example.com+sliver+53233\", \n" +
                "                        \"geni_allocation_status\": \"geni_provisioned\", \n" +
                "                        \"geni_error\": \"vlan 15 is unavailable\", \n" +
                "                        \"geni_expires\": \"2015-03-12T23:06:05Z\", \n" +
                "                        \"geni_operational_status\": \"geni_failed\" \n" +
                "                    } ], \n" +
                "  \"geni_urn\": \"urn:publicid:IDN+wall2.ilabt.iminds.be:fed4fire+slice+sAq4194362\"\n" +
                "}");
        AggregateManager3.StatusInfo sliverStatus = new AggregateManager3.StatusInfo(ht);
        when(reply.getValue()).thenReturn(sliverStatus);
        when(reply.getRawValue()).thenReturn(ht);
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_SUCCESS);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(true));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(Boolean.FALSE));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
    }

    @Test
    public void testReplyType8() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("");
        Map ht = (Map) JSonHelper.jsonStringToXmlRpcLikeObject("{ " +
                "\"geni_slivers\": [ { \n" +
                "                        \"geni_client_id\": \"PC\", \n" +
                "                        \"geni_sliver_urn\": \"urn:publicid:IDN+example.com+sliver+53233\", \n" +
                "                        \"geni_allocation_status\": \"geni_provisioned\", \n" +
                "                        \"geni_error\": \"Bandwidth PCE(PCE_CREATE_FAILED): 'Unable to find path because the maximum bandwidth of link has been exceeded.'\", \n" +
                "                        \"geni_expires\": \"2015-03-12T23:06:05Z\", \n" +
                "                        \"geni_operational_status\": \"geni_failed\" \n" +
                "                    } ], \n" +
                "  \"geni_urn\": \"urn:publicid:IDN+wall2.ilabt.iminds.be:fed4fire+slice+sAq4194362\"\n" +
                "}");
        AggregateManager3.StatusInfo sliverStatus = new AggregateManager3.StatusInfo(ht);
        when(reply.getValue()).thenReturn(sliverStatus);
        when(reply.getRawValue()).thenReturn(ht);
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_SUCCESS);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(Boolean.TRUE));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
    }

    @Test
    public void testReplyType9() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("");
        Map ht = (Map) JSonHelper.jsonStringToXmlRpcLikeObject( "{\n" +
                    "              \"geni_urn\": \"urn:publicid:IDN+example.com+slice+1\",\n" +
                    "              \"geni_resources\": [\n" +
                    "                     {\n" +
                    "                        \"geni_urn\": \"urn:publicid:IDN+example.com+sliver+a1\",\n" +
                    "                        \"geni_error\": \"\",\n" +
                    "                        \"geni_status\": \"changing\"\n" +
                    "                        }\n" +
                    "                     ],\n" +
                    "              \"geni_expires\": \"2014-08-13T06:50:11.000Z\",\n" +
                    "              \"geni_status\": \"changing\"\n" +
                    "              }\n");
        AggregateManager2.SliverStatus sliverStatus = new AggregateManager2.SliverStatus(ht);
        when(reply.getValue()).thenReturn(sliverStatus);
        when(reply.getRawValue()).thenReturn(ht);
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_SUCCESS);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(Boolean.FALSE));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
    }

    @Test
    public void testReplyType11() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("");
        Map ht = (Map) JSonHelper.jsonStringToXmlRpcLikeObject("{\n" +
                "              \"geni_urn\": \"urn:publicid:IDN+example.com+slice+a\",\n" +
                "              \"geni_resources\": [\n" +
                "                     {\n" +
                "                        \"geni_urn\": \"urn:publicid:IDN+example.com+sliver+s\",\n" +
                "                        \"geni_error\": \"VLAN PCE(PCE_CREATE_FAILED): 'There are no VLANs available on link example.com  on reservation example.net in VLAN PCE'\",\n" +
                "                        \"geni_status\": \"failed\"\n" +
                "                        }\n" +
                "                     ],\n" +
                "              \"geni_expires\": \"2015-03-16T17:29:18.000Z\",\n" +
                "              \"geni_status\": \"failed\"\n" +
                "              }");
        AggregateManager2.SliverStatus sliverStatus = new AggregateManager2.SliverStatus(ht);
        when(reply.getValue()).thenReturn(sliverStatus);
        when(reply.getRawValue()).thenReturn(ht);
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_SUCCESS);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(true));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(Boolean.FALSE));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
    }

    @Test
    public void testReplyType10() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("Could not verify topo");
        when(reply.getValue()).thenReturn(null);
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_ERROR);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(Boolean.TRUE));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(false));
    }
    @Test
    public void testReplyType12() throws Exception {
        AbstractGeniAggregateManager.AggregateManagerReply reply = mock(AbstractGeniAggregateManager.AggregateManagerReply.class);
        when(reply.getOutput()).thenReturn("Error encountered converting RSpec to NDL via converter service: ERROR converting from RSpec3 request to RDF-XML:java.lang.Exception: ERROR: unable to convert RSpec2 document: java.lang.Exception: ERROR: vlan range any is invalid");
        when(reply.getValue()).thenReturn(null);
        when(reply.getGeniResponseCode()).thenReturn(GeniAMResponseCode.GENIRESPONSE_ERROR);
        assertThat(StitchingDirector.isUnavailableVlan(reply), is(false));
        assertThat(StitchingDirector.isUnrecoverableError(reply), is(Boolean.FALSE));
        assertThat(StitchingDirector.isAnyNotSupported(reply), is(true));
    }

}