vamorim
vamorim
:? Deu falso nos dois.
Isso me deixa ainda mais confuso. Pq então funcionaria o teste standalone?
vamorim
O menino tá muito chorão hoje… Esse código retorna true se for standalone e falso se for web…
package persistent.prevayler;
import java.io.IOException;
import org.prevayler.Prevayler;
import org.prevayler.PrevaylerFactory;
public class MyPrevayler {
private Prevayler prevayler;
public MyPrevayler() {
MySystem aMySystem = new MySystem();
PrevaylerFactory factory = new PrevaylerFactory();
factory.configurePrevalenceBase("data");
factory.configurePrevalentSystem(aMySystem);
try {
prevayler = factory.create();
prevayler.takeSnapshot();
Object s = prevayler.prevalentSystem();
boolean t1 = s.getClass() == MySystem.class;
System.out.println(t1);
boolean t2 = s.getClass().equals(MySystem.class);
System.out.println(t2);
} catch (IOException exIO) {
exIO.printStackTrace();
System.exit(1);
} catch (ClassNotFoundException exClassNotFound) {
exClassNotFound.printStackTrace();
System.exit(1);
}
}
public Prevayler getPrevayler() {
return prevayler;
}
}
vamorim
Realmente era problema com o classpath…