Package org.castor.core.util

Examples of org.castor.core.util.IdentityMap$Entry


        }
    }

    public void testRehash() {
        ArrayList keys = new ArrayList();
        IdentityMap map = new IdentityMap();
       
        for (int i = 0; i < 100; i++) {
            Object key = new Integer(i);
            Object value = "value " + i;
            keys.add(key);
            map.put(key, value);
        }
       
        for (int i = 0; i < 100; i++) {
            Object key = keys.get(i);
            assertTrue(map.containsKey(key));
            Object value = "value " + i;
            assertTrue(value.equals(map.get(key)));
        }
    }
View Full Code Here


    protected void setUp() { }

    protected void tearDown() { }
   
    public void testConstructor() {
        IdentityMap map = new IdentityMap();
        assertTrue(map.isEmpty());
        assertTrue(map.size() == 0);
    }
View Full Code Here

        assertTrue(map.isEmpty());
        assertTrue(map.size() == 0);
    }
   
    public void testPut() {
        IdentityMap map = new IdentityMap();
        Object key = new Integer(123);
        Object original = "original value";
        Object replaced = "replaced value";
        Object result;
       
        result = map.put(key, original);
        assertFalse(map.isEmpty());
        assertTrue(map.size() == 1);
        assertNull(result);
       
        result = map.put(key, replaced);
        assertFalse(map.isEmpty());
        assertTrue(map.size() == 1);
        assertTrue(result == original);
       
        result = map.put(new Integer(123), "value");
        assertFalse(map.isEmpty());
        assertTrue(map.size() == 2);
        assertNull(result);
    }
View Full Code Here

        assertTrue(map.size() == 2);
        assertNull(result);
    }

    public void testClear() {
        IdentityMap map = new IdentityMap();

        map.put(new Integer(123), "value");
        assertFalse(map.isEmpty());
        assertTrue(map.size() == 1);
       
        map.clear();
        assertTrue(map.isEmpty());
        assertTrue(map.size() == 0);
    }
View Full Code Here

                    for (TestMethod testMethod : inputTestData.getTestMethod()) {
                        List<TestRecord> originalTestRecords = testMethod.getTestRecord();
                        for (TestRecord originalTestRecord : originalTestRecords) {
                            if (originalTestRecord.getId().equals(testRecord.get(RECORD_POSITION))) {
                                OutputData outputData = new OutputData();
                                Entry outputEntry = new Entry();
                                outputEntry.setKey(ACTUAL_RESULT);
                                outputEntry.setValue(testRecord.get(ACTUAL_RESULT).toString());
                                outputData.getEntry().add(outputEntry);
                                originalTestRecord.setOutputData(outputData);
                                outputDataAdded = true;
                                break;
                            }
View Full Code Here

                    for (TestMethod testMethod : inputTestData.getTestMethod()) {
                        List<TestRecord> originalTestRecords = testMethod.getTestRecord();
                        for (TestRecord originalTestRecord : originalTestRecords) {
                            if (originalTestRecord.getId().equals(testRecord.get(RECORD_POSITION))) {
                                OutputData outputData = new OutputData();
                                Entry outputEntry = new Entry();
                                outputEntry.setKey(ACTUAL_RESULT);
                                outputEntry.setValue(testRecord.get(ACTUAL_RESULT).toString());
                                Entry durationEntry = new Entry();
                                durationEntry.setKey(DURATION);
                                durationEntry.setValue(testRecord.get(DURATION).toString());
                                outputData.getEntry().add(outputEntry);
                                outputData.getEntry().add(durationEntry);
                                if(testRecord.get(TEST_STATUS) != null){
                                    Entry statusEntry = new Entry();
                                    statusEntry.setKey(TEST_STATUS);
                                    statusEntry.setValue(testRecord.get(TEST_STATUS).toString());
                                    outputData.getEntry().add(statusEntry);
                                }
                               
                               
                                originalTestRecord.setOutputData(outputData);
                                outputDataAdded = true;
                                break;
                            }
                        }
                        if (outputDataAdded) {
                            break;
                        }
                    }
                }else{
                    //Method did not return any data. So only write the duration as output
                    for (TestMethod testMethod : inputTestData.getTestMethod()) {
                        List<TestRecord> originalTestRecords = testMethod.getTestRecord();
                        for (TestRecord originalTestRecord : originalTestRecords) {
                            if (originalTestRecord.getId().equals(testRecord.get(RECORD_POSITION))) {
                                OutputData outputData = new OutputData();
                                Entry durationEntry = new Entry();
                                durationEntry.setKey(DURATION);
                                durationEntry.setValue(testRecord.get(DURATION).toString());
                                outputData.getEntry().add(durationEntry);
                                originalTestRecord.setOutputData(outputData);
                                outputDataAdded = true;
                                break;
                            }
View Full Code Here

TOP

Related Classes of org.castor.core.util.IdentityMap$Entry

Copyright © 2018 www.massapicom. 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.