Package com.pugh.sockso

Examples of com.pugh.sockso.StringProperties


    }

    public void testUpdateForcesRegettingIpFromProperties() {
       
        final StringProperties p = new StringProperties();
        final IpFinder f = new IpFinder( p, null );
        final String firstIp = "123.123.123.123";
        final String secondIp = "456.456.456.456";

        p.set( Constants.SERVER_HOST_LAST_UPDATED, new Date().getTime() );
        p.set( Constants.SERVER_HOST, firstIp );

        f.update();
        assertEquals( firstIp, f.getIp() );

        p.set( Constants.SERVER_HOST, secondIp );

        f.update();
        assertEquals( secondIp, f.getIp() );

    }
View Full Code Here


    private Properties p;
   
    @Override
    protected void setUp() {
        p = new StringProperties();
    }
View Full Code Here

       
    }

    public void testRecentUsers() {

        final Properties p = new StringProperties();
        final List<User> users = new ArrayList<User>();

        assertTrue( !render().contains("recentUsers") );

        final Renderer r1 = getTemplate();
View Full Code Here

    }

    public void testRefreshClearsCacheFirst() {

        final StringProperties p = new StringProperties();
        final IpFinder f = new IpFinder( p, null );
        final String startTime = Long.toString( new Date().getTime() );

        p.set( Constants.SERVER_HOST_LAST_UPDATED, startTime );
       
        f.refresh();

        assertFalse( p.get(Constants.SERVER_HOST_LAST_UPDATED).equals(startTime) );

    }
View Full Code Here

    private Properties p;

    @Override
    protected void setUp() {
        p = new StringProperties();
    }
View Full Code Here

    private TestRequest req;

    @Override
    public void setUp() {
        p = new StringProperties();
        p.set( Constants.WWW_BROWSE_FOLDERS_ENABLED, Properties.YES );
        db = new TestDatabase();
        res = new TestResponse();
        req = new TestRequest( "GET / HTTP/1.1" );
        js = new Jsoner( null, null );
View Full Code Here

    }

    public void testReturningJsonServerInfoIncludesAllRequiredFields() throws Exception {

        Properties p = new StringProperties();
        p.set( Constants.WWW_TITLE, "THEtitle" );
        p.set( Constants.WWW_TAGLINE, "THEtagline" );

        TestResponse res = new TestResponse();
        Jsoner j = new Jsoner( null, null );
        j.setProperties( p );
        j.setResponse( res );
View Full Code Here

    }

    public void testServerInfoReturnsRequireLoginAsOneWhenItIsEnabled() throws Exception {

        Properties p = new StringProperties();
        p.set( Constants.WWW_USERS_REQUIRE_LOGIN, Properties.YES );

        TestResponse res = new TestResponse();
        Jsoner j = new Jsoner( null, null );
        j.setResponse( res );
        j.setProperties( p );
View Full Code Here

    }

    public void testDoubleQuotesAreEscapedInServerInfoStrings() throws Exception {

        Properties p = new StringProperties();
        p.set( Constants.WWW_TITLE, "THE\"title" );
        p.set( Constants.WWW_TAGLINE, "THE\"tagline" );

        TestResponse res = new TestResponse();
        Jsoner j = new Jsoner( null, null );
        j.setProperties( p );
        j.setResponse( res );
View Full Code Here

    public void setUp() {
        db = new TestDatabase();
        ip = new ImportPlaylist(
            null,
            db,
            new DBCollectionManager( db, new StringProperties(), null ),
            null,
            new TestLocale()
        );
    }
View Full Code Here

TOP

Related Classes of com.pugh.sockso.StringProperties

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.