@author Adrian Cole
7475767778798081
assertEquals(options.getPrivateKey(), "-----BEGIN RSA PRIVATE KEY-----"); } @Test public void testNullinstallPrivateKey() { JoyentCloudTemplateOptions options = new JoyentCloudTemplateOptions(); assertEquals(options.getPrivateKey(), null); }
8081828384858687
assertEquals(options.getPrivateKey(), null); } @Test public void testinstallPrivateKeyStatic() throws IOException { JoyentCloudTemplateOptions options = installPrivateKey("-----BEGIN RSA PRIVATE KEY-----"); assertEquals(options.getPrivateKey(), "-----BEGIN RSA PRIVATE KEY-----"); }
9192939495969798
installPrivateKey(null); } @Test(expectedExceptions = IllegalArgumentException.class) public void testauthorizePublicKeyBadFormat() { JoyentCloudTemplateOptions options = new JoyentCloudTemplateOptions(); options.authorizePublicKey("whompy"); }
979899100101102103104105
options.authorizePublicKey("whompy"); } @Test public void testauthorizePublicKey() throws IOException { JoyentCloudTemplateOptions options = new JoyentCloudTemplateOptions(); options.authorizePublicKey("ssh-rsa"); assertEquals(options.getPublicKey(), "ssh-rsa"); }
104105106107108109110111
assertEquals(options.getPublicKey(), "ssh-rsa"); } @Test public void testNullauthorizePublicKey() { JoyentCloudTemplateOptions options = new JoyentCloudTemplateOptions(); assertEquals(options.getPublicKey(), null); }
110111112113114115116117
assertEquals(options.getPublicKey(), null); } @Test public void testauthorizePublicKeyStatic() throws IOException { JoyentCloudTemplateOptions options = authorizePublicKey("ssh-rsa"); assertEquals(options.getPublicKey(), "ssh-rsa"); }
121122123124125126127128
authorizePublicKey(null); } @Test(expectedExceptions = IllegalArgumentException.class) public void testblockOnPortBadFormat() { JoyentCloudTemplateOptions options = new JoyentCloudTemplateOptions(); options.blockOnPort(-1, -1); }
127128129130131132133134135136137
options.blockOnPort(-1, -1); } @Test public void testblockOnPort() { JoyentCloudTemplateOptions options = new JoyentCloudTemplateOptions(); options.blockOnPort(22, 30); assertEquals(options.getPort(), 22); assertEquals(options.getSeconds(), 30); }
136137138139140141142143144
} @Test public void testNullblockOnPort() { JoyentCloudTemplateOptions options = new JoyentCloudTemplateOptions(); assertEquals(options.getPort(), -1); assertEquals(options.getSeconds(), -1); }
143144145146147148149150151
assertEquals(options.getSeconds(), -1); } @Test public void testblockOnPortStatic() { JoyentCloudTemplateOptions options = blockOnPort(22, 30); assertEquals(options.getPort(), 22); assertEquals(options.getSeconds(), 30); }