Package waffle.windows.auth.impl

Examples of waffle.windows.auth.impl.WindowsAccountImpl


        // Current User
        Element child = doc.createElement("currentUser");
        node.appendChild(child);

        final String currentUsername = WindowsAccountImpl.getCurrentUsername();
        addAccountInfo(doc, child, new WindowsAccountImpl(currentUsername));

        // Computer
        child = doc.createElement("computer");
        node.appendChild(child);
View Full Code Here


        assertEquals(computer.getMemberOf(), nodes.item(1).getTextContent());
        assertEquals(computer.getJoinStatus(), nodes.item(2).getTextContent());

        // Add Lookup Info for Various accounts
        String lookup = WindowsAccountImpl.getCurrentUsername();
        final IWindowsAccount account = new WindowsAccountImpl(lookup);
        Element elem = helper.getLookupInfo(info, lookup);
        assertEquals(lookup, elem.getAttribute("name"));
        assertEquals(account.getName(), elem.getFirstChild().getTextContent());

        // Report an error when unknown name
        lookup = "__UNKNOWN_ACCOUNT_NAME___";
        elem = helper.getLookupInfo(info, lookup);
        assertEquals(lookup, elem.getAttribute("name"));
View Full Code Here

    }

    @Test
    public void testGetCurrentAccount() {
        final String currentUsername = WindowsAccountImpl.getCurrentUsername();
        final IWindowsAccount account = new WindowsAccountImpl(currentUsername);
        Assertions.assertThat(account.getName().length()).isGreaterThan(0);
        WindowsAccountTests.LOGGER.info("Name: {}", account.getName());
        Assertions.assertThat(account.getDomain().length()).isGreaterThan(0);
        WindowsAccountTests.LOGGER.info("Domain: {}", account.getDomain());
        Assertions.assertThat(account.getFqn().length()).isGreaterThan(0);
        WindowsAccountTests.LOGGER.info("Fqn: {}", account.getFqn());
        Assertions.assertThat(account.getSidString().length()).isGreaterThan(0);
        WindowsAccountTests.LOGGER.info("Sid: {}", account.getSidString());
        // To avoid errors with machine naming being all upper-case, use test in this manner
        assertTrue(currentUsername.equalsIgnoreCase(account.getFqn()));
        assertTrue(currentUsername.endsWith("\\" + account.getName()));
        // To avoid errors with machine naming being all upper-case, use test in this manner
        assertTrue(currentUsername.toLowerCase().startsWith(account.getDomain().toLowerCase() + "\\"));
    }
View Full Code Here

TOP

Related Classes of waffle.windows.auth.impl.WindowsAccountImpl

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.