Skip to content

Instantly share code, notes, and snippets.

View Steve973's full-sized avatar

Steve Storck Steve973

View GitHub Profile
@Steve973
Steve973 / pom-snippet.xml
Created February 29, 2016 11:36
Profile for Arquillian stuff
<profiles>
<profile>
<id>test</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<skipTests>false</skipTests>
<skipUnitTests>${skipTests}</skipUnitTests>
<skipIntegrationTests>${skipTests}</skipIntegrationTests>
@Steve973
Steve973 / ExampleTestSupport.groovy
Created February 29, 2016 11:44
Test support class
package example.itest
import org.apache.karaf.features.BootFinished
import org.apache.karaf.features.FeaturesService
import org.jboss.arquillian.test.api.ArquillianResource
import org.jboss.shrinkwrap.api.ShrinkWrap
import org.jboss.shrinkwrap.api.spec.JavaArchive
import org.jboss.shrinkwrap.osgi.api.BndProjectBuilder
import org.junit.Assert
import org.osgi.framework.Bundle
@Steve973
Steve973 / MANIFEST.MF
Created February 29, 2016 11:52
Test bundle manifest
Manifest-Version: 1.0
Bundle-SymbolicName: ExampleCommandAndControlIT.arquillian-test-bundle
Export-Package: example.c2.itest
Bundle-Name: ExampleCommandAndControlIT.arquillian-test-bundle
Bundle-Version: 1.0.0.SNAPSHOT
Bnd-LastModified: 1456745190092
Bundle-ManifestVersion: 2
Import-Package: org.jboss.arquillian.container.test.api,org.jboss.arqu
illian.junit,org.jboss.arquillian.osgi,org.jboss.arquillian.test.api,
org.jboss.shrinkwrap.api,org.jboss.shrinkwrap.api.asset,org.jboss.shr
@Steve973
Steve973 / jar-contents.txt
Created February 29, 2016 12:04
test jar contents
META-INF/
example/itest/marker/IntegrationTest.class
example/
example/itest/
example/itest/marker/
spock/lang/MockingApi.class
spock/
spock/lang/
example/c2/itest/ExampleCommandAndControlIT.class
example/
@Steve973
Steve973 / DynamicRouterYamlRoutesIT-context.xml
Last active November 13, 2023 21:56
Test snippet where I am trying to load YAML routes
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="dynamic-router" class="org.apache.camel.component.dynamicrouter.DynamicRouterComponent"/>
<camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" />
</beans>
int8_t calculate_direction(bool rotate) {
vikstik_coordinate_t coordinates = read_vikstik_raw();
int8_t direction = calculate_raw_direction(coordinates);
if (rotate && direction > -1) {
switch (vikstik_config.up_orientation) {
case JS_LEFT:
direction = (direction + 3) % ORIENTATION_COUNT;
break;
case JS_DOWN:
direction = (direction + 2) % ORIENTATION_COUNT;