Skip to content

Instantly share code, notes, and snippets.

View anpieber's full-sized avatar

Andreas Pieber anpieber

  • Schmutterer+Partner Information Technology GmbH
  • Austria, Vienna
View GitHub Profile
@anpieber
anpieber / gist:759918
Created December 30, 2010 15:54
specification for proxyhelper
@Test
public void testMethodCallPointingToToStringMethod_ShouldReturnOriginalValue() throws Exception {
Object originalObject = new Object();
Object[] args = null;
Method methodMock = mock(Method.class);
when(methodMock.getName()).thenReturn("toString");
when(methodMock.invoke(originalObject, args)).thenReturn("TestValue");
ProxyObjectMethodMirror proxyObjectMethodMirror = new ProxyObjectMethodMirror(objectMock, methodMock, args);
assertTrue(proxyObjectMethodMirror.isMethodObjectMethod());
assertEquals("TestValue",proxyObjectMethodMirror.executeMethod());
@anpieber
anpieber / gist:768220
Created January 6, 2011 17:28
./shell output
-> % ./shell
__ __ ____
/ //_/____ __________ _/ __/
/ ,< / __ `/ ___/ __ `/ /_
/ /| |/ /_/ / / / /_/ / __/
/_/ |_|\__,_/_/ \__,_/_/
Apache Karaf (2.1.3-SNAPSHOT)
Hit '<tab>' for a list of available commands
-> % git diff
diff --git a/demos/web/src/main/java/org/apache/karaf/web/WebAppListener.java b/demos/web/src/main/java/org/apache/kara
index dad40cd..4c49f01 100644
--- a/demos/web/src/main/java/org/apache/karaf/web/WebAppListener.java
+++ b/demos/web/src/main/java/org/apache/karaf/web/WebAppListener.java
@@ -24,9 +24,9 @@ import javax.servlet.ServletContextListener;
import org.apache.karaf.main.Main;
public class WebAppListener implements ServletContextListener {
-
-> % git diff
diff --git a/.gitmodules b/.gitmodules
index 8e127e7..7f94b73 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -30,22 +30,22 @@
url = git://github.com/openengsb/openengsb-wrapped-com.dolby.jira.net.git
[submodule "connector/email"]
path = connector/email
- url = git@github.com:openengsb/openengsb-connector-email.git
<features name="openengsb-itests-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.0.0 http://karaf.apache.org/xmlns/features/v1.0.0">
<repository>mvn:org.openengsb.connector/openengsb-connector-memoryauditing/${project.version}/xml/features</repository>
<repository>mvn:org.openengsb/openengsb/${project.version}/xml/features</repository>
</features>
/**
* Licensed to the Austrian Association for Software Tool Integration (AASTI)
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. The AASTI licenses this file to you 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
*
@Override
public boolean equals(Object obj) {
if (!(obj instanceof ConfigItem)) {
return false;
}
ConfigItem<?> toCompare = (ConfigItem<?>) obj;
if (!compareMetadata(toCompare.getMetaData(), metaData)) {
if (!compareMetadata(metaData, toCompare.getMetaData())) {
return false;
}
/**
* Licensed to the Austrian Association for Software Tool Integration (AASTI)
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. The AASTI licenses this file to you 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
*
for (String config : feature.getConfigurations().keySet()) {
Dictionary<String,String> props = new Hashtable<String, String>(feature.getConfigurations().get(config));
String[] pid = parsePid(config);
Configuration cfg = findExistingConfiguration(configAdmin, pid[0], pid[1]);
if (cfg == null) {
cfg = createConfiguration(configAdmin, pid[0], pid[1]);
String key = (pid[1] == null ? pid[0] : pid[0] + "-" + pid[1]);
props.put(CONFIG_KEY, key);
if (cfg.getBundleLocation() != null) {
cfg.setBundleLocation(null);
protected Configuration findExistingConfiguration(ConfigurationAdmin configurationAdmin,
String pid, String factoryPid) throws IOException, InvalidSyntaxException {
String filter;
if (factoryPid == null) {
filter = "(" + Constants.SERVICE_PID + "=" + pid + ")";
} else {
filter = "(" + ConfigurationAdmin.SERVICE_FACTORYPID + "=" + factoryPid + ")";
}
Configuration[] configurations = configurationAdmin.listConfigurations(filter);
if (configurations != null && configurations.length > 0)