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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>foo</groupId> | |
<artifactId>bar</artifactId> | |
<version>1.0</version> | |
<packaging>jar</packaging> | |
<name>manager</name> |
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 class App | |
{ | |
private static String[] jettyConfigurationClasses = | |
{ | |
"org.eclipse.jetty.webapp.WebInfConfiguration", | |
"org.eclipse.jetty.webapp.WebXmlConfiguration", | |
"org.eclipse.jetty.webapp.MetaInfConfiguration", | |
"org.eclipse.jetty.webapp.FragmentConfiguration", | |
"org.eclipse.jetty.plus.webapp.EnvConfiguration", |
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
<dependency> | |
<groupid>com.sun.faces</groupid> | |
<artifactid>jsf-api</artifactid> | |
<version>2.1.7</version> | |
</dependency> | |
<dependency> | |
<groupid>com.sun.faces</groupid> | |
<artifactid>jsf-impl</artifactid> | |
<version>2.1.7</version> | |
<scope>runtime</scope> |
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
@Path("/deed") | |
@RequestScoped | |
public class DeedService | |
{ | |
@Inject | |
private GoodStuff goodStuff; | |
@POST | |
@Path("/good") | |
public Response doGoodDeed() |
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
@Entity | |
public class Deed implements Serializable | |
{ | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
private Integer id; | |
@Column | |
private String altruist; | |
@Column | |
private String recipient; |
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 class Main { | |
private class Foo { | |
} | |
private static <T> T readValue(String response, Class<T> returnType) { | |
try { | |
return returnType.newInstance(); | |
} catch (InstantiationException 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
public class Main { | |
private static <T> T readValue(String response, Class<T> returnType) { | |
try { | |
return returnType.newInstance(); | |
} catch (InstantiationException e) { | |
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. | |
} catch (IllegalAccessException e) { | |
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. |
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
@implementation CardTest | |
- (void)testShouldKnowCardCannotMatchEmptyCardList { | |
Card *card = [Card new]; | |
NSArray *otherCards = [NSArray new]; | |
STAssertEquals(0, [card match:otherCards], @"Should not match empty card list."); | |
} | |
@end |
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
@implementation Card { | |
} | |
- (int)match:(NSArray *)cards { | |
return 0; | |
} |
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
@implementation CardTest | |
- (void)testShouldKnowCardCannotMatchEmptyCardList { | |
Card *card = [Card new]; | |
NSArray *otherCards = [NSArray new]; | |
STAssertEquals(0, [card match:otherCards], @"Should not match empty card list."); | |
} | |
- (void)testShouldMatchCardWhenCardListContainsCardWithSameContent { | |
Card *card = [[Card alloc] initWithContents:@"Test Card"]; | |
Card *matchingCard = [[Card alloc] initWithContents:@"Test Card"]; |