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
@RunWith(Arquillian.class) | |
public class BusinessLogicTest { | |
// without .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml") Arquillian is not injecting the EJB here (its null). | |
@EJB | |
BusinessLogic bl; | |
@Deployment | |
public static JavaArchive createDeployment() { | |
return ShrinkWrap.create(JavaArchive.class) |
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
ejb.contextual.data-0.0.1-SNAPSHOT | |
. | |
├── META-INF | |
└── WEB-INF | |
├── beans.xml | |
├── classes | |
│ └── com | |
│ └── piotrnowicki | |
│ └── spikes | |
│ └── ejb |
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
@Test | |
public void dataIsPopulated() { | |
// given populated cache | |
// when | |
List<Question> questions = cut.getQuestions(); | |
// then | |
assertThat(questions.size()).isEqualTo(3); | |
} |
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
#!/bin/sh | |
BRANCH_NAME=$(git branch 2>/dev/null | grep -e ^* | tr -d ' *') | |
if [ -n "$BRANCH_NAME" ] && [ "$BRANCH_NAME" != "master" ]; then | |
echo "[$BRANCH_NAME] $(cat $1)" > $1 | |
fi |
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
WebArchive archive = ShrinkWrap.create(WebArchive.class).addPackages(true, "eu.awaketech.mymodule") | |
.addAsWebInfResource("beans.xml", "beans.xml") | |
.addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml"); | |
// To remove some package, I need to do: | |
archive.delete("/WEB-INF/classes/eu/awaketech/mymodule/config"); | |
// Wish I could do: | |
// - archive.delete(DataSource.class.getPackage()); | |
// - archive.delete(DataSource.class); |
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
#!/bin/bash | |
################################################################## | |
## Polish letters to UTF-8 translator | |
## | |
## www.PiotrNowicki.com | |
################################################################## | |
## | |
## The purpose of this script is to translate polish letters (with | |
## diacritical marks) to appropriate unicode characters. | |
## |
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
package com.piotrnowicki.btrace; | |
import static com.sun.btrace.BTraceUtils.printArray; | |
import static com.sun.btrace.BTraceUtils.println; | |
import static com.sun.btrace.BTraceUtils.strcat; | |
import java.lang.ref.WeakReference; | |
import com.sun.btrace.AnyType; | |
import com.sun.btrace.BTraceUtils.Aggregations; |
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
package com.piotrnowicki; | |
import javax.annotation.Resource; | |
import javax.ejb.SessionContext; | |
import javax.ejb.Stateless; | |
import javax.interceptor.AroundInvoke; | |
import javax.interceptor.Interceptors; | |
import javax.interceptor.InvocationContext; | |
@Stateless |
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
package com.piotrnowicki; | |
import javax.annotation.Resource; | |
import javax.ejb.SessionContext; | |
import javax.ejb.Stateless; | |
import javax.ejb.TransactionAttribute; | |
import javax.ejb.TransactionAttributeType; | |
import javax.persistence.EntityManager; | |
import javax.persistence.PersistenceContext; | |
import javax.transaction.TransactionSynchronizationRegistry; |
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
Index: src/test/java/com/sun/jersey/multipart/file/FileBasedOperationsHelper.java | |
=================================================================== | |
--- src/test/java/com/sun/jersey/multipart/file/FileBasedOperationsHelper.java (revision 0) | |
+++ src/test/java/com/sun/jersey/multipart/file/FileBasedOperationsHelper.java (revision 0) | |
@@ -0,0 +1,109 @@ | |
+/* | |
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | |
+ * | |
+ * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved. | |
+ * |
NewerOlder