Skip to content

Commit

Permalink
modified cobra test; works on windows x64 but kept @ignore since bug #24
Browse files Browse the repository at this point in the history
 is still open
  • Loading branch information
shalinshah1993 committed Jun 12, 2018
1 parent f5ac28e commit f67be67
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/test/java/org/simulator/fba/CobraSolverTest.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.simulator.fba;

import static org.junit.Assert.*;

import org.junit.Ignore;
import org.junit.Test;

import java.io.InputStream;
import java.util.Arrays;
import javax.xml.stream.XMLStreamException;

import org.sbml.jsbml.SBMLReader;
Expand All @@ -18,9 +18,11 @@

public class CobraSolverTest {
private static final Logger logger = LoggerFactory.getLogger(CobraSolverTest.class);
private double eps = 1E-4;
private double COBRA_OBJ_VAL = 0.8739215069684307;

@Test
@Ignore // breaks on Ubuntu: https://github.com/shalinshah1993/SBSCL/issues/24
@Ignore
public void solveEColiCore() throws ModelOverdeterminedException, XMLStreamException {

String resourceName = "fba/e_coli_core.xml";
Expand All @@ -31,12 +33,11 @@ public void solveEColiCore() throws ModelOverdeterminedException, XMLStreamExcep
logger.info(doc.toString());

COBRAsolver solver = new COBRAsolver(doc);
if (solver.solve()) {
System.out.println(resourceName);
System.out.println("Objective value:\t" + solver.getObjetiveValue());
System.out.println("Fluxes:\t" + Arrays.toString(solver.getValues()));
} else {
logger.error("\nSolver returned null for " + resourceName);
}

// Solver should return non-null object
assertNotNull(solver.solve());

// Objective value should math CobraPy answer with some tolerance
assertEquals(COBRA_OBJ_VAL, solver.getObjetiveValue(), eps);
}
}

0 comments on commit f67be67

Please sign in to comment.