Revision 3dff50a1
Added by Andreas Müller about 13 years ago
XperCdmIntegration/src/test/java/eu/etaxonomy/cdm/io/xper/TestAdapterCdmXper.java | ||
---|---|---|
24 | 24 |
* |
25 | 25 |
*/ |
26 | 26 |
private boolean startApplications() { |
27 |
boolean result = false; |
|
27 | 28 |
DbSchemaValidation dbSchemaValidation = DbSchemaValidation.VALIDATE; |
28 | 29 |
ICdmDataSource datasource = CdmDestinations.cdm_test_local_xper(); |
29 | 30 |
System.out.println("cdm start"); |
... | ... | |
36 | 37 |
return false; |
37 | 38 |
}else{ |
38 | 39 |
UUID uuidWorkingSet = workingSets.iterator().next().getUuid(); |
39 |
adapterCdmXper = new CdmXperAdapter(appCtr, uuidWorkingSet); |
|
40 |
|
|
41 |
adapterCdmXper = (CdmXperAdapter)appCtr.getBean("cdmXperAdapter"); |
|
42 |
// adapterCdmXper = new CdmXperAdapter(appCtr, uuidWorkingSet); |
|
43 |
result = adapterCdmXper.startXper(uuidWorkingSet); |
|
40 | 44 |
} |
45 |
|
|
46 |
return result; |
|
41 | 47 |
|
42 |
|
|
43 |
|
|
44 |
Thread t = new Thread() { |
|
45 |
public void run() { |
|
46 |
new Xper(adapterCdmXper); |
|
47 |
} |
|
48 |
}; |
|
49 |
System.out.println("xper2 start"); |
|
50 |
t.start(); |
|
51 |
while(!XPApp.xperReady){ |
|
52 |
//TODO wait |
|
53 |
} |
|
54 |
System.out.println("xper2 started :::"); |
|
55 |
return true; |
|
56 | 48 |
} |
57 | 49 |
|
58 | 50 |
public void xperloadDataFromCdm(){ |
... | ... | |
139 | 131 |
* @param args |
140 | 132 |
*/ |
141 | 133 |
public static void main(String[] args) { |
142 |
System.out.println("start test"); |
|
134 |
System.out.println("start test adapter");
|
|
143 | 135 |
//start CDM and Xper |
144 | 136 |
TestAdapterCdmXper testAdapter = new TestAdapterCdmXper(); |
145 | 137 |
boolean success = testAdapter.startApplications(); |
138 |
while(!XPApp.xperReady){ |
|
139 |
try { |
|
140 |
Thread.sleep(200); |
|
141 |
} catch (InterruptedException e) { |
|
142 |
e.printStackTrace(); |
|
143 |
} |
|
144 |
} |
|
145 |
System.out.println("xper2 started :::"); |
|
146 | 146 |
if (success){ |
147 | 147 |
testAdapter.createThumbnailDirectory(); |
148 | 148 |
if (args.length >= 1 && "-p".equals(args[0]) ){ |
... | ... | |
156 | 156 |
testAdapter.generateThumbnails(); |
157 | 157 |
} |
158 | 158 |
}else{ |
159 |
System.out.println("end test adapter with errors"); |
|
159 | 160 |
System.exit(-1); |
161 |
|
|
160 | 162 |
} |
163 |
System.out.println("end test adapter"); |
|
161 | 164 |
|
162 | 165 |
|
163 | 166 |
} |
Also available in: Unified diff
new implementation for Xper data fetching from persistence and some further changes to Xper