Package com.volantis.devrep.repository.impl

Examples of com.volantis.devrep.repository.impl.DeviceTACPair


                // Now test with lots of tacs.
                int tacCount = populateWithTACs(conn);
                enumeration = accessor.enumerateDeviceTACs(connection);
                int actual = 0;
                while(enumeration.hasNext()) {
                    DeviceTACPair pair =
                            (DeviceTACPair) enumeration.next();
                    if (pair.getTAC() == 350612) {
                        assertEquals("Device 350612 should be Nokia-6210",
                                "Nokia-6210", pair.getDeviceName());
                    } else {
                        assertEquals("Name should match: ",
                              "device-" + pair.getTAC(), pair.getDeviceName());
                    }
                    ++actual;
                }
                assertEquals("Number of tacs should  match", tacCount, actual);
View Full Code Here


        RowProcessor rowProcessor = new RowProcessor() {
            public Object processRow(ResultSet rs) throws SQLException {
                String deviceName = rs.getString(1);
                long tac = rs.getLong(2);
                return new DeviceTACPair(tac, deviceName);
            }
        };
        PreparedStatementSetter setter = new PreparedStatementSetter() {
            public void setValues(PreparedStatement ps)
                    throws SQLException {
View Full Code Here

                Iterator numbers = entry.numbers();
                while (numbers.hasNext()) {
                    String number = (String) numbers.next();
                    try {
                        long tac = Long.parseLong(number);
                        tacPairs.add(new DeviceTACPair(tac, deviceName));
                    } catch (NumberFormatException nfe) {
                        // Shouldn't get any of these since the schema
                        // carries out validation - if we do, then ignore the
                        // invalid TAC and log it as a warning.
                        logger.warn("long-tac-conversion-error",
View Full Code Here

            if (tacCache == null) {
                cache = new HashMap();
                RepositoryEnumeration deviceTACPairs =
                        enumerateDeviceTACs(connection);
                while (deviceTACPairs.hasNext()) {
                    DeviceTACPair pair = (DeviceTACPair) deviceTACPairs.next();
                    cache.put(new TACValue(pair.getTAC()),
                              pair.getDeviceName());
                }
                tacCache = cache;
            } else {
                cache = tacCache;
            }
View Full Code Here

                RepositoryConnection connection = createConnection();

                RepositoryEnumeration enumeration = accessor.enumerateDeviceTACs(connection);
                assertTrue("Enumeration should contain elements", enumeration.hasNext());
                DeviceTACPair dtp = (DeviceTACPair) enumeration.next();
                assertEquals("First device name should match 'Nokia-6210'",
                        "Nokia-6210", dtp.getDeviceName());
                assertEquals("First device TAC should match '350612'",
                        350612, dtp.getTAC());
                int deviceTacCount = 1;
                while (enumeration.hasNext()) {
                    enumeration.next();
                    deviceTacCount += 1;
                }
View Full Code Here

TOP

Related Classes of com.volantis.devrep.repository.impl.DeviceTACPair

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.