Skip to content

Commit

Permalink
extended link
Browse files Browse the repository at this point in the history
  • Loading branch information
paksv committed Nov 3, 2014
1 parent c6f0683 commit 2d5c2f6
Show file tree
Hide file tree
Showing 5 changed files with 237 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<jsp:useBean id="refreshablePath" class="java.lang.String" scope="request"/>

<h2 class="noBorder section-header">Cloud Access Information</h2>
<c:set var="azureLink"><a href="https://manage.windowsazure.com/publishsettings" target="_blank">file</a></c:set>
<c:set var="azureLink"><a href="https://manage.windowsazure.com/publishsettings" target="_blank">subscription file</a></c:set>

<script type="text/javascript">
BS.LoadStyleSheetDynamically("<c:url value='${resPath}azure-settings.css'/>");
Expand All @@ -50,7 +50,7 @@
<td>
<props:textProperty name="${cons.subscriptionId}" className="longField"/>
<span class="smallNote">Your Azure account subscription ID</span>
<span class="grayNote">Download your subscription ${azureLink} to obtain management certificate and subscription ID</span>
<span class="grayNote">Download your ${azureLink} to obtain management certificate and subscription ID</span>
</td>
</tr>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
*
* * Copyright 2000-2014 JetBrains s.r.o.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
*
*/

package jetbrains.buildServer.clouds;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
import jetbrains.buildServer.clouds.azure.AzureCloudImageDetails;
import jetbrains.buildServer.clouds.base.types.CloneBehaviour;
import jetbrains.buildServer.serverSide.crypt.EncryptUtil;
import jetbrains.buildServer.serverSide.crypt.RSACipher;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import org.testng.annotations.Test;

/**
* @author Sergey.Pak
* Date: 10/20/2014
* Time: 4:03 PM
*/

@Test
public class TestDeserialize {

public void testDeserialize() throws IOException, DecoderException {

String jsondata = "{\"data\":\"beta\"}";
Gson gson = new Gson();
Map<String, String> map = new HashMap<String, String>();
map = gson.fromJson(jsondata, map.getClass());
System.out.println();

final String data =
"aa7214cd622cf7e6fa086bd0b4e7bb0fcc61b320901f97c17d77c9f7e0df30b0f60bbb19fe72e5a93fda4aa6288bc0f3b1ed2a4badf985ac6677edf0f58d31d415c70d46163c6843a245fd4c90ff65fb381c916d2476c0759ca0f87316bc6b95ec4be4054a114f86ab16297850c6665b9548057b770167aaebe71f0a916146a6";
final String pw = "qwerty";
final String s = RSACipher.decryptData(RSACipher.encryptData(pw));
System.out.println(s);
System.out.println(data);
System.out.println(RSACipher.encryptData(pw));

System.out.println(RSACipher.getHexEncodedPublicKey());
System.out.println(RSACipher.encryptDataForWeb(pw));
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
*
* * Copyright 2000-2014 JetBrains s.r.o.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
*
*/

package jetbrains.buildServer.clouds.base;

import java.util.Map;
import jetbrains.buildServer.clouds.base.connector.AbstractInstance;

/**
* @author Sergey.Pak
* Date: 10/27/2014
* Time: 3:57 PM
*/
public class FakeModel {
private static final FakeModel instance = new FakeModel();

public static FakeModel instance(){
return instance;
}

public Map<String, AbstractInstance> getInstances(){
return null;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
*
* * Copyright 2000-2014 JetBrains s.r.o.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
*
*/

package jetbrains.buildServer.clouds.base.connector;

import java.util.Collection;
import java.util.Map;
import jetbrains.buildServer.clouds.CloudException;
import jetbrains.buildServer.clouds.InstanceStatus;
import jetbrains.buildServer.clouds.base.AbstractCloudImage;
import jetbrains.buildServer.clouds.base.AbstractCloudInstance;
import jetbrains.buildServer.clouds.base.errors.TypedCloudErrorInfo;
import org.jetbrains.annotations.NotNull;

/**
* @author Sergey.Pak
* Date: 10/27/2014
* Time: 3:53 PM
*/
public class FakeApiConnector implements CloudApiConnector {

public InstanceStatus getInstanceStatus(@NotNull final AbstractCloudInstance instance) {
return null;
}

public Map<String, ? extends AbstractInstance> listImageInstances(@NotNull final AbstractCloudImage image) throws CloudException {
return null;
}

public Collection<TypedCloudErrorInfo> checkImage(@NotNull final AbstractCloudImage image) {
return null;
}

public Collection<TypedCloudErrorInfo> checkInstance(@NotNull final AbstractCloudInstance instance) {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
*
* * Copyright 2000-2014 JetBrains s.r.o.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
*
*/

package jetbrains.buildServer.clouds.base.tasks;

import java.util.Collection;
import java.util.Map;
import jetbrains.buildServer.clouds.CloudException;
import jetbrains.buildServer.clouds.InstanceStatus;
import jetbrains.buildServer.clouds.base.AbstractCloudClient;
import jetbrains.buildServer.clouds.base.AbstractCloudImage;
import jetbrains.buildServer.clouds.base.AbstractCloudInstance;
import jetbrains.buildServer.clouds.base.connector.AbstractInstance;
import jetbrains.buildServer.clouds.base.connector.CloudApiConnector;
import jetbrains.buildServer.clouds.base.errors.TypedCloudErrorInfo;
import org.jetbrains.annotations.NotNull;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

/**
* @author Sergey.Pak
* Date: 10/27/2014
* Time: 3:52 PM
*/
@Test
public class UpdateInstancesTaskTest {

private UpdateInstancesTask myTask;
private CloudApiConnector myApiConnector;
private AbstractCloudClient myClient;

@BeforeMethod
public void setUp(){
myApiConnector = new CloudApiConnector() {
public InstanceStatus getInstanceStatus(@NotNull final AbstractCloudInstance instance) {
return null;
}

public Map<String, ? extends AbstractInstance> listImageInstances(@NotNull final AbstractCloudImage image) throws CloudException {
return null;
}

public Collection<TypedCloudErrorInfo> checkImage(@NotNull final AbstractCloudImage image) {
return null;
}

public Collection<TypedCloudErrorInfo> checkInstance(@NotNull final AbstractCloudInstance instance) {
return null;
}
};
myTask = new UpdateInstancesTask(myApiConnector, myClient);
}

public void test(){
}


@AfterMethod
public void tearDown(){

}

}

0 comments on commit 2d5c2f6

Please sign in to comment.