This file contains hidden or 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 class TestWicket { | |
WicketTester tester = new WicketTester(); | |
@BeforeMethod | |
public void setUp() throws Exception { | |
tester = new WicketTester(); | |
} | |
@AfterMethod |
This file contains hidden or 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 org.mockito.internal.util.MockUtil; | |
import org.springframework.beans.BeansException; | |
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter; | |
/** | |
* Do not process wiring for mock which contains @Autowired / @inject annotations | |
*/ | |
public class MockBeanFactory extends InstantiationAwareBeanPostProcessorAdapter { | |
private static final MockUtil mockUtil = new MockUtil(); |
This file contains hidden or 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
<plugin> | |
<groupId>org.codehaus.groovy.maven</groupId> | |
<artifactId>gmaven-plugin</artifactId> | |
<executions> | |
<execution> | |
<phase>generate-sources</phase> | |
<goals> | |
<goal>execute</goal> | |
</goals> | |
This file contains hidden or 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 class MockPostProcessorAdapter extends InstantiationAwareBeanPostProcessorAdapter { | |
private static final MockUtil mockUtil = new MockUtil(); | |
public MockPostProcessorAdapter() { | |
super(); | |
} | |
@Override | |
public boolean postProcessAfterInstantiation(Object bean, String beanName) throws BeansException { |
This file contains hidden or 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 akka.stream.stage.{GraphStageLogic, GraphStageWithMaterializedValue, InHandler, OutHandler} | |
import akka.stream.{Attributes, FlowShape, Inlet, Outlet} | |
trait ValveSwitch { | |
def open: Unit | |
def close: Unit | |
} | |
class Valve[A](mode: ValveMode = ValveMode.Open) extends GraphStageWithMaterializedValue[FlowShape[A, A], ValveSwitch] { |
This file contains hidden or 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
https://github.com/juretta/git-pastiche | |
https://askubuntu.com/questions/31216/setting-up-aliases-in-zsh | |
https://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html | |
postman |
This file contains hidden or 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
private class WriteChannelSource(channel: WriteChannel) extends GraphStage[SinkShape[ByteString]] { | |
val in: Inlet[ByteString] = Inlet.create[ByteString]("WriteChannelSource.in") | |
val shape: SinkShape[ByteString] = SinkShape.of(in) | |
override def createLogic(inheritedAttributes: Attributes): GraphStageLogic = new WriteChannelStageLogic() | |
private class WriteChannelStageLogic extends GraphStageLogic(shape) with InHandler { | |
override def onPush(): Unit = { | |
val data = grab(in) |
This file contains hidden or 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
// with graph | |
private object WriteChannelSource { | |
def apply(channel: WriteChannel): WriteChannelSource = new WriteChannelSource(channel) | |
} | |
private class WriteChannelSource(channel: WriteChannel) extends GraphStage[SinkShape[ByteString]] { | |
val in: Inlet[ByteString] = Inlet.create[ByteString]("WriteChannelSource.in") | |
val shape: SinkShape[ByteString] = SinkShape.of(in) |
This file contains hidden or 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
def shortId(id: UUID, length: Int = 10): String = { | |
(id.toString.reverse.take(Math.floor(length/2).toInt) + "-" + UUID.randomUUID().toString.reverse.take(Math.ceil(length/2).toInt)).toUpperCase | |
} |
This file contains hidden or 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 com.oss.nas1570.Nas1570 | |
import com.oss.nas1570.NASCoder; | |
import com.oss.nas1570.Nas1570; | |
import java.nio.ByteBuffer; | |
public class Test { | |
public static void main(String[] args) throws Throwable { | |
// NAS 2.0.0 - nasjava-r15.7.0 |