Skip to content

Commit

Permalink
luotu 1 easyb testi
Browse files Browse the repository at this point in the history
  • Loading branch information
Redande committed Apr 11, 2016
1 parent 8c90a14 commit 8145d6a
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Ryhma57/nbproject/build-impl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ is divided into following sections:
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="Ryhma57-impl">
<import file="groovy-build.xml"/>
<fail message="Please build using Ant 1.8.0 or higher.">
<condition>
<not>
Expand Down Expand Up @@ -904,7 +905,7 @@ is divided into following sections:
<target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
<antcall target="clean"/>
</target>
<target depends="init,deps-jar" name="-pre-pre-compile">
<target depends="init,deps-jar,-groovy-init-macrodef-javac" name="-pre-pre-compile">
<mkdir dir="${build.classes.dir}"/>
</target>
<target name="-pre-compile">
Expand Down
7 changes: 5 additions & 2 deletions Ryhma57/nbproject/genfiles.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ build.xml.script.CRC32=56f3bb91
build.xml.stylesheet.CRC32=[email protected]
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=76bfd158
nbproject/build-impl.xml.script.CRC32=39ccce8a
nbproject/build-impl.xml.data.CRC32=aa5bea11
nbproject/build-impl.xml.script.CRC32=e244d7b1
nbproject/build-impl.xml.stylesheet.CRC32=[email protected]
nbproject/groovy-build.xml.data.CRC32=aa5bea11
nbproject/groovy-build.xml.script.CRC32=66297360
nbproject/groovy-build.xml.stylesheet.CRC32=[email protected]
93 changes: 93 additions & 0 deletions Ryhma57/nbproject/groovy-build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
*** GENERATED FROM project.xml - DO NOT EDIT ***
*** EDIT ../build.xml INSTEAD ***
-->
<project xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc">
<target name="-groovy-init-macrodef-javac">
<macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute name="srcdir" default="${src.dir}"/>
<attribute name="destdir" default="${build.classes.dir}"/>
<attribute name="classpath" default="${javac.classpath}"/>
<attribute name="includes" default="${includes}"/>
<attribute name="excludes" default="${excludes}"/>
<attribute name="debug" default="${javac.debug}"/>
<attribute name="sourcepath" default="${empty.dir}"/>
<attribute name="gensrcdir" default="${empty.dir}"/>
<attribute name="processorpath" default="${javac.processorpath}"/>
<attribute name="apgeneratedsrcdir" default="${build.generated.sources.dir}/ap-source-output"/>
<element name="customize" optional="true"/>
<sequential>
<taskdef name="groovyc" classpath="${javac.classpath}" classname="org.codehaus.groovy.ant.Groovyc"/>
<property name="empty.dir" location="${build.dir}/empty"/>
<mkdir dir="${empty.dir}"/>
<groovyc srcdir="@{srcdir}" sourcepath="@{sourcepath}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeAntRuntime="false" fork="true">
<src>
<dirset dir="@{gensrcdir}" erroronmissingdir="false">
<include name="*"/>
</dirset>
</src>
<classpath>
<path path="@{classpath}"/>
</classpath>
<javac debug="@{debug}" deprecation="${javac.deprecation}" encoding="${source.encoding}" source="${javac.source}" target="${javac.target}">
<compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
<customize/>
</javac>
</groovyc>
</sequential>
</macrodef>
<macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute name="srcdir" default="${src.dir}"/>
<attribute name="destdir" default="${build.classes.dir}"/>
<attribute name="classpath" default="${javac.classpath}"/>
<sequential>
<depend srcdir="@{srcdir}" destdir="@{destdir}" cache="${build.dir}/depcache" includes="${includes}" excludes="${excludes}">
<classpath>
<path path="@{classpath}"/>
</classpath>
</depend>
</sequential>
</macrodef>
<macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute name="destdir" default="${build.classes.dir}"/>
<sequential>
<fail unless="javac.includes">Must set javac.includes</fail>
<pathconvert property="javac.includes.binary" pathsep=",">
<path>
<filelist dir="@{destdir}" files="${javac.includes}"/>
</path>
<globmapper from="*.java" to="*.class"/>
</pathconvert>
<delete>
<files includes="${javac.includes.binary}"/>
</delete>
</sequential>
</macrodef>
</target>
<target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run-with-groovy">
<j2seproject3:test testincludes=""/>
</target>
<target depends="init,compile-test,-pre-test-run,-do-test-run-with-groovy" if="have.tests" name="-post-test-run-with-groovy">
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
</target>
<target depends="init,compile-test,-pre-test-run,-do-test-run-with-groovy,test-report,-post-test-run-with-groovy,-test-browse" description="Run unit tests." name="test-with-groovy"/>
<target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-groovy">
<fail unless="test.binarytestincludes">Must select some files in the IDE or set test.includes</fail>
<j2seproject3:test testincludes=""/>
</target>
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-groovy" if="have.tests" name="-post-test-run-single-groovy">
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
</target>
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-groovy,-post-test-run-single-groovy" description="Run single unit test." name="test-single-groovy"/>
<target depends="init,compile-test-single,-pre-test-run-single,-debug-start-debugger-test" name="-do-test-debug-single-groovy">
<fail unless="test.binarytestincludes">Must select some files in the IDE or set test.binarytestincludes</fail>
<j2seproject3:test-debug testincludes=""/>
</target>
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-debug-single-groovy" if="have.tests" name="-post-test-debug-single-groovy">
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
</target>
<target depends="init,compile-test-single,-pre-test-run-single,-debug-start-debugger-test,-do-test-debug-single-groovy,-post-test-debug-single-groovy" name="debug-test-with-groovy"/>
</project>
6 changes: 4 additions & 2 deletions Ryhma57/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
build.classes.excludes=**/*.java,**/*.form,**/*.groovy
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
Expand All @@ -29,7 +29,8 @@ dist.javadoc.dir=${dist.dir}/javadoc
excludes=
includes=**
jar.compress=false
javac.classpath=
javac.classpath=\
${libs.groovy-all.classpath}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
Expand Down Expand Up @@ -72,3 +73,4 @@ run.test.classpath=\
source.encoding=UTF-8
src.dir=src
test.src.dir=test
compile.on.save.unsupported.groovy=true
5 changes: 5 additions & 0 deletions Ryhma57/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1">
<extension file="groovy-build.xml" id="groovy">
<dependency dependsOn="-groovy-init-macrodef-javac" target="-pre-pre-compile"/>
</extension>
</buildExtensions>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>Ryhma57</name>
<source-roots>
Expand Down
19 changes: 19 additions & 0 deletions Ryhma57/test/easyb/add_reference.Story.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import ryhma57.backend.*;
import ryhma57.gui.*;

scenario "Lisää uusi referenssi",{
given "Applikaatio on olemassa ja meillä on fieldit", {
Application app = new Application()
EnumMap<BibtexReferenceField, String> fields
fields = new EnumMap<>(BibtexReferenceField.class)
fields.put(BibtexReferenceField.ID, "test")
}
when "Luo referenssi ja generoi database file", {
app.createNewBookReference()
app.generateBibTex()
}
then "Tarkista että tiedoston sisältö on merkkijono", {
String str = new String(Files.readAllBytes(Paths.get("database.bib")))
str.shouldNotBe null
}
}

0 comments on commit 8145d6a

Please sign in to comment.