How to specify the input rule, so that created object uses the provided file name? The generated test uses test.txt instead of provided value… The log is below.
Thanks,
Wes
================================================================================
= Creating tests for ‘com.h.base.config.ConvertDevToServerEditorDef.:(Ljava/io/File;)V’ using ‘SiM (!sp, !fnm, df, !ris)’
09:18:12.931 [INFO][analyzer-service:TimedExecutor-224][c.d.f.b.d.e] Using custom input rule: C:\java\tfa-java-services\DiffblueRules.yml:2:4-5:70 factory type==java.io.File && className=~.\Qcom.h.base.config.ConvertDevToServerEditorDef\E. => java.io.File.:(Ljava/lang/String;)V [src/test/resources/devActypeEditorDef.json]
09:18:15.595 [INFO][analyzer-service:TimedExecutor-224][c.d.fuzztest.a.d] Refinement loop done: 2 seeds, 2+0 new+accumulated tests, 0+2 tests+partial tests, 502/1000 its, 2.657s, 5.3ms/it
09:18:16.481 [INFO][analyzer-service:grpc-default-executor-2][c.d.fuzztest.d.q] Created 2 partial tests via ‘SiM (!sp, !fnm, df, !ris)’, 2/2, here is the last one:
09:18:16.530 [INFO][analyzer-service:grpc-default-executor-2][c.d.fuzztest.d.q] == begin partial test ==
09:18:16.531 [INFO][analyzer-service:grpc-default-executor-2][c.d.fuzztest.d.q] Test:
package com.h.base.config;
import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
import javax.xml.parsers.ParserConfigurationException;
import org.junit.Ignore;
import org.junit.Test;
import org.xml.sax.SAXException;
public class ConvertDevToServerEditorDefTest {
/**
-
Method under test: {@link ConvertDevToServerEditorDef#ConvertDevToServerEditorDef(File)}
*/
@Test
@Ignore(“TODO: Complete this test”)
public void testConstructor() throws IOException, ParserConfigurationException, SAXException {
// Arrange
File dbSchemaFile = Paths.get(System.getProperty(“java.io.tmpdir”), “test.txt”).toFile();// Act
new ConvertDevToServerEditorDef(dbSchemaFile);
}
}
09:18:16.533 [INFO][analyzer-service:grpc-default-executor-2][c.d.fuzztest.d.q] Reason to be partial:
com.diffblue.cover.exception.limitation.NoNonThrowingInputsException: No generated test that does not throw a trivial exception: org.xml.sax.SAXParseException
at com.diffblue.fuzztest.a.d.a(SourceFile:383)
at com.diffblue.fuzztest.a.d.a(SourceFile:2685)
at com.diffblue.fuzztest.a.d.a(SourceFile:223)
at com.diffblue.fuzztest.d.p.a(SourceFile:1268)
at com.diffblue.fuzztest.d.t.a(SourceFile:84)
at com.diffblue.fuzztest.d.s.a(SourceFile:45)
at com.diffblue.fuzztest.d.b.k(SourceFile:321)
at com.diffblue.cover.sandbox.execution.WorkerThread.lambda$callWorkerThread$3(SourceFile:134)
at com.diffblue.cover.sandbox.execution.WorkerThread.run(SourceFile:207)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:261)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at java.xml/javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:122)
at com.h.base.config.ConvertDevToServerEditorDef.initDbSchema(ConvertDevToServerEditorDef.java:83)
at com.h.base.config.ConvertDevToServerEditorDef.(ConvertDevToServerEditorDef.java:76)
at jdk.internal.reflect.GeneratedConstructorAccessor25.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at com.diffblue.tir.a.h.a(SourceFile:75)
at com.diffblue.tir.a.a.c.a(SourceFile:656)
at com.diffblue.tir.a.f.b(SourceFile:411)
at com.diffblue.tir.a.f.a(SourceFile:79)
at com.diffblue.tir.d.d.a(SourceFile:25)
at com.diffblue.tir.a.g.a(SourceFile:214)
at com.diffblue.tir.a.g.a(SourceFile:148)
at com.diffblue.fuzztest.a.d.a(SourceFile:754)
at com.diffblue.cover.sandbox.execution.TimedCallableExecutor$CallableFuture.executeTask(SourceFile:27)
at com.diffblue.cover.sandbox.execution.TimedExecutor$TaskQueueRunner.run(SourceFile:66)
… 1 common frames omitted
09:18:16.552 [INFO][analyzer-service:grpc-default-executor-2][c.d.fuzztest.d.q] == end partial test ==
09:18:16.552 [INFO][analyzer-service:grpc-default-executor-2][c.d.fuzztest.d.q] All 2 subs either threw or created only partial tests; returning the 2 partial tests created by ‘SiM (!sp, fnm, df, !ris)’
09:18:16.554 [INFO][analyzer-service:TimedExecutor-443][c.d.fuzztest.d.b]