Package org.amplafi.flow.flowproperty

Examples of org.amplafi.flow.flowproperty.FlowPropertyDefinitionImpl.serialize()


    @Test
    public void testListCollectionHandling() throws Exception {
        FlowPropertyDefinitionImpl definition = new FlowPropertyDefinitionImpl(URI, URI.class, FlowActivityPhase.advance, List.class);
        getFlowTranslatorResolver().resolve("", definition);
        List<URI> list = Arrays.asList(new URI("http://foo.com"), new URI("http://gg.gov"));
        String strV =definition.serialize(list);
        assertEquals(strV, "[\"http://foo.com\",\"http://gg.gov\"]");

        FlowPropertyProvider flowPropertyProvider = null;
        List<URI> result = definition.parse(flowPropertyProvider, strV);
        assertTrue(list.containsAll(result));
View Full Code Here


    @SuppressWarnings("unchecked")
    public void testSetCollectionHandling() throws Exception {
        FlowPropertyDefinitionImpl definition = new FlowPropertyDefinitionImpl(URI, URI.class, FlowActivityPhase.advance, Set.class);
        getFlowTranslatorResolver().resolve("", definition);
        Set<URI> set = new LinkedHashSet<URI>(Arrays.asList(new URI("http://foo.com"), new URI("http://gg.gov")));
        String strV =definition.serialize(set);
        assertEquals(strV, "[\"http://foo.com\",\"http://gg.gov\"]");
        FlowPropertyProvider flowPropertyProvider = null;
        Set<URI> result =(Set<URI>) definition.parse(flowPropertyProvider, strV);
        assertTrue(set.containsAll(result));
        assertTrue(set.containsAll(set));
View Full Code Here

        FlowPropertyDefinitionImpl definition = new FlowPropertyDefinitionImpl(URI, URI.class, FlowActivityPhase.advance, Map.class);
        getFlowTranslatorResolver().resolve("", definition);
        Map<String, URI> map = new LinkedHashMap<String, URI>();
        map.put("first", new URI("http://foo.com"));
        map.put("second", new URI("http://gg.gov"));
        String strV =definition.serialize(map);
        assertEquals(strV, "{\"first\":\"http://foo.com\",\"second\":\"http://gg.gov\"}");
        FlowPropertyProvider flowPropertyProvider = null;
        Map<String, URI> result = (Map<String,URI>) definition.parse(flowPropertyProvider, strV);
        assertTrue(result.equals(map));
    }
View Full Code Here

        FlowPropertyDefinitionImpl definition = new FlowPropertyDefinitionImpl(URI, URI.class, FlowActivityPhase.advance, Map.class);
        new FlowTestingUtils().resolveAndInit(definition);
        Map<String, URI> map = new LinkedHashMap<String, URI>();
        map.put("first", new URI("http://foo.com"));
        map.put("second", new URI("http://gg.gov"));
        String strV = definition.serialize(map);
        assertEquals(strV, "{\"first\":\"http://foo.com\",\"second\":\"http://gg.gov\"}");
        Map<String, URI> result = (Map<String, URI>) definition.parse(flowPropertyProvider, strV);
        assertTrue(result.equals(map));
    }
    /**
 
View Full Code Here

    @Test(enabled=TEST_ENABLED, dataProvider="serializationData")
    public void testSerializeAndParse(String original) {
        FlowPropertyDefinitionImpl def = new FlowPropertyDefinitionImpl("test");
        FlowPropertyProvider flowPropertyProvider = null;

        String result = def.parse(flowPropertyProvider, def.serialize(original));
        assertEquals(result, original);
    }

    private static final String URI = "uri";
View Full Code Here

        FlowPropertyProvider flowPropertyProvider = null;

        FlowPropertyDefinitionImpl definition = new FlowPropertyDefinitionImpl(URI, URI.class, FlowActivityPhase.advance, List.class);
        new FlowTestingUtils().resolveAndInit(definition);
        List<URI> list = Arrays.asList(new URI("http://foo.com"), new URI("http://gg.gov"));
        String strV = definition.serialize(list);
        assertEquals(strV, "[\"http://foo.com\",\"http://gg.gov\"]");
        List<URI> result = (List<URI>) definition.parse(flowPropertyProvider, strV);
        assertTrue(list.containsAll(result));
        assertTrue(result.containsAll(list));
    }
View Full Code Here

    public void testSetCollectionHandling() throws Exception {
        FlowPropertyProvider flowPropertyProvider = null;
        FlowPropertyDefinitionImpl definition = new FlowPropertyDefinitionImpl(URI, URI.class, FlowActivityPhase.advance, Set.class);
        new FlowTestingUtils().resolveAndInit(definition);
        Set<URI> set = new LinkedHashSet<URI>(Arrays.asList(new URI("http://foo.com"), new URI("http://gg.gov")));
        String strV = definition.serialize(set);
        assertEquals(strV, "[\"http://foo.com\",\"http://gg.gov\"]");
        Set<URI> result = (Set<URI>) definition.parse(flowPropertyProvider, strV);
        assertTrue(set.containsAll(result));
        assertTrue(set.containsAll(set));
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.