help eclipse: Instrumentation + Maven

253 views
Skip to first unread message

Gladyston Batista

unread,
Oct 6, 2012, 10:30:06 AM10/6/12
to activejd...@googlegroups.com
I'm not able to run the instrumentation automatically. I tried doing a method "make", but neither worked.
The file "pom.xml" follows and attachment.


package br.com.eacsoftware.pagatto.webservice.integracao.saci;

import org.javalite.activejdbc.DB;
import org.javalite.instrumentation.Instrumentation;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

import br.com.eacsoftware.pagatto.webservice.integracao.saci.models.Produto;

public class MyTest {

  @BeforeTest
  public static void make() {
    try {
      Instrumentation instrumentation = new Instrumentation();
      instrumentation.setOutputDirectory(ClassLoader.getSystemResource("").getPath());
      instrumentation.instrument();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  @Test
  public void list
Attribute() {

    DB sqldados = new DB("sqldados");
    sqldados.open("com.mysql.jdbc.Driver", "jdbc:mysql://localhost/sqldados", "root", "");

    for (Object object : Produto.getMetaModel().getAttributeNamesSkipGenerated()) {
      System.out.print(object + ", ");
    }
  }
}




[TestNG] Running:
  /tmp/testng-eclipse-1200053159/testng-customsuite.xml

**************************** START INSTRUMENTATION ****************************
Directory: /home/gladyston/workspace/integracaoSACI/target/test-classes/
**************************** END INSTRUMENTATION ****************************
FAILED: listAttribute
org.javalite.activejdbc.DBException: failed to determine Model class name, are you sure models have been instrumented?
    at org.javalite.activejdbc.Model$ClassGetter.getClassName(Model.java:2289)
    at org.javalite.activejdbc.Model.getClassName(Model.java:2262)
    at org.javalite.activejdbc.Model.getDaClass(Model.java:2254)
    at org.javalite.activejdbc.Model.getMetaModel(Model.java:58)
    at br.com.eacsoftware.pagatto.webservice.integracao.saci.MyTest.listAttribute(MyTest.java:32)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at org.testng.TestRunner.privateRun(TestRunner.java:767)
    at org.testng.TestRunner.run(TestRunner.java:617)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1197)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1122)
    at org.testng.TestNG.run(TestNG.java:1030)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: org.javalite.activejdbc.InitException: failed to determine Model class name, are you sure models have been instrumented?
    ... 29 more



Atenciosamente,
--
Gladyston Batista
Belo Horizonte - Brazil
pom.xml

igor

unread,
Oct 6, 2012, 8:24:15 PM10/6/12
to activejd...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages