alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (TerminalFactoryTest.java)

This example Scala source code file (TerminalFactoryTest.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

before, exception, exception, terminal, terminal, terminalfactorytest, terminalfactorytest, test, test

The Scala TerminalFactoryTest.java source code

package scala.tools.jline;

import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

/**
 * Tests for the {@link TerminalFactory}.
 */
public class TerminalFactoryTest
{
    @Before
    public void setUp() throws Exception {
        TerminalFactory.reset();
    }

    @Test
    public void testConfigureNone() {
        TerminalFactory.configure(TerminalFactory.NONE);
        Terminal t = TerminalFactory.get();
        assertNotNull(t);
        assertEquals(UnsupportedTerminal.class.getName(), t.getClass().getName());
    }

    @Test
    public void testConfigureUnsupportedTerminal() {
        TerminalFactory.configure(UnsupportedTerminal.class.getName());
        Terminal t = TerminalFactory.get();
        assertNotNull(t);
        assertEquals(UnsupportedTerminal.class.getName(), t.getClass().getName());
    }
}

Other Scala examples (source code examples)

Here is a short list of links related to this Scala TerminalFactoryTest.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.