CallableEngine.java

1
package com.jsql.model.injection.strategy.blind.callable;
2
3
import com.jsql.model.injection.strategy.blind.InjectionEngine;
4
import com.jsql.model.injection.strategy.blind.patch.Diff;
5
import com.jsql.model.injection.strategy.blind.patch.DiffMatchPatch;
6
7
import java.util.LinkedList;
8
import java.util.List;
9
import java.util.concurrent.CopyOnWriteArrayList;
10
11
public class CallableEngine extends AbstractCallableBit<CallableEngine> {
12
13
    private LinkedList<Diff> opcodes = new LinkedList<>();  // List of differences found between the reference page, and the present page
14
15
    private static final DiffMatchPatch DIFF_MATCH_PATCH = new DiffMatchPatch();
16
17
    private final InjectionEngine injectionCharInsertion;
18
19
    private final String metadataInjectionProcess;
20
21
    public CallableEngine(String inj, InjectionEngine injectionCharInsertion, String metadataInjectionProcess) {
22
        this.injectionCharInsertion = injectionCharInsertion;
23
        this.metadataInjectionProcess = metadataInjectionProcess;
24
        this.booleanUrl = inj;
25
    }
26
27
    @Override
28
    public boolean isTrue() {
29
        List<Diff> copyTrueMarks = new CopyOnWriteArrayList<>(this.injectionCharInsertion.getConstantTrueMark());
30
        for (Diff trueDiff: copyTrueMarks) {
31 1 1. isTrue : negated conditional → NO_COVERAGE
            if (!this.opcodes.contains(trueDiff)) {
32 1 1. isTrue : replaced boolean return with true for com/jsql/model/injection/strategy/blind/callable/CallableEngine::isTrue → NO_COVERAGE
                return false;
33
            }
34
        }
35 1 1. isTrue : replaced boolean return with false for com/jsql/model/injection/strategy/blind/callable/CallableEngine::isTrue → NO_COVERAGE
        return true;
36
    }
37
38
    @Override
39
    public CallableEngine call() {
40
        String source = this.injectionCharInsertion.callUrl(this.booleanUrl, this.metadataInjectionProcess, this);
41
        this.opcodes = CallableEngine.DIFF_MATCH_PATCH.diffMain(
42
            this.injectionCharInsertion.getBlankFalseMark(),
43
            source,
44
            false
45
        );
46 1 1. call : removed call to com/jsql/model/injection/strategy/blind/patch/DiffMatchPatch::diffCleanupEfficiency → NO_COVERAGE
        CallableEngine.DIFF_MATCH_PATCH.diffCleanupEfficiency(this.opcodes);
47 1 1. call : replaced return value with null for com/jsql/model/injection/strategy/blind/callable/CallableEngine::call → NO_COVERAGE
        return this;
48
    }
49
50
    public List<Diff> getOpcodes() {
51 1 1. getOpcodes : replaced return value with Collections.emptyList for com/jsql/model/injection/strategy/blind/callable/CallableEngine::getOpcodes → NO_COVERAGE
        return this.opcodes;
52
    }
53
}

Mutations

31

1.1
Location : isTrue
Killed by : none
negated conditional → NO_COVERAGE

32

1.1
Location : isTrue
Killed by : none
replaced boolean return with true for com/jsql/model/injection/strategy/blind/callable/CallableEngine::isTrue → NO_COVERAGE

35

1.1
Location : isTrue
Killed by : none
replaced boolean return with false for com/jsql/model/injection/strategy/blind/callable/CallableEngine::isTrue → NO_COVERAGE

46

1.1
Location : call
Killed by : none
removed call to com/jsql/model/injection/strategy/blind/patch/DiffMatchPatch::diffCleanupEfficiency → NO_COVERAGE

47

1.1
Location : call
Killed by : none
replaced return value with null for com/jsql/model/injection/strategy/blind/callable/CallableEngine::call → NO_COVERAGE

51

1.1
Location : getOpcodes
Killed by : none
replaced return value with Collections.emptyList for com/jsql/model/injection/strategy/blind/callable/CallableEngine::getOpcodes → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.22.1