Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
* Copyright Microsoft Corporation
*
* 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
* 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.
* 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 com.microsoft.windowsazure.serviceruntime;

Expand Down Expand Up @@ -50,7 +50,6 @@ public final class RoleEnvironment {
JAXBContext.newInstance(RoleEnvironment.class.getPackage().getName());
}
catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
clientId = UUID.randomUUID().toString();
Expand Down Expand Up @@ -93,6 +92,7 @@ private static synchronized void initialize() {
lastState = new AtomicReference<CurrentState>();

runtimeClient.addGoalStateChangedListener(new GoalStateChangedListener() {
@Override
public void goalStateChanged(GoalState newGoalState) {
switch (newGoalState.getExpectedState()) {
case STARTED:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
/**
* Copyright Microsoft Corporation
*
*
* 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.
* 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 com.microsoft.windowsazure.services.core.utils;

public class ConnectionStringSyntaxException extends Exception {

private static final long serialVersionUID = 9074252127254835859L;

public ConnectionStringSyntaxException(String message) {
super(message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static ServiceException process(String serviceName, ServiceException exce
Throwable cause = exception.getCause();

for (Throwable scan = cause; scan != null; scan = scan.getCause()) {
Class scanClass = scan.getClass();
Class<?> scanClass = scan.getClass();
if (ServiceException.class.isAssignableFrom(scanClass)) {
return populate(exception, serviceName, (ServiceException) scan);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonWriteNullProperties;
import org.codehaus.jackson.map.annotate.JsonSerialize;

//
// members of this class defined per specification at
// http://msdn.microsoft.com/en-us/library/windowsazure/hh367521.aspx#BKMK_REST3prod
//

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonWriteNullProperties(false)
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class BrokerProperties {

@JsonProperty("CorrelationId")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
* Copyright Microsoft Corporation
*
* 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
* 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.
* 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 com.microsoft.windowsazure.services.serviceBus.implementation;

Expand All @@ -31,18 +31,12 @@ public BrokerProperties fromString(String value) throws IllegalArgumentException
return mapper.readValue(value.getBytes(), BrokerProperties.class);
}
catch (JsonParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new IllegalArgumentException(e);
}
catch (JsonMappingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new IllegalArgumentException(e);
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new IllegalArgumentException(e);
}
}
Expand All @@ -54,18 +48,12 @@ public String toString(BrokerProperties value) {
mapper.writeValue(writer, value);
}
catch (JsonGenerationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new RuntimeException(e);
}
catch (JsonMappingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new RuntimeException(e);
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new RuntimeException(e);
}
return writer.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
* Copyright Microsoft Corporation
*
* 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
* 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.
* 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 com.microsoft.windowsazure.services.serviceBus.implementation;

Expand All @@ -30,28 +30,23 @@ public class MarshallerProvider implements ContextResolver<Marshaller> {
@Context
private ContextResolver<JAXBContext> jaxbContextResolver;

@Override
public Marshaller getContext(Class<?> type) {
Marshaller marshaller;
try {
marshaller = getJAXBContext(type).createMarshaller();
}
catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
com.sun.xml.bind.marshaller.NamespacePrefixMapper mapper = new NamespacePrefixMapperImpl();
try {
marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", mapper);
}
catch (PropertyException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
return marshaller;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
* Copyright Microsoft Corporation
*
* 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
* 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.
* 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 com.microsoft.windowsazure.services.serviceBus.implementation;

Expand All @@ -23,7 +23,6 @@
import java.util.concurrent.ConcurrentHashMap;

import javax.inject.Inject;
import javax.inject.Named;
import javax.management.timer.Timer;

import com.microsoft.windowsazure.services.core.ServiceException;
Expand All @@ -41,7 +40,7 @@ public class WrapTokenManager {

@Inject
public WrapTokenManager(WrapContract contract, DateFactory dateFactory,
ServiceBusConnectionSettings connectionSettings) {
ServiceBusConnectionSettings connectionSettings) {
this.contract = contract;
this.dateFactory = dateFactory;
this.uri = connectionSettings.getWrapUri();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ public static String generateFilterCondition(String propertyName, String operati
for (byte b : value) {
formatter.format("%02x", b);
}
formatter.flush();
formatter.close();

return generateFilterCondition(propertyName, operation, sb.toString(), EdmType.BINARY);
}
Expand Down Expand Up @@ -232,6 +234,8 @@ public static String generateFilterCondition(String propertyName, String operati
for (byte b : value) {
formatter.format("%02x", b);
}
formatter.flush();
formatter.close();

return generateFilterCondition(propertyName, operation, sb.toString(), EdmType.BINARY);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ public void sign(ClientRequest cr) {
if (log.isDebugEnabled()) {
log.debug(String.format("String to sign: \"%s\"", stringToSign));
}
//TODO: Remove or comment the following line
//System.out.println(String.format("String to sign: \"%s\"", stringToSign));

String signature = this.getSigner().sign(stringToSign);
cr.getHeaders().putSingle("Authorization", "SharedKey " + this.getAccountName() + ":" + signature);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ else if (value.getClass() == byte[].class) {
for (byte b : byteArray) {
formatter.format("%02x", b);
}
formatter.flush();
formatter.close();
sb.append("'");
}
else if (value.getClass() == Byte[].class) {
Expand All @@ -269,6 +271,8 @@ else if (value.getClass() == Byte[].class) {
for (Byte b : byteArray) {
formatter.format("%02x", b);
}
formatter.flush();
formatter.close();
sb.append("'");
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@
* Copyright Microsoft Corporation
*
* 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
* 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.
* 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 com.microsoft.windowsazure.serviceruntime;

import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

import java.io.InputStream;
import java.util.LinkedList;
import java.util.List;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.hamcrest.Matchers.*;

/**
*
Expand Down Expand Up @@ -88,7 +89,7 @@ public void goalStateClientRestartsThread() {
Protocol1RuntimeCurrentStateClient currentStateClient = new Protocol1RuntimeCurrentStateClient(null, null);

GoalStateDeserializer goalStateDeserializer = new GoalStateDeserializer() {
private ChunkedGoalStateDeserializer deserializer = new ChunkedGoalStateDeserializer();
private final ChunkedGoalStateDeserializer deserializer = new ChunkedGoalStateDeserializer();

@Override
public void initialize(InputStream inputStream) {
Expand Down Expand Up @@ -148,7 +149,6 @@ public RoleEnvironmentData deserialize(InputStream stream) {
client.getCurrentGoalState();
}
catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ public class BlobTestBase {

@BeforeClass
public static void setup() throws URISyntaxException, StorageException, InvalidKeyException {

// UNCOMMENT TO USE FIDDLER
System.setProperty("http.proxyHost", "localhost");
System.setProperty("http.proxyPort", "8888");
System.setProperty("https.proxyHost", "localhost");
System.setProperty("https.proxyPort", "8888");

if (USE_DEV_FABRIC) {
httpAcc = CloudStorageAccount.getDevelopmentStorageAccount();
}
Expand Down
Loading