[testedby-commit] [testedby] r185 committed - Create a sample demonstrating classes instrumentation...

1 view
Skip to first unread message

test...@googlecode.com

unread,
Apr 17, 2010, 5:27:45 PM4/17/10
to testedb...@googlegroups.com
Revision: 185
Author: maestri.stefano
Date: Sat Apr 17 14:27:02 2010
Log: Create a sample demonstrating classes instrumentation
New issue
Summary: Create a sample demonstrating classes instrumentation
Status: Fixed
Labels: Type-Enhancement Priority-High

Create a sample demonstrating classes instrumentation. We need just a very
simple class under test and its own test classes.
In other issues we can complete this sample with more complex ones and/or
with documentation explaining what is happening under the wood.
http://code.google.com/p/testedby/source/detail?r=185

Added:
/samples/trunk/FixIssue.tmpl
/samples/trunk/NewIssue.tmpl
/samples/trunk/UpdateIssue.tmpl
/samples/trunk/pom.xml
/samples/trunk/src
/samples/trunk/src/main
/samples/trunk/src/main/java
/samples/trunk/src/main/java/it
/samples/trunk/src/main/java/it/javalinux
/samples/trunk/src/main/java/it/javalinux/testedby
/samples/trunk/src/main/java/it/javalinux/testedby/sample
/samples/trunk/src/main/java/it/javalinux/testedby/sample/instrumentation

/samples/trunk/src/main/java/it/javalinux/testedby/sample/instrumentation/App.java
/samples/trunk/src/test
/samples/trunk/src/test/java
/samples/trunk/src/test/java/it
/samples/trunk/src/test/java/it/javalinux
/samples/trunk/src/test/java/it/javalinux/testedby
/samples/trunk/src/test/java/it/javalinux/testedby/sample
/samples/trunk/src/test/java/it/javalinux/testedby/sample/instrumentation

/samples/trunk/src/test/java/it/javalinux/testedby/sample/instrumentation/AppTest.java

=======================================
--- /dev/null
+++ /samples/trunk/FixIssue.tmpl Sat Apr 17 14:27:02 2010
@@ -0,0 +1,7 @@
+#commit comment here
+
+
+#Complete next line with issue number
+Fixes issue
+
+#Comment text for the issue tracker goes here
=======================================
--- /dev/null
+++ /samples/trunk/NewIssue.tmpl Sat Apr 17 14:27:02 2010
@@ -0,0 +1,20 @@
+#commit comment here
+
+
+#next line doesn't need any number. ssue number will be automaticaly
assigned after commit
+New issue
+#A summary is always needed. Please complete next line
+Summary:
+#Uncomment the rigt Status
+#Status: Accepted
+#Status: Fixed
+#Status: New
+#Uncommet right Labels and/or add labels to the list (comma or space
separate)
+#Labels: Type-Defect Priority-Medium
+#Labels: Type-Defect Priority-High
+#Labels: Type-Defect Priority-Critical
+#Labels: Type-Enhancement Priority-Medium
+#Labels: Type-Enhancement Priority-Low
+#Labels: Type-Enhancement Priority-High
+
+#Comment text for the issue tracker goes here
=======================================
--- /dev/null
+++ /samples/trunk/UpdateIssue.tmpl Sat Apr 17 14:27:02 2010
@@ -0,0 +1,20 @@
+#commit comment here
+
+
+#Complete next line with issue number
+Update issue
+#summary is rarely updated. If you need that uncomment and complete next
line
+#Summary:
+#Uncomment the new Status you would get your issue. No uncomment status
will keep the previous status
+#Status: Accepted
+#Status: Fixed
+#Status: New
+#Uncommet Labels and/or add labels to the list (comma or space separate)
if you want update/add Labels
+#Labels: Type-Defect Priority-Medium
+#Labels: Type-Defect Priority-High
+#Labels: Type-Defect Priority-Critical
+#Labels: Type-Enhancement Priority-Medium
+#Labels: Type-Enhancement Priority-Low
+#Labels: Type-Enhancement Priority-High
+
+#Comment text for the issue tracker goes here
=======================================
--- /dev/null
+++ /samples/trunk/pom.xml Sat Apr 17 14:27:02 2010
@@ -0,0 +1,57 @@
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>it.javalinux.testedby</groupId>
+ <artifactId>testedbySample</artifactId>
+ <packaging>jar</packaging>
+ <version>0.0.1-SNAPSHOT</version>
+ <name>testedbySample</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.7</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>it.javalinux.testedby</groupId>
+ <artifactId>TestedBy</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>it.javalinux.testedby.plugins</groupId>
+ <artifactId>maven-testedby-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <configuration>
+ <verbose>true</verbose>
+ <staleMillis>100</staleMillis>
+
<runnerClass>it.javalinux.testedby.runner.impl.JunitTestRunner</runnerClass>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>process-test-classes</phase>
+ <goals>
+ <goal>testedby</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <maxmem>256M</maxmem>
+ <fork>${compiler.fork}</fork>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
=======================================
--- /dev/null
+++
/samples/trunk/src/main/java/it/javalinux/testedby/sample/instrumentation/App.java
Sat Apr 17 14:27:02 2010
@@ -0,0 +1,42 @@
+package it.javalinux.testedby.sample.instrumentation;
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ private String foo;
+
+ private int fooInt;
+
+ /**
+ * @return foo
+ */
+ public String getFoo() {
+ return foo;
+ }
+
+ /**
+ * @param foo Sets foo to the specified value.
+ */
+ public void setFoo(String foo) {
+ this.foo = foo;
+ }
+
+ /**
+ * @return fooInt
+ */
+ public int getFooInt() {
+ return fooInt;
+ }
+
+ /**
+ * @param fooInt Sets fooInt to the specified value.
+ */
+ public void setFooInt(int fooInt) {
+ this.fooInt = fooInt;
+ }
+
+
+}
=======================================
--- /dev/null
+++
/samples/trunk/src/test/java/it/javalinux/testedby/sample/instrumentation/AppTest.java
Sat Apr 17 14:27:02 2010
@@ -0,0 +1,79 @@
+/*
+ * Stefano Maestri, javalinux.it Copyright 2010, and individual
contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package it.javalinux.testedby.sample.instrumentation;
+
+import static org.hamcrest.core.IsEqual.equalTo;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author oracle
+ *
+ */
+public class AppTest {
+
+ public App app;
+
+ /**
+ * Test method for {@link
it.javalinux.testedby.sample.instrumentation.App#getFoo()}.
+ */
+ @Test
+ public void testGetFooAlwaysPass() {
+ app.getFoo();
+ assertTrue(true);
+ }
+
+ /**
+ * Test method for {@link
it.javalinux.testedby.sample.instrumentation.App#setFoo(java.lang.String)}.
+ */
+ @Test
+ public void testSetFooAlwaysPass() {
+ app.setFoo("foo");
+ assertThat(app.getFoo(), equalTo("foo"));
+ }
+
+ /**
+ * Test method for {@link
it.javalinux.testedby.sample.instrumentation.App#getFooInt()}.
+ */
+ @Test
+ public void testGetFooIntAlwaysPass() {
+ app.getFooInt();
+ assertTrue(true);
+ }
+
+ /**
+ * Test method for {@link
it.javalinux.testedby.sample.instrumentation.App#setFooInt(int)}.
+ */
+ @Test
+ public void testSetFooIntAlwaysPass() {
+ app.setFooInt(2);
+ assertThat(app.getFooInt(), equalTo(2));
+ }
+
+ @Before
+ public void before() {
+ app = new App();
+ }
+
+}

--
You received this message because you are subscribed to the Google Groups "testedby-commit" group.
To post to this group, send email to testedb...@googlegroups.com.
To unsubscribe from this group, send email to testedby-comm...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testedby-commit?hl=en.

Reply all
Reply to author
Forward
0 new messages