Package org.apache.sshd.server

Examples of org.apache.sshd.server.Environment


    super();
  }

  @Override
  public int getWidth() {
    Environment environment = retrieveEnvironment();
    try {
      return parseInt(environment.getEnv().get("COLUMNS"));
    } catch (NumberFormatException e) {
      return DEFAULT_WIDTH;
    }
  }
View Full Code Here


    }
  }

  @Override
  public int getHeight() {
    Environment environment = retrieveEnvironment();
    try {
      return parseInt(environment.getEnv().get("LINES"));
    } catch (NumberFormatException e) {
      return DEFAULT_HEIGHT;
    }
  }
View Full Code Here

      return DEFAULT_HEIGHT;
    }
  }

  private Environment retrieveEnvironment() {
    Environment environment = env.get();
    if (environment == null)
      throw new NullPointerException("Environement is not registered");
    return environment;
  }
View Full Code Here

        assertEquals(stderr.toByteArray(),error.getBytes());
    }

    @Test
    public void start() throws IOException {
        Environment env = createMock(Environment.class);
        Map<String,String> map = new HashMap<String,String>();
        map.put(Environment.ENV_USER,"roland");
        expect(env.getEnv()).andReturn(map);
        replay(env);

        prepare("input","output",null,0);
        cmd.start(env);
        verify(env);
View Full Code Here

TOP

Related Classes of org.apache.sshd.server.Environment

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.