This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Drone{ | |
Object work(); | |
} | |
public interface Expert extends Drone{ | |
final boolean knowledgable = true; | |
List<Object> work(); | |
} | |
public interface Manager { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(JUnit4TestRunner.class) | |
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class) | |
public class KarafTest { | |
@Inject | |
CommandProcessor commandProcessor; | |
@ProbeBuilder | |
public TestProbeBuilder probeConfiguration(TestProbeBuilder probe) { | |
probe.setHeader(Constants.DYNAMICIMPORT_PACKAGE, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testConfiguration_shouldHaveWrittenTheLaterOne() throws Exception { | |
ServiceReference[] allServiceReferences = ctx.getAllServiceReferences(ConfigurationAdmin.class.getName(), null); | |
for (ServiceReference serviceReference : allServiceReferences) { | |
ConfigurationAdmin service = (ConfigurationAdmin) ctx.getService(serviceReference); | |
try { | |
org.osgi.service.cm.Configuration configuration = service.getConfiguration("tests"); | |
assertEquals("myvalue2", configuration.getProperties().get("mykey")); | |
return; | |
} catch (Exception e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
import org.apache.commons.logging.Log; | |
import org.apache.commons.logging.LogFactory; | |
import org.apache.http.client.ClientProtocolException; | |
import org.apache.http.client.HttpClient; | |
import org.apache.http.client.ResponseHandler; | |
import org.apache.http.client.methods.HttpGet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.InvocationTargetException; | |
public class AllowMeToLetYouHandleErrors { | |
public static void main(String[] args) { | |
System.out.println("Yo, can I eat an error?"); | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function crossPlatformSpanTextUpdate(span, text) { | |
if ('textContent' in span) { | |
span.textContent = text; | |
} else { | |
span.innerText = text; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>An E-commerce retailer</title> | |
</head> | |
<body> | |
<h1> | |
Hello <span id="greeting">Placeholder</span>!</h1> | |
<h2> | |
Please <a href="https://www.blogger.com/buy/12345">buy</a> this product</h2> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>An E-commerce retailer</title> | |
</head> | |
<body> | |
<h1> | |
Hello <span id="greeting">Placeholder</span>!</h1> | |
<h2> | |
Please <a href="https://www.blogger.com/buy/12345">buy</a> this product</h2> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>An E-commerce retailer</title> | |
</head> | |
<body> | |
<h1> Hello <span id="greeting">Placeholder</span>!</h1> | |
<h2> Please <a href="buy/12345">buy</a> this product</h2> | |
</body> | |
<script src="greeting.js" type="module"></script> | |
<script type="module"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.nio.charset.StandardCharsets; | |
import java.nio.file.Path; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
import java.util.stream.Collectors; |